Loading libs/ui/GraphicBufferAllocator.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -63,7 +63,7 @@ void GraphicBufferAllocator::dump(String8& result) const const size_t c = list.size(); for (size_t i=0 ; i<c ; i++) { const alloc_rec_t& rec(list.valueAt(i)); snprintf(buffer, SIZE, "%10p: %7.2f KiB | %4u (%4u) x %4u | %8X | 0x%08x\n", snprintf(buffer, SIZE, "%10p: %7.2f KiB | %4u (%4u) x %4u | %2d | 0x%08x\n", list.keyAt(i), rec.size/1024.0f, rec.w, rec.s, rec.h, rec.format, rec.usage); result.append(buffer); Loading services/surfaceflinger/Layer.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -120,8 +120,7 @@ void Layer::onRemoved() sp<LayerBaseClient::Surface> Layer::createSurface() const { sp<Surface> sur(new SurfaceLayer(mFlinger, const_cast<Layer *>(this))); return sur; return mSurface; } status_t Layer::ditch() Loading @@ -131,6 +130,10 @@ status_t Layer::ditch() // the layer is not on screen anymore. free as much resources as possible mFreezeLock.clear(); EGLDisplay dpy(mFlinger->graphicPlane(0).getEGLDisplay()); mBufferManager.destroy(dpy); mSurface.clear(); Mutex::Autolock _l(mLock); mWidth = mHeight = 0; return NO_ERROR; Loading Loading @@ -175,6 +178,7 @@ status_t Layer::setBuffers( uint32_t w, uint32_t h, int layerRedsize = info.getSize(PixelFormatInfo::INDEX_RED); mNeedsDithering = layerRedsize > displayRedSize; mSurface = new SurfaceLayer(mFlinger, this); return NO_ERROR; } Loading services/surfaceflinger/Layer.h +1 −0 Original line number Diff line number Diff line Loading @@ -211,6 +211,7 @@ private: ClientRef mUserClientRef; // constants sp<Surface> mSurface; PixelFormat mFormat; const GLExtensions& mGLExtensions; bool mNeedsBlending; Loading services/surfaceflinger/LayerBase.cpp +6 −26 Original line number Diff line number Diff line Loading @@ -515,21 +515,13 @@ void LayerBase::dump(String8& result, char* buffer, size_t SIZE) const result.append(buffer); } void LayerBase::shortDump(String8& result, char* scratch, size_t size) const { LayerBase::dump(result, scratch, size); } // --------------------------------------------------------------------------- int32_t LayerBaseClient::sIdentity = 1; LayerBaseClient::LayerBaseClient(SurfaceFlinger* flinger, DisplayID display, const sp<Client>& client) : LayerBase(flinger, display), mHasSurface(false), mClientRef(client), : LayerBase(flinger, display), mClientRef(client), mIdentity(uint32_t(android_atomic_inc(&sIdentity))) { } Loading @@ -546,18 +538,12 @@ sp<LayerBaseClient::Surface> LayerBaseClient::getSurface() { sp<Surface> s; Mutex::Autolock _l(mLock); LOG_ALWAYS_FATAL_IF(mHasSurface, "LayerBaseClient::getSurface() has already been called"); mHasSurface = true; s = mClientSurface.promote(); if (s == 0) { s = createSurface(); mClientSurfaceBinder = s->asBinder(); return s; mClientSurface = s; } wp<IBinder> LayerBaseClient::getSurfaceBinder() const { return mClientSurfaceBinder; return s; } sp<LayerBaseClient::Surface> LayerBaseClient::createSurface() const Loading @@ -580,12 +566,6 @@ void LayerBaseClient::dump(String8& result, char* buffer, size_t SIZE) const result.append(buffer); } void LayerBaseClient::shortDump(String8& result, char* scratch, size_t size) const { LayerBaseClient::dump(result, scratch, size); } // --------------------------------------------------------------------------- LayerBaseClient::Surface::Surface( Loading services/surfaceflinger/LayerBase.h +1 −5 Original line number Diff line number Diff line Loading @@ -206,7 +206,6 @@ public: /** always call base class first */ virtual void dump(String8& result, char* scratch, size_t size) const; virtual void shortDump(String8& result, char* scratch, size_t size) const; enum { // flags for doTransaction() Loading Loading @@ -285,7 +284,6 @@ public: virtual ~LayerBaseClient(); sp<Surface> getSurface(); wp<IBinder> getSurfaceBinder() const; virtual sp<Surface> createSurface() const; virtual sp<LayerBaseClient> getLayerBaseClient() const { return const_cast<LayerBaseClient*>(this); } Loading Loading @@ -327,12 +325,10 @@ public: protected: virtual void dump(String8& result, char* scratch, size_t size) const; virtual void shortDump(String8& result, char* scratch, size_t size) const; private: mutable Mutex mLock; mutable bool mHasSurface; wp<IBinder> mClientSurfaceBinder; mutable wp<Surface> mClientSurface; const wp<Client> mClientRef; // only read const uint32_t mIdentity; Loading Loading
libs/ui/GraphicBufferAllocator.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -63,7 +63,7 @@ void GraphicBufferAllocator::dump(String8& result) const const size_t c = list.size(); for (size_t i=0 ; i<c ; i++) { const alloc_rec_t& rec(list.valueAt(i)); snprintf(buffer, SIZE, "%10p: %7.2f KiB | %4u (%4u) x %4u | %8X | 0x%08x\n", snprintf(buffer, SIZE, "%10p: %7.2f KiB | %4u (%4u) x %4u | %2d | 0x%08x\n", list.keyAt(i), rec.size/1024.0f, rec.w, rec.s, rec.h, rec.format, rec.usage); result.append(buffer); Loading
services/surfaceflinger/Layer.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -120,8 +120,7 @@ void Layer::onRemoved() sp<LayerBaseClient::Surface> Layer::createSurface() const { sp<Surface> sur(new SurfaceLayer(mFlinger, const_cast<Layer *>(this))); return sur; return mSurface; } status_t Layer::ditch() Loading @@ -131,6 +130,10 @@ status_t Layer::ditch() // the layer is not on screen anymore. free as much resources as possible mFreezeLock.clear(); EGLDisplay dpy(mFlinger->graphicPlane(0).getEGLDisplay()); mBufferManager.destroy(dpy); mSurface.clear(); Mutex::Autolock _l(mLock); mWidth = mHeight = 0; return NO_ERROR; Loading Loading @@ -175,6 +178,7 @@ status_t Layer::setBuffers( uint32_t w, uint32_t h, int layerRedsize = info.getSize(PixelFormatInfo::INDEX_RED); mNeedsDithering = layerRedsize > displayRedSize; mSurface = new SurfaceLayer(mFlinger, this); return NO_ERROR; } Loading
services/surfaceflinger/Layer.h +1 −0 Original line number Diff line number Diff line Loading @@ -211,6 +211,7 @@ private: ClientRef mUserClientRef; // constants sp<Surface> mSurface; PixelFormat mFormat; const GLExtensions& mGLExtensions; bool mNeedsBlending; Loading
services/surfaceflinger/LayerBase.cpp +6 −26 Original line number Diff line number Diff line Loading @@ -515,21 +515,13 @@ void LayerBase::dump(String8& result, char* buffer, size_t SIZE) const result.append(buffer); } void LayerBase::shortDump(String8& result, char* scratch, size_t size) const { LayerBase::dump(result, scratch, size); } // --------------------------------------------------------------------------- int32_t LayerBaseClient::sIdentity = 1; LayerBaseClient::LayerBaseClient(SurfaceFlinger* flinger, DisplayID display, const sp<Client>& client) : LayerBase(flinger, display), mHasSurface(false), mClientRef(client), : LayerBase(flinger, display), mClientRef(client), mIdentity(uint32_t(android_atomic_inc(&sIdentity))) { } Loading @@ -546,18 +538,12 @@ sp<LayerBaseClient::Surface> LayerBaseClient::getSurface() { sp<Surface> s; Mutex::Autolock _l(mLock); LOG_ALWAYS_FATAL_IF(mHasSurface, "LayerBaseClient::getSurface() has already been called"); mHasSurface = true; s = mClientSurface.promote(); if (s == 0) { s = createSurface(); mClientSurfaceBinder = s->asBinder(); return s; mClientSurface = s; } wp<IBinder> LayerBaseClient::getSurfaceBinder() const { return mClientSurfaceBinder; return s; } sp<LayerBaseClient::Surface> LayerBaseClient::createSurface() const Loading @@ -580,12 +566,6 @@ void LayerBaseClient::dump(String8& result, char* buffer, size_t SIZE) const result.append(buffer); } void LayerBaseClient::shortDump(String8& result, char* scratch, size_t size) const { LayerBaseClient::dump(result, scratch, size); } // --------------------------------------------------------------------------- LayerBaseClient::Surface::Surface( Loading
services/surfaceflinger/LayerBase.h +1 −5 Original line number Diff line number Diff line Loading @@ -206,7 +206,6 @@ public: /** always call base class first */ virtual void dump(String8& result, char* scratch, size_t size) const; virtual void shortDump(String8& result, char* scratch, size_t size) const; enum { // flags for doTransaction() Loading Loading @@ -285,7 +284,6 @@ public: virtual ~LayerBaseClient(); sp<Surface> getSurface(); wp<IBinder> getSurfaceBinder() const; virtual sp<Surface> createSurface() const; virtual sp<LayerBaseClient> getLayerBaseClient() const { return const_cast<LayerBaseClient*>(this); } Loading Loading @@ -327,12 +325,10 @@ public: protected: virtual void dump(String8& result, char* scratch, size_t size) const; virtual void shortDump(String8& result, char* scratch, size_t size) const; private: mutable Mutex mLock; mutable bool mHasSurface; wp<IBinder> mClientSurfaceBinder; mutable wp<Surface> mClientSurface; const wp<Client> mClientRef; // only read const uint32_t mIdentity; Loading