summaryrefslogtreecommitdiffstats
path: root/include/surfaceflinger
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2010-09-29 13:02:36 -0700
committerMathias Agopian <mathias@google.com>2010-09-29 16:55:15 -0700
commit38ed2e39c54a42dda8f00620f960788f569a3698 (patch)
treebf7d48a3bb3c372e7348cab154cb73301ce4a87f /include/surfaceflinger
parente17c054d34676c25f03b4eb0d8daebe41b84bf6e (diff)
downloadframeworks_base-38ed2e39c54a42dda8f00620f960788f569a3698.zip
frameworks_base-38ed2e39c54a42dda8f00620f960788f569a3698.tar.gz
frameworks_base-38ed2e39c54a42dda8f00620f960788f569a3698.tar.bz2
refactored screenshot code
the core screenshot function now can capture the screen at any lower resolution performing bilinear filtering. we also now have some client code to interface with the screenshot service. it's now possible to request a screenshot at a lower resolution. Change-Id: I5a3b0e431421800e3aad601d9af8f94adffbc71f
Diffstat (limited to 'include/surfaceflinger')
-rw-r--r--include/surfaceflinger/ISurfaceComposer.h3
-rw-r--r--include/surfaceflinger/SurfaceComposerClient.h30
2 files changed, 32 insertions, 1 deletions
diff --git a/include/surfaceflinger/ISurfaceComposer.h b/include/surfaceflinger/ISurfaceComposer.h
index 76307b2..6533600 100644
--- a/include/surfaceflinger/ISurfaceComposer.h
+++ b/include/surfaceflinger/ISurfaceComposer.h
@@ -115,7 +115,8 @@ public:
*/
virtual status_t captureScreen(DisplayID dpy,
sp<IMemoryHeap>* heap,
- uint32_t* width, uint32_t* height, PixelFormat* format) = 0;
+ uint32_t* width, uint32_t* height, PixelFormat* format,
+ uint32_t reqWidth, uint32_t reqHeight) = 0;
/* Signal surfaceflinger that there might be some work to do
* This is an ASYNCHRONOUS call.
diff --git a/include/surfaceflinger/SurfaceComposerClient.h b/include/surfaceflinger/SurfaceComposerClient.h
index 8773d71..a80832d 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