Skip to content

Commit 44a0522

Browse files
author
Jamie Gennis
committed
SurfaceTexture: add name support
This change adds support for setting a string that can be used to identify a SurfaceTexture object in log messages. Change-Id: Ib4ee085f36c8830dc964c05ef1654f5a55dfcd60
1 parent 5840639 commit 44a0522

File tree

2 files changed

+95
-61
lines changed

2 files changed

+95
-61
lines changed

include/gui/SurfaceTexture.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@
2525

2626
#include <ui/GraphicBuffer.h>
2727

28-
#include <utils/threads.h>
28+
#include <utils/String8.h>
2929
#include <utils/Vector.h>
30+
#include <utils/threads.h>
3031

3132
#define ANDROID_GRAPHICS_SURFACETEXTURE_JNI_ID "mSurfaceTexture"
3233

@@ -202,6 +203,10 @@ class SurfaceTexture : public BnSurfaceTexture {
202203
// by OpenGL ES as a texture) then those buffer will remain allocated.
203204
void abandon();
204205

206+
// set the name of the SurfaceTexture that will be used to identify it in
207+
// log messages.
208+
void setName(const String8& name);
209+
205210
// dump our state in a String
206211
void dump(String8& result) const;
207212
void dump(String8& result, const char* prefix, char* buffer, size_t SIZE) const;
@@ -444,6 +449,10 @@ class SurfaceTexture : public BnSurfaceTexture {
444449
// all ISurfaceTexture methods capable of returning an error.
445450
bool mAbandoned;
446451

452+
// mName is a string used to identify the SurfaceTexture in log messages.
453+
// It is set by the setName method.
454+
String8 mName;
455+
447456
// mMutex is the mutex used to prevent concurrent access to the member
448457
// variables of SurfaceTexture objects. It must be locked whenever the
449458
// member variables are accessed.

0 commit comments

Comments
 (0)