From 5b315da4e8a3746376af480c8fe01f98cbc34b33 Mon Sep 17 00:00:00 2001 From: Jamie Gennis Date: Fri, 16 Sep 2011 17:31:54 -0700 Subject: [PATCH] SurfaceFlinger: set layer names on SurfaceTextures This change sets the SurfaceTexture name string to match that of the layer to which it belongs. Change-Id: Ib302d79e916a36ab1e54cb9ff477c3b857bd957b --- services/surfaceflinger/Layer.cpp | 5 +++++ services/surfaceflinger/Layer.h | 1 + services/surfaceflinger/LayerBase.h | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index f85ce7fd09498..aa16d23dd8292 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -112,6 +112,11 @@ void Layer::onRemoved() mSurfaceTexture->abandon(); } +void Layer::setName(const String8& name) { + LayerBase::setName(name); + mSurfaceTexture->setName(name); +} + sp Layer::createSurface() { class BSurface : public BnSurface, public LayerCleaner { diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h index ff389aecef70e..82e35218d279d 100644 --- a/services/surfaceflinger/Layer.h +++ b/services/surfaceflinger/Layer.h @@ -74,6 +74,7 @@ public: virtual bool isProtected() const; virtual void onRemoved(); virtual sp getLayer() const { return const_cast(this); } + virtual void setName(const String8& name); // LayerBaseClient interface virtual wp getSurfaceTextureBinder() const; diff --git a/services/surfaceflinger/LayerBase.h b/services/surfaceflinger/LayerBase.h index a14b397a8d42b..36d953904e3fa 100644 --- a/services/surfaceflinger/LayerBase.h +++ b/services/surfaceflinger/LayerBase.h @@ -81,7 +81,7 @@ public: Region transparentRegion; }; - void setName(const String8& name); + virtual void setName(const String8& name); String8 getName() const; // modify current state