summaryrefslogtreecommitdiff
path: root/include/surfaceflinger/SurfaceComposerClient.h
diff options
context:
space:
mode:
author Mathias Agopian <mathias@google.com> 2010-10-04 20:06:51 -0700
committer Android Git Automerger <android-git-automerger@android.com> 2010-10-04 20:06:51 -0700
commitbba3b8efbe7dc9dd6fa326103ef7ddefc28d5ba5 (patch)
tree5da8b6283591ad47c1edca60a110fb3837a2459b /include/surfaceflinger/SurfaceComposerClient.h
parent9fa7926beaf6c7fe32159a7e41fae9f618ec7504 (diff)
parent19058877df9bf94f197a72855f810f7f6bf8d068 (diff)
am 19058877: Merge "refactored screenshot code" into gingerbread
Merge commit '19058877df9bf94f197a72855f810f7f6bf8d068' into gingerbread-plus-aosp * commit '19058877df9bf94f197a72855f810f7f6bf8d068': refactored screenshot code
Diffstat (limited to 'include/surfaceflinger/SurfaceComposerClient.h')
-rw-r--r--include/surfaceflinger/SurfaceComposerClient.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/include/surfaceflinger/SurfaceComposerClient.h b/include/surfaceflinger/SurfaceComposerClient.h
index 8773d7133b56..a80832d5ddfd 100644
--- a/include/surfaceflinger/SurfaceComposerClient.h
+++ b/include/surfaceflinger/SurfaceComposerClient.h
@@ -170,6 +170,36 @@ private:
};
// ---------------------------------------------------------------------------
+
+class ScreenshotClient
+{
+ sp<IMemoryHeap> mHeap;
+ uint32_t mWidth;
+ uint32_t mHeight;
+ PixelFormat mFormat;
+public:
+ ScreenshotClient();
+
+ // frees the previous screenshot and capture a new one
+ status_t update();
+ status_t update(uint32_t reqWidth, uint32_t reqHeight);
+
+ // release memory occupied by the screenshot
+ void release();
+
+ // pixels are valid until this object is freed or
+ // release() or update() is called
+ void const* getPixels() const;
+
+ uint32_t getWidth() const;
+ uint32_t getHeight() const;
+ PixelFormat getFormat() const;
+ uint32_t getStride() const;
+ // size of allocated memory in bytes
+ size_t getSize() const;
+};
+
+// ---------------------------------------------------------------------------
}; // namespace android
#endif // ANDROID_SF_SURFACE_COMPOSER_CLIENT_H