summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger/SurfaceFlinger.h
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-10-13 16:02:48 -0700
committerMathias Agopian <mathias@google.com>2011-10-14 14:32:48 -0700
commitf171ab6da9cf9793093e50947aacdab8f2b0c9b2 (patch)
tree35cf7565261f9b2bf0019e7d67439ae4188b7e2b /services/surfaceflinger/SurfaceFlinger.h
parent5850db5e08feeae87a8c0ef264ef86b5e43f4cfc (diff)
downloadframeworks_native-f171ab6da9cf9793093e50947aacdab8f2b0c9b2.zip
frameworks_native-f171ab6da9cf9793093e50947aacdab8f2b0c9b2.tar.gz
frameworks_native-f171ab6da9cf9793093e50947aacdab8f2b0c9b2.tar.bz2
Add a LayerScreenshot
A LayerScreenshot is a special type of layer that contains a screenshot of the screen acquired when its created. It works just like LayerDim. Bug: 5446982 Change-Id: I7814aff2380e7e146937f2b641907be2a30c76cc
Diffstat (limited to 'services/surfaceflinger/SurfaceFlinger.h')
-rw-r--r--services/surfaceflinger/SurfaceFlinger.h33
1 files changed, 26 insertions, 7 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index 0e642c1..3c8f4e5 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -49,6 +49,7 @@ class DisplayHardware;
class FreezeLock;
class Layer;
class LayerDim;
+class LayerScreenshot;
struct surface_flinger_cblk_t;
#define LIKELY( exp ) (__builtin_expect( (exp) != 0, true ))
@@ -186,6 +187,15 @@ public:
void screenReleased(DisplayID dpy);
void screenAcquired(DisplayID dpy);
+ status_t renderScreenToTexture(DisplayID dpy,
+ GLuint* textureName, GLfloat* uOut, GLfloat* vOut);
+
+ status_t postMessageAsync(const sp<MessageBase>& msg,
+ nsecs_t reltime=0, uint32_t flags = 0);
+
+ status_t postMessageSync(const sp<MessageBase>& msg,
+ nsecs_t reltime=0, uint32_t flags = 0);
+
status_t removeLayer(const sp<LayerBase>& layer);
status_t addLayer(const sp<LayerBase>& layer);
status_t invalidateLayerVisibility(const sp<LayerBase>& layer);
@@ -195,6 +205,18 @@ public:
GLuint getProtectedTexName() const { return mProtectedTexName; }
+
+ class MessageDestroyGLTexture : public MessageBase {
+ GLuint texture;
+ public:
+ MessageDestroyGLTexture(GLuint texture) : texture(texture) { }
+ virtual bool handler() {
+ glDeleteTextures(1, &texture);
+ return true;
+ }
+ };
+
+
private:
// DeathRecipient interface
virtual void binderDied(const wp<IBinder>& who);
@@ -204,7 +226,6 @@ private:
friend class LayerBase;
friend class LayerBaseClient;
friend class Layer;
- friend class LayerDim;
sp<ISurface> createSurface(
ISurfaceComposerClient::surface_data_t* params,
@@ -222,6 +243,10 @@ private:
const sp<Client>& client, DisplayID display,
uint32_t w, uint32_t h, uint32_t flags);
+ sp<LayerScreenshot> createScreenshotSurface(
+ const sp<Client>& client, DisplayID display,
+ uint32_t w, uint32_t h, uint32_t flags);
+
status_t removeSurface(const sp<Client>& client, SurfaceID sid);
status_t destroySurface(const wp<LayerBaseClient>& layer);
uint32_t setClientStateLocked(const sp<Client>& client, const layer_state_t& s);
@@ -329,12 +354,6 @@ private:
mutable MessageQueue mEventQueue;
- status_t postMessageAsync(const sp<MessageBase>& msg,
- nsecs_t reltime=0, uint32_t flags = 0);
-
- status_t postMessageSync(const sp<MessageBase>& msg,
- nsecs_t reltime=0, uint32_t flags = 0);
-
// access must be protected by mStateLock
mutable Mutex mStateLock;
State mCurrentState;