diff options
author | Mathias Agopian <mathias@google.com> | 2010-03-01 16:09:43 -0800 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2010-03-01 18:34:50 -0800 |
commit | 5d26c1e38dabb3ad8b4b6e1000375f3b1a6b7693 (patch) | |
tree | 6ba3c3a0a6a5de37d65c07690de84080a91db3b3 /libs/surfaceflinger | |
parent | 69f22feb8540576d2a2e9d32f9c86ebbbf309409 (diff) | |
download | frameworks_base-5d26c1e38dabb3ad8b4b6e1000375f3b1a6b7693.zip frameworks_base-5d26c1e38dabb3ad8b4b6e1000375f3b1a6b7693.tar.gz frameworks_base-5d26c1e38dabb3ad8b4b6e1000375f3b1a6b7693.tar.bz2 |
Added a name to Surface created by SurfaceFlinger
Updated the window manager to use this new facility.
Surfaces name are now printed by "dumpsys".
Diffstat (limited to 'libs/surfaceflinger')
-rw-r--r-- | libs/surfaceflinger/LayerBase.cpp | 8 | ||||
-rw-r--r-- | libs/surfaceflinger/LayerBase.h | 4 | ||||
-rw-r--r-- | libs/surfaceflinger/SurfaceFlinger.cpp | 13 | ||||
-rw-r--r-- | libs/surfaceflinger/SurfaceFlinger.h | 4 |
4 files changed, 23 insertions, 6 deletions
diff --git a/libs/surfaceflinger/LayerBase.cpp b/libs/surfaceflinger/LayerBase.cpp index a3d293f..b0109ca 100644 --- a/libs/surfaceflinger/LayerBase.cpp +++ b/libs/surfaceflinger/LayerBase.cpp @@ -728,6 +728,14 @@ LayerBaseClient::~LayerBaseClient() delete lcblk; } +void LayerBaseClient::setName(const String8& name) { + mName = name; +} + +String8 LayerBaseClient::getName() const { + return mName; +} + int32_t LayerBaseClient::serverIndex() const { sp<Client> client(this->client.promote()); diff --git a/libs/surfaceflinger/LayerBase.h b/libs/surfaceflinger/LayerBase.h index 6aacd82..7ac8bc5 100644 --- a/libs/surfaceflinger/LayerBase.h +++ b/libs/surfaceflinger/LayerBase.h @@ -320,6 +320,8 @@ public: const sp<Client>& client, int32_t i); virtual ~LayerBaseClient(); virtual void onFirstRef(); + void setName(const String8& name); + String8 getName() const; const wp<Client> client; @@ -333,6 +335,7 @@ public: virtual void onRemoved(); + class Surface : public BnSurface { public: @@ -371,6 +374,7 @@ private: mutable Mutex mLock; mutable wp<Surface> mClientSurface; // only read + String8 mName; const uint32_t mIdentity; static int32_t sIdentity; }; diff --git a/libs/surfaceflinger/SurfaceFlinger.cpp b/libs/surfaceflinger/SurfaceFlinger.cpp index 4555b3c..66ac4d2 100644 --- a/libs/surfaceflinger/SurfaceFlinger.cpp +++ b/libs/surfaceflinger/SurfaceFlinger.cpp @@ -1186,7 +1186,7 @@ int SurfaceFlinger::setOrientation(DisplayID dpy, } sp<ISurface> SurfaceFlinger::createSurface(ClientID clientId, int pid, - ISurfaceFlingerClient::surface_data_t* params, + const String8& name, ISurfaceFlingerClient::surface_data_t* params, DisplayID d, uint32_t w, uint32_t h, PixelFormat format, uint32_t flags) { @@ -1232,6 +1232,7 @@ sp<ISurface> SurfaceFlinger::createSurface(ClientID clientId, int pid, } if (layer != 0) { + layer->setName(name); setTransactionFlags(eTransactionNeeded); surfaceHandle = layer->getSurface(); if (surfaceHandle != 0) { @@ -1506,8 +1507,10 @@ status_t SurfaceFlinger::dump(int fd, const Vector<String16>& args) if (lbc != 0) { sp<Client> client(lbc->client.promote()); snprintf(buffer, SIZE, - " " - "id=0x%08x, client=0x%08x, identity=%u\n", + " name=%s\n", lbc->getName().string()); + result.append(buffer); + snprintf(buffer, SIZE, + " id=0x%08x, client=0x%08x, identity=%u\n", lbc->clientIndex(), client.get() ? client->cid : 0, lbc->getIdentity()); @@ -1760,10 +1763,12 @@ sp<IMemoryHeap> BClient::getControlBlock() const { sp<ISurface> BClient::createSurface( ISurfaceFlingerClient::surface_data_t* params, int pid, + const String8& name, DisplayID display, uint32_t w, uint32_t h, PixelFormat format, uint32_t flags) { - return mFlinger->createSurface(mId, pid, params, display, w, h, format, flags); + return mFlinger->createSurface(mId, pid, name, params, display, w, h, + format, flags); } status_t BClient::destroySurface(SurfaceID sid) diff --git a/libs/surfaceflinger/SurfaceFlinger.h b/libs/surfaceflinger/SurfaceFlinger.h index 4520c0e..d75dc15 100644 --- a/libs/surfaceflinger/SurfaceFlinger.h +++ b/libs/surfaceflinger/SurfaceFlinger.h @@ -189,7 +189,7 @@ private: friend class LayerBlur; friend class LayerDim; - sp<ISurface> createSurface(ClientID client, int pid, + sp<ISurface> createSurface(ClientID client, int pid, const String8& name, ISurfaceFlingerClient::surface_data_t* params, DisplayID display, uint32_t w, uint32_t h, PixelFormat format, uint32_t flags); @@ -401,7 +401,7 @@ public: virtual sp<IMemoryHeap> getControlBlock() const; virtual sp<ISurface> createSurface( - surface_data_t* params, int pid, + surface_data_t* params, int pid, const String8& name, DisplayID display, uint32_t w, uint32_t h,PixelFormat format, uint32_t flags); |