diff options
author | tedbo <tedbo@google.com> | 2011-06-23 14:45:30 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-06-23 14:45:30 -0700 |
commit | 901b41614f111c862c5d44f1c30e0af191b0bb6f (patch) | |
tree | 0a52a8c2c9998319d44e4f23cbd1e0aefcc67340 | |
parent | f43777a930992e5c8793c16b1a35a66513c47665 (diff) | |
parent | 1e7fa9e945d98eab76ff92f37c25040429a6c0a0 (diff) |
Merge "Add method to create a ParcelSurfaceTexture from android.view.Surface."
-rw-r--r-- | include/surfaceflinger/Surface.h | 2 | ||||
-rw-r--r-- | libs/gui/Surface.cpp | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/include/surfaceflinger/Surface.h b/include/surfaceflinger/Surface.h index 8845dc9e1c..dc2a845620 100644 --- a/include/surfaceflinger/Surface.h +++ b/include/surfaceflinger/Surface.h @@ -40,6 +40,7 @@ namespace android { class GraphicBuffer; class GraphicBufferMapper; class IOMX; +class ISurfaceTexture; class Rect; class Surface; class SurfaceComposerClient; @@ -154,6 +155,7 @@ public: bool isValid(); uint32_t getFlags() const { return mFlags; } uint32_t getIdentity() const { return mIdentity; } + sp<ISurfaceTexture> getSurfaceTexture(); // the lock/unlock APIs must be used from the same thread status_t lock(SurfaceInfo* info, bool blocking = true); diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp index 4d1d923a42..9185e1e993 100644 --- a/libs/gui/Surface.cpp +++ b/libs/gui/Surface.cpp @@ -421,6 +421,10 @@ status_t Surface::validate(bool inCancelBuffer) const return NO_ERROR; } +sp<ISurfaceTexture> Surface::getSurfaceTexture() { + return mSurface != NULL ? mSurface->getSurfaceTexture() : NULL; +} + sp<IBinder> Surface::asBinder() const { return mSurface!=0 ? mSurface->asBinder() : 0; } |