Skip to content

Commit 5b315da

Browse files
author
Jamie Gennis
committed
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
1 parent 44a0522 commit 5b315da

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

services/surfaceflinger/Layer.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ void Layer::onRemoved()
112112
mSurfaceTexture->abandon();
113113
}
114114

115+
void Layer::setName(const String8& name) {
116+
LayerBase::setName(name);
117+
mSurfaceTexture->setName(name);
118+
}
119+
115120
sp<ISurface> Layer::createSurface()
116121
{
117122
class BSurface : public BnSurface, public LayerCleaner {

services/surfaceflinger/Layer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ class Layer : public LayerBaseClient
7474
virtual bool isProtected() const;
7575
virtual void onRemoved();
7676
virtual sp<Layer> getLayer() const { return const_cast<Layer*>(this); }
77+
virtual void setName(const String8& name);
7778

7879
// LayerBaseClient interface
7980
virtual wp<IBinder> getSurfaceTextureBinder() const;

services/surfaceflinger/LayerBase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class LayerBase : public RefBase
8181
Region transparentRegion;
8282
};
8383

84-
void setName(const String8& name);
84+
virtual void setName(const String8& name);
8585
String8 getName() const;
8686

8787
// modify current state

0 commit comments

Comments
 (0)