Loading libs/surfaceflinger/Android.mk +0 −1 Original line number Original line Diff line number Diff line Loading @@ -14,7 +14,6 @@ LOCAL_SRC_FILES:= \ MessageQueue.cpp \ MessageQueue.cpp \ SurfaceFlinger.cpp \ SurfaceFlinger.cpp \ TextureManager.cpp \ TextureManager.cpp \ Tokenizer.cpp \ Transform.cpp Transform.cpp LOCAL_CFLAGS:= -DLOG_TAG=\"SurfaceFlinger\" LOCAL_CFLAGS:= -DLOG_TAG=\"SurfaceFlinger\" Loading libs/surfaceflinger/Layer.cpp +45 −20 Original line number Original line Diff line number Diff line Loading @@ -47,9 +47,9 @@ template <typename T> inline T min(T a, T b) { // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- Layer::Layer(SurfaceFlinger* flinger, DisplayID display, Layer::Layer(SurfaceFlinger* flinger, const sp<Client>& client, int32_t i) DisplayID display, const sp<Client>& client) : LayerBaseClient(flinger, display, client, i), : LayerBaseClient(flinger, display, client), lcblk(NULL), lcblk(NULL), mSecure(false), mSecure(false), mNeedsBlending(true), mNeedsBlending(true), Loading @@ -58,13 +58,6 @@ Layer::Layer(SurfaceFlinger* flinger, DisplayID display, mBufferManager(mTextureManager), mBufferManager(mTextureManager), mWidth(0), mHeight(0), mFixedSize(false) mWidth(0), mHeight(0), mFixedSize(false) { { // no OpenGL operation is possible here, since we might not be // in the OpenGL thread. lcblk = new SharedBufferServer( client->ctrlblk, i, mBufferManager.getDefaultBufferCount(), getIdentity()); mBufferManager.setActiveBufferIndex( lcblk->getFrontBuffer() ); } } Layer::~Layer() Layer::~Layer() Loading @@ -77,13 +70,32 @@ Layer::~Layer() delete lcblk; delete lcblk; } } // TODO: get rid of this void Layer::setToken(int32_t token) { sp<Client> ourClient(client.promote()); mToken = token; // no OpenGL operation is possible here, since we might not be // in the OpenGL thread. lcblk = new SharedBufferServer( ourClient->ctrlblk, token, mBufferManager.getDefaultBufferCount(), getIdentity()); mBufferManager.setActiveBufferIndex( lcblk->getFrontBuffer() ); } // called with SurfaceFlinger::mStateLock as soon as the layer is entered // called with SurfaceFlinger::mStateLock as soon as the layer is entered // in the purgatory list // in the purgatory list void Layer::onRemoved() void Layer::onRemoved() { { sp<Client> ourClient(client.promote()); if (ourClient != 0) { // wake up the condition // wake up the condition lcblk->setStatus(NO_INIT); lcblk->setStatus(NO_INIT); } } } sp<LayerBaseClient::Surface> Layer::createSurface() const sp<LayerBaseClient::Surface> Layer::createSurface() const { { Loading Loading @@ -140,7 +152,7 @@ status_t Layer::setBuffers( uint32_t w, uint32_t h, int layerRedsize = info.getSize(PixelFormatInfo::INDEX_RED); int layerRedsize = info.getSize(PixelFormatInfo::INDEX_RED); mNeedsDithering = layerRedsize > displayRedSize; mNeedsDithering = layerRedsize > displayRedSize; mSurface = new SurfaceLayer(mFlinger, clientIndex(), this); mSurface = new SurfaceLayer(mFlinger, this); return NO_ERROR; return NO_ERROR; } } Loading Loading @@ -391,8 +403,11 @@ uint32_t Layer::doTransaction(uint32_t flags) // a buffer, it'll get the new size. // a buffer, it'll get the new size. setBufferSize(temp.requested_w, temp.requested_h); setBufferSize(temp.requested_w, temp.requested_h); sp<Client> ourClient(client.promote()); if (ourClient != 0) { // all buffers need reallocation // all buffers need reallocation lcblk->reallocateAll(); lcblk->reallocateAll(); } } else { } else { // record the new size // record the new size setBufferSize(temp.requested_w, temp.requested_h); setBufferSize(temp.requested_w, temp.requested_h); Loading Loading @@ -427,6 +442,13 @@ bool Layer::isFixedSize() const { void Layer::lockPageFlip(bool& recomputeVisibleRegions) void Layer::lockPageFlip(bool& recomputeVisibleRegions) { { sp<Client> ourClient(client.promote()); if (ourClient == 0) { // client died recomputeVisibleRegions = true; return; } ssize_t buf = lcblk->retireAndLock(); ssize_t buf = lcblk->retireAndLock(); if (buf == NOT_ENOUGH_DATA) { if (buf == NOT_ENOUGH_DATA) { // NOTE: This is not an error, it simply means there is nothing to // NOTE: This is not an error, it simply means there is nothing to Loading Loading @@ -538,10 +560,13 @@ void Layer::unlockPageFlip( void Layer::finishPageFlip() void Layer::finishPageFlip() { { sp<Client> ourClient(client.promote()); if (ourClient != 0) { int buf = mBufferManager.getActiveBufferIndex(); int buf = mBufferManager.getActiveBufferIndex(); status_t err = lcblk->unlock( buf ); status_t err = lcblk->unlock( buf ); LOGE_IF(err!=NO_ERROR, "layer %p, buffer=%d wasn't locked!", this, buf); LOGE_IF(err!=NO_ERROR, "layer %p, buffer=%d wasn't locked!", this, buf); } } } void Layer::dump(String8& result, char* buffer, size_t SIZE) const void Layer::dump(String8& result, char* buffer, size_t SIZE) const Loading Loading @@ -707,8 +732,8 @@ status_t Layer::BufferManager::destroyTexture(Image* tex, EGLDisplay dpy) // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- Layer::SurfaceLayer::SurfaceLayer(const sp<SurfaceFlinger>& flinger, Layer::SurfaceLayer::SurfaceLayer(const sp<SurfaceFlinger>& flinger, SurfaceID id, const sp<Layer>& owner) const sp<Layer>& owner) : Surface(flinger, id, owner->getIdentity(), owner) : Surface(flinger, owner->getIdentity(), owner) { { } } Loading libs/surfaceflinger/Layer.h +8 −3 Original line number Original line Diff line number Diff line Loading @@ -50,7 +50,7 @@ public: SharedBufferServer* lcblk; SharedBufferServer* lcblk; Layer(SurfaceFlinger* flinger, DisplayID display, Layer(SurfaceFlinger* flinger, DisplayID display, const sp<Client>& client, int32_t i); const sp<Client>& client); virtual ~Layer(); virtual ~Layer(); Loading Loading @@ -96,8 +96,7 @@ private: class SurfaceLayer : public LayerBaseClient::Surface { class SurfaceLayer : public LayerBaseClient::Surface { public: public: SurfaceLayer(const sp<SurfaceFlinger>& flinger, SurfaceLayer(const sp<SurfaceFlinger>& flinger, const sp<Layer>& owner); SurfaceID id, const sp<Layer>& owner); ~SurfaceLayer(); ~SurfaceLayer(); private: private: virtual sp<GraphicBuffer> requestBuffer(int bufferIdx, virtual sp<GraphicBuffer> requestBuffer(int bufferIdx, Loading Loading @@ -189,6 +188,12 @@ private: uint32_t mReqHeight; uint32_t mReqHeight; uint32_t mReqFormat; uint32_t mReqFormat; bool mFixedSize; bool mFixedSize; // TODO: get rid of this private: virtual void setToken(int32_t token); virtual int32_t getToken() const { return mToken; } int32_t mToken; }; }; // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- Loading libs/surfaceflinger/LayerBase.cpp +10 −28 Original line number Original line Diff line number Diff line Loading @@ -488,35 +488,18 @@ void LayerBase::dump(String8& result, char* buffer, size_t SIZE) const int32_t LayerBaseClient::sIdentity = 1; int32_t LayerBaseClient::sIdentity = 1; LayerBaseClient::LayerBaseClient(SurfaceFlinger* flinger, DisplayID display, LayerBaseClient::LayerBaseClient(SurfaceFlinger* flinger, DisplayID display, const sp<Client>& client, int32_t i) const sp<Client>& client) : LayerBase(flinger, display), client(client), mIndex(i), : LayerBase(flinger, display), client(client), mIdentity(uint32_t(android_atomic_inc(&sIdentity))) mIdentity(uint32_t(android_atomic_inc(&sIdentity))) { { } } void LayerBaseClient::onFirstRef() { sp<Client> client(this->client.promote()); if (client != 0) { client->bindLayer(this, mIndex); } } LayerBaseClient::~LayerBaseClient() LayerBaseClient::~LayerBaseClient() { { sp<Client> client(this->client.promote()); sp<Client> c(client.promote()); if (client != 0) { if (c != 0) { client->free(mIndex); c->free(this); } } ssize_t LayerBaseClient::serverIndex() const { sp<Client> client(this->client.promote()); if (client != 0) { return (client->cid<<16)|mIndex; } } return ssize_t(0xFFFF0000 | mIndex); } } sp<LayerBaseClient::Surface> LayerBaseClient::getSurface() sp<LayerBaseClient::Surface> LayerBaseClient::getSurface() Loading @@ -533,7 +516,7 @@ sp<LayerBaseClient::Surface> LayerBaseClient::getSurface() sp<LayerBaseClient::Surface> LayerBaseClient::createSurface() const sp<LayerBaseClient::Surface> LayerBaseClient::createSurface() const { { return new Surface(mFlinger, clientIndex(), mIdentity, return new Surface(mFlinger, mIdentity, const_cast<LayerBaseClient *>(this)); const_cast<LayerBaseClient *>(this)); } } Loading @@ -544,10 +527,9 @@ void LayerBaseClient::dump(String8& result, char* buffer, size_t SIZE) const sp<Client> client(this->client.promote()); sp<Client> client(this->client.promote()); snprintf(buffer, SIZE, snprintf(buffer, SIZE, " name=%s\n" " name=%s\n" " id=0x%08x, client=0x%08x, identity=%u\n", " client=%p, identity=%u\n", getName().string(), getName().string(), clientIndex(), client.get() ? client->cid : 0, client.get(), getIdentity()); getIdentity()); result.append(buffer); result.append(buffer); } } Loading @@ -556,9 +538,9 @@ void LayerBaseClient::dump(String8& result, char* buffer, size_t SIZE) const LayerBaseClient::Surface::Surface( LayerBaseClient::Surface::Surface( const sp<SurfaceFlinger>& flinger, const sp<SurfaceFlinger>& flinger, SurfaceID id, int identity, int identity, const sp<LayerBaseClient>& owner) const sp<LayerBaseClient>& owner) : mFlinger(flinger), mToken(id), mIdentity(identity), mOwner(owner) : mFlinger(flinger), mIdentity(identity), mOwner(owner) { { } } Loading libs/surfaceflinger/LayerBase.h +17 −21 Original line number Original line Diff line number Diff line Loading @@ -101,7 +101,6 @@ public: void invalidate(); void invalidate(); virtual const char* getTypeId() const { return "LayerBase"; } virtual const char* getTypeId() const { return "LayerBase"; } virtual ssize_t serverIndex() const { return -1; } /** /** * draw - performs some global clipping optimizations * draw - performs some global clipping optimizations Loading Loading @@ -269,30 +268,24 @@ class LayerBaseClient : public LayerBase public: public: class Surface; class Surface; LayerBaseClient(SurfaceFlinger* flinger, DisplayID display, const sp<Client>& client, int32_t i); virtual ~LayerBaseClient(); virtual void onFirstRef(); const wp<Client> client; const wp<Client> client; inline uint32_t getIdentity() const { return mIdentity; } LayerBaseClient(SurfaceFlinger* flinger, DisplayID display, inline int32_t clientIndex() const { return mIndex; } const sp<Client>& client); virtual ~LayerBaseClient(); sp<Surface> getSurface(); sp<Surface> getSurface(); virtual sp<Surface> createSurface() const; virtual sp<Surface> createSurface() const; virtual ssize_t serverIndex() const; virtual const char* getTypeId() const { return "LayerBaseClient"; } virtual const char* getTypeId() const { return "LayerBaseClient"; } class Surface : public BnSurface uint32_t getIdentity() const { return mIdentity; } { class Surface : public BnSurface { public: public: int32_t getToken() const { return mToken; } int32_t getIdentity() const { return mIdentity; } int32_t getIdentity() const { return mIdentity; } protected: protected: Surface(const sp<SurfaceFlinger>& flinger, Surface(const sp<SurfaceFlinger>& flinger, int identity, SurfaceID id, int identity, const sp<LayerBaseClient>& owner); const sp<LayerBaseClient>& owner); virtual ~Surface(); virtual ~Surface(); virtual status_t onTransact(uint32_t code, const Parcel& data, virtual status_t onTransact(uint32_t code, const Parcel& data, Loading @@ -313,7 +306,6 @@ public: protected: protected: friend class LayerBaseClient; friend class LayerBaseClient; sp<SurfaceFlinger> mFlinger; sp<SurfaceFlinger> mFlinger; int32_t mToken; int32_t mIdentity; int32_t mIdentity; wp<LayerBaseClient> mOwner; wp<LayerBaseClient> mOwner; }; }; Loading @@ -324,12 +316,16 @@ protected: virtual void dump(String8& result, char* scratch, size_t size) const; virtual void dump(String8& result, char* scratch, size_t size) const; private: private: int32_t mIndex; mutable Mutex mLock; mutable Mutex mLock; mutable wp<Surface> mClientSurface; mutable wp<Surface> mClientSurface; // only read // only read const uint32_t mIdentity; const uint32_t mIdentity; static int32_t sIdentity; static int32_t sIdentity; // TODO: get rid of this public: virtual void setToken(int32_t token) { } virtual int32_t getToken() const { return -1; } }; }; // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- Loading Loading
libs/surfaceflinger/Android.mk +0 −1 Original line number Original line Diff line number Diff line Loading @@ -14,7 +14,6 @@ LOCAL_SRC_FILES:= \ MessageQueue.cpp \ MessageQueue.cpp \ SurfaceFlinger.cpp \ SurfaceFlinger.cpp \ TextureManager.cpp \ TextureManager.cpp \ Tokenizer.cpp \ Transform.cpp Transform.cpp LOCAL_CFLAGS:= -DLOG_TAG=\"SurfaceFlinger\" LOCAL_CFLAGS:= -DLOG_TAG=\"SurfaceFlinger\" Loading
libs/surfaceflinger/Layer.cpp +45 −20 Original line number Original line Diff line number Diff line Loading @@ -47,9 +47,9 @@ template <typename T> inline T min(T a, T b) { // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- Layer::Layer(SurfaceFlinger* flinger, DisplayID display, Layer::Layer(SurfaceFlinger* flinger, const sp<Client>& client, int32_t i) DisplayID display, const sp<Client>& client) : LayerBaseClient(flinger, display, client, i), : LayerBaseClient(flinger, display, client), lcblk(NULL), lcblk(NULL), mSecure(false), mSecure(false), mNeedsBlending(true), mNeedsBlending(true), Loading @@ -58,13 +58,6 @@ Layer::Layer(SurfaceFlinger* flinger, DisplayID display, mBufferManager(mTextureManager), mBufferManager(mTextureManager), mWidth(0), mHeight(0), mFixedSize(false) mWidth(0), mHeight(0), mFixedSize(false) { { // no OpenGL operation is possible here, since we might not be // in the OpenGL thread. lcblk = new SharedBufferServer( client->ctrlblk, i, mBufferManager.getDefaultBufferCount(), getIdentity()); mBufferManager.setActiveBufferIndex( lcblk->getFrontBuffer() ); } } Layer::~Layer() Layer::~Layer() Loading @@ -77,13 +70,32 @@ Layer::~Layer() delete lcblk; delete lcblk; } } // TODO: get rid of this void Layer::setToken(int32_t token) { sp<Client> ourClient(client.promote()); mToken = token; // no OpenGL operation is possible here, since we might not be // in the OpenGL thread. lcblk = new SharedBufferServer( ourClient->ctrlblk, token, mBufferManager.getDefaultBufferCount(), getIdentity()); mBufferManager.setActiveBufferIndex( lcblk->getFrontBuffer() ); } // called with SurfaceFlinger::mStateLock as soon as the layer is entered // called with SurfaceFlinger::mStateLock as soon as the layer is entered // in the purgatory list // in the purgatory list void Layer::onRemoved() void Layer::onRemoved() { { sp<Client> ourClient(client.promote()); if (ourClient != 0) { // wake up the condition // wake up the condition lcblk->setStatus(NO_INIT); lcblk->setStatus(NO_INIT); } } } sp<LayerBaseClient::Surface> Layer::createSurface() const sp<LayerBaseClient::Surface> Layer::createSurface() const { { Loading Loading @@ -140,7 +152,7 @@ status_t Layer::setBuffers( uint32_t w, uint32_t h, int layerRedsize = info.getSize(PixelFormatInfo::INDEX_RED); int layerRedsize = info.getSize(PixelFormatInfo::INDEX_RED); mNeedsDithering = layerRedsize > displayRedSize; mNeedsDithering = layerRedsize > displayRedSize; mSurface = new SurfaceLayer(mFlinger, clientIndex(), this); mSurface = new SurfaceLayer(mFlinger, this); return NO_ERROR; return NO_ERROR; } } Loading Loading @@ -391,8 +403,11 @@ uint32_t Layer::doTransaction(uint32_t flags) // a buffer, it'll get the new size. // a buffer, it'll get the new size. setBufferSize(temp.requested_w, temp.requested_h); setBufferSize(temp.requested_w, temp.requested_h); sp<Client> ourClient(client.promote()); if (ourClient != 0) { // all buffers need reallocation // all buffers need reallocation lcblk->reallocateAll(); lcblk->reallocateAll(); } } else { } else { // record the new size // record the new size setBufferSize(temp.requested_w, temp.requested_h); setBufferSize(temp.requested_w, temp.requested_h); Loading Loading @@ -427,6 +442,13 @@ bool Layer::isFixedSize() const { void Layer::lockPageFlip(bool& recomputeVisibleRegions) void Layer::lockPageFlip(bool& recomputeVisibleRegions) { { sp<Client> ourClient(client.promote()); if (ourClient == 0) { // client died recomputeVisibleRegions = true; return; } ssize_t buf = lcblk->retireAndLock(); ssize_t buf = lcblk->retireAndLock(); if (buf == NOT_ENOUGH_DATA) { if (buf == NOT_ENOUGH_DATA) { // NOTE: This is not an error, it simply means there is nothing to // NOTE: This is not an error, it simply means there is nothing to Loading Loading @@ -538,10 +560,13 @@ void Layer::unlockPageFlip( void Layer::finishPageFlip() void Layer::finishPageFlip() { { sp<Client> ourClient(client.promote()); if (ourClient != 0) { int buf = mBufferManager.getActiveBufferIndex(); int buf = mBufferManager.getActiveBufferIndex(); status_t err = lcblk->unlock( buf ); status_t err = lcblk->unlock( buf ); LOGE_IF(err!=NO_ERROR, "layer %p, buffer=%d wasn't locked!", this, buf); LOGE_IF(err!=NO_ERROR, "layer %p, buffer=%d wasn't locked!", this, buf); } } } void Layer::dump(String8& result, char* buffer, size_t SIZE) const void Layer::dump(String8& result, char* buffer, size_t SIZE) const Loading Loading @@ -707,8 +732,8 @@ status_t Layer::BufferManager::destroyTexture(Image* tex, EGLDisplay dpy) // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- Layer::SurfaceLayer::SurfaceLayer(const sp<SurfaceFlinger>& flinger, Layer::SurfaceLayer::SurfaceLayer(const sp<SurfaceFlinger>& flinger, SurfaceID id, const sp<Layer>& owner) const sp<Layer>& owner) : Surface(flinger, id, owner->getIdentity(), owner) : Surface(flinger, owner->getIdentity(), owner) { { } } Loading
libs/surfaceflinger/Layer.h +8 −3 Original line number Original line Diff line number Diff line Loading @@ -50,7 +50,7 @@ public: SharedBufferServer* lcblk; SharedBufferServer* lcblk; Layer(SurfaceFlinger* flinger, DisplayID display, Layer(SurfaceFlinger* flinger, DisplayID display, const sp<Client>& client, int32_t i); const sp<Client>& client); virtual ~Layer(); virtual ~Layer(); Loading Loading @@ -96,8 +96,7 @@ private: class SurfaceLayer : public LayerBaseClient::Surface { class SurfaceLayer : public LayerBaseClient::Surface { public: public: SurfaceLayer(const sp<SurfaceFlinger>& flinger, SurfaceLayer(const sp<SurfaceFlinger>& flinger, const sp<Layer>& owner); SurfaceID id, const sp<Layer>& owner); ~SurfaceLayer(); ~SurfaceLayer(); private: private: virtual sp<GraphicBuffer> requestBuffer(int bufferIdx, virtual sp<GraphicBuffer> requestBuffer(int bufferIdx, Loading Loading @@ -189,6 +188,12 @@ private: uint32_t mReqHeight; uint32_t mReqHeight; uint32_t mReqFormat; uint32_t mReqFormat; bool mFixedSize; bool mFixedSize; // TODO: get rid of this private: virtual void setToken(int32_t token); virtual int32_t getToken() const { return mToken; } int32_t mToken; }; }; // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- Loading
libs/surfaceflinger/LayerBase.cpp +10 −28 Original line number Original line Diff line number Diff line Loading @@ -488,35 +488,18 @@ void LayerBase::dump(String8& result, char* buffer, size_t SIZE) const int32_t LayerBaseClient::sIdentity = 1; int32_t LayerBaseClient::sIdentity = 1; LayerBaseClient::LayerBaseClient(SurfaceFlinger* flinger, DisplayID display, LayerBaseClient::LayerBaseClient(SurfaceFlinger* flinger, DisplayID display, const sp<Client>& client, int32_t i) const sp<Client>& client) : LayerBase(flinger, display), client(client), mIndex(i), : LayerBase(flinger, display), client(client), mIdentity(uint32_t(android_atomic_inc(&sIdentity))) mIdentity(uint32_t(android_atomic_inc(&sIdentity))) { { } } void LayerBaseClient::onFirstRef() { sp<Client> client(this->client.promote()); if (client != 0) { client->bindLayer(this, mIndex); } } LayerBaseClient::~LayerBaseClient() LayerBaseClient::~LayerBaseClient() { { sp<Client> client(this->client.promote()); sp<Client> c(client.promote()); if (client != 0) { if (c != 0) { client->free(mIndex); c->free(this); } } ssize_t LayerBaseClient::serverIndex() const { sp<Client> client(this->client.promote()); if (client != 0) { return (client->cid<<16)|mIndex; } } return ssize_t(0xFFFF0000 | mIndex); } } sp<LayerBaseClient::Surface> LayerBaseClient::getSurface() sp<LayerBaseClient::Surface> LayerBaseClient::getSurface() Loading @@ -533,7 +516,7 @@ sp<LayerBaseClient::Surface> LayerBaseClient::getSurface() sp<LayerBaseClient::Surface> LayerBaseClient::createSurface() const sp<LayerBaseClient::Surface> LayerBaseClient::createSurface() const { { return new Surface(mFlinger, clientIndex(), mIdentity, return new Surface(mFlinger, mIdentity, const_cast<LayerBaseClient *>(this)); const_cast<LayerBaseClient *>(this)); } } Loading @@ -544,10 +527,9 @@ void LayerBaseClient::dump(String8& result, char* buffer, size_t SIZE) const sp<Client> client(this->client.promote()); sp<Client> client(this->client.promote()); snprintf(buffer, SIZE, snprintf(buffer, SIZE, " name=%s\n" " name=%s\n" " id=0x%08x, client=0x%08x, identity=%u\n", " client=%p, identity=%u\n", getName().string(), getName().string(), clientIndex(), client.get() ? client->cid : 0, client.get(), getIdentity()); getIdentity()); result.append(buffer); result.append(buffer); } } Loading @@ -556,9 +538,9 @@ void LayerBaseClient::dump(String8& result, char* buffer, size_t SIZE) const LayerBaseClient::Surface::Surface( LayerBaseClient::Surface::Surface( const sp<SurfaceFlinger>& flinger, const sp<SurfaceFlinger>& flinger, SurfaceID id, int identity, int identity, const sp<LayerBaseClient>& owner) const sp<LayerBaseClient>& owner) : mFlinger(flinger), mToken(id), mIdentity(identity), mOwner(owner) : mFlinger(flinger), mIdentity(identity), mOwner(owner) { { } } Loading
libs/surfaceflinger/LayerBase.h +17 −21 Original line number Original line Diff line number Diff line Loading @@ -101,7 +101,6 @@ public: void invalidate(); void invalidate(); virtual const char* getTypeId() const { return "LayerBase"; } virtual const char* getTypeId() const { return "LayerBase"; } virtual ssize_t serverIndex() const { return -1; } /** /** * draw - performs some global clipping optimizations * draw - performs some global clipping optimizations Loading Loading @@ -269,30 +268,24 @@ class LayerBaseClient : public LayerBase public: public: class Surface; class Surface; LayerBaseClient(SurfaceFlinger* flinger, DisplayID display, const sp<Client>& client, int32_t i); virtual ~LayerBaseClient(); virtual void onFirstRef(); const wp<Client> client; const wp<Client> client; inline uint32_t getIdentity() const { return mIdentity; } LayerBaseClient(SurfaceFlinger* flinger, DisplayID display, inline int32_t clientIndex() const { return mIndex; } const sp<Client>& client); virtual ~LayerBaseClient(); sp<Surface> getSurface(); sp<Surface> getSurface(); virtual sp<Surface> createSurface() const; virtual sp<Surface> createSurface() const; virtual ssize_t serverIndex() const; virtual const char* getTypeId() const { return "LayerBaseClient"; } virtual const char* getTypeId() const { return "LayerBaseClient"; } class Surface : public BnSurface uint32_t getIdentity() const { return mIdentity; } { class Surface : public BnSurface { public: public: int32_t getToken() const { return mToken; } int32_t getIdentity() const { return mIdentity; } int32_t getIdentity() const { return mIdentity; } protected: protected: Surface(const sp<SurfaceFlinger>& flinger, Surface(const sp<SurfaceFlinger>& flinger, int identity, SurfaceID id, int identity, const sp<LayerBaseClient>& owner); const sp<LayerBaseClient>& owner); virtual ~Surface(); virtual ~Surface(); virtual status_t onTransact(uint32_t code, const Parcel& data, virtual status_t onTransact(uint32_t code, const Parcel& data, Loading @@ -313,7 +306,6 @@ public: protected: protected: friend class LayerBaseClient; friend class LayerBaseClient; sp<SurfaceFlinger> mFlinger; sp<SurfaceFlinger> mFlinger; int32_t mToken; int32_t mIdentity; int32_t mIdentity; wp<LayerBaseClient> mOwner; wp<LayerBaseClient> mOwner; }; }; Loading @@ -324,12 +316,16 @@ protected: virtual void dump(String8& result, char* scratch, size_t size) const; virtual void dump(String8& result, char* scratch, size_t size) const; private: private: int32_t mIndex; mutable Mutex mLock; mutable Mutex mLock; mutable wp<Surface> mClientSurface; mutable wp<Surface> mClientSurface; // only read // only read const uint32_t mIdentity; const uint32_t mIdentity; static int32_t sIdentity; static int32_t sIdentity; // TODO: get rid of this public: virtual void setToken(int32_t token) { } virtual int32_t getToken() const { return -1; } }; }; // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- Loading