summaryrefslogtreecommitdiffstats
path: root/include/gui/SurfaceTexture.h
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-04-18 19:51:26 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-04-18 19:51:26 -0700
commit578492e999b3919cfc587024c5f86d6837c3aa7c (patch)
tree362cb7ad4c104098f8994e6aa03917b95281e1fe /include/gui/SurfaceTexture.h
parent4af51a14febf0c6caf844f4620c423c6dd46bfab (diff)
parent27cd07ca8006fd80d85379ada416874bfa78aa88 (diff)
downloadframeworks_base-578492e999b3919cfc587024c5f86d6837c3aa7c.zip
frameworks_base-578492e999b3919cfc587024c5f86d6837c3aa7c.tar.gz
frameworks_base-578492e999b3919cfc587024c5f86d6837c3aa7c.tar.bz2
Merge "changes to SurfaceTexture needed for unification with SF"
Diffstat (limited to 'include/gui/SurfaceTexture.h')
-rw-r--r--include/gui/SurfaceTexture.h25
1 files changed, 23 insertions, 2 deletions
diff --git a/include/gui/SurfaceTexture.h b/include/gui/SurfaceTexture.h
index 340daaf..96828c6 100644
--- a/include/gui/SurfaceTexture.h
+++ b/include/gui/SurfaceTexture.h
@@ -127,11 +127,28 @@ public:
// be called from the client.
status_t setDefaultBufferSize(uint32_t w, uint32_t h);
-private:
+ // getCurrentBuffer returns the buffer associated with the current image.
+ sp<GraphicBuffer> getCurrentBuffer() const;
+
+ // getCurrentTextureTarget returns the texture target of the current
+ // texture as returned by updateTexImage().
+ GLenum getCurrentTextureTarget() const;
+
+ // getCurrentCrop returns the cropping rectangle of the current buffer
+ Rect getCurrentCrop() const;
+
+ // getCurrentTransform returns the transform of the current buffer
+ uint32_t getCurrentTransform() const;
+
+protected:
// freeAllBuffers frees the resources (both GraphicBuffer and EGLImage) for
// all slots.
void freeAllBuffers();
+ static bool isExternalFormat(uint32_t format);
+ static GLenum getTextureTarget(uint32_t format);
+
+private:
// createImage creates a new EGLImage from a GraphicBuffer.
EGLImageKHR createImage(EGLDisplay dpy,
@@ -194,6 +211,10 @@ private:
// reset mCurrentTexture to INVALID_BUFFER_SLOT.
int mCurrentTexture;
+ // mCurrentTextureTarget is the GLES texture target to be used with the
+ // current texture.
+ GLenum mCurrentTextureTarget;
+
// mCurrentTextureBuf is the graphic buffer of the current texture. It's
// possible that this buffer is not associated with any buffer slot, so we
// must track it separately in order to properly use
@@ -256,7 +277,7 @@ private:
// mMutex is the mutex used to prevent concurrent access to the member
// variables of SurfaceTexture objects. It must be locked whenever the
// member variables are accessed.
- Mutex mMutex;
+ mutable Mutex mMutex;
};
// ----------------------------------------------------------------------------