summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2010-12-10 16:30:46 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-12-10 16:30:46 -0800
commit0cfb45a4232f8ccb58b8136ff8628d9978582154 (patch)
tree7adfd6771bb1bacd0d68e2d44c5765e93932738b /libs
parent54ca4587872c46ba7dfc4925e1e35061119ddcbf (diff)
parent3dd25a6bf71bd535bf9dbbe16234229ff45414a0 (diff)
downloadframeworks_base-0cfb45a4232f8ccb58b8136ff8628d9978582154.zip
frameworks_base-0cfb45a4232f8ccb58b8136ff8628d9978582154.tar.gz
frameworks_base-0cfb45a4232f8ccb58b8136ff8628d9978582154.tar.bz2
Merge "[3258939] Need snapshot to limit which layers are included"
Diffstat (limited to 'libs')
-rw-r--r--libs/surfaceflinger_client/ISurfaceComposer.cpp9
-rw-r--r--libs/surfaceflinger_client/SurfaceComposerClient.cpp16
2 files changed, 21 insertions, 4 deletions
diff --git a/libs/surfaceflinger_client/ISurfaceComposer.cpp b/libs/surfaceflinger_client/ISurfaceComposer.cpp
index 969ee79..b8a7a79 100644
--- a/libs/surfaceflinger_client/ISurfaceComposer.cpp
+++ b/libs/surfaceflinger_client/ISurfaceComposer.cpp
@@ -127,13 +127,16 @@ public:
virtual status_t captureScreen(DisplayID dpy,
sp<IMemoryHeap>* heap,
uint32_t* width, uint32_t* height, PixelFormat* format,
- uint32_t reqWidth, uint32_t reqHeight)
+ uint32_t reqWidth, uint32_t reqHeight,
+ uint32_t minLayerZ, uint32_t maxLayerZ)
{
Parcel data, reply;
data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
data.writeInt32(dpy);
data.writeInt32(reqWidth);
data.writeInt32(reqHeight);
+ data.writeInt32(minLayerZ);
+ data.writeInt32(maxLayerZ);
remote()->transact(BnSurfaceComposer::CAPTURE_SCREEN, data, &reply);
*heap = interface_cast<IMemoryHeap>(reply.readStrongBinder());
*width = reply.readInt32();
@@ -231,11 +234,13 @@ status_t BnSurfaceComposer::onTransact(
DisplayID dpy = data.readInt32();
uint32_t reqWidth = data.readInt32();
uint32_t reqHeight = data.readInt32();
+ uint32_t minLayerZ = data.readInt32();
+ uint32_t maxLayerZ = data.readInt32();
sp<IMemoryHeap> heap;
uint32_t w, h;
PixelFormat f;
status_t res = captureScreen(dpy, &heap, &w, &h, &f,
- reqWidth, reqHeight);
+ reqWidth, reqHeight, minLayerZ, maxLayerZ);
reply->writeStrongBinder(heap->asBinder());
reply->writeInt32(w);
reply->writeInt32(h);
diff --git a/libs/surfaceflinger_client/SurfaceComposerClient.cpp b/libs/surfaceflinger_client/SurfaceComposerClient.cpp
index f270461..d336724 100644
--- a/libs/surfaceflinger_client/SurfaceComposerClient.cpp
+++ b/libs/surfaceflinger_client/SurfaceComposerClient.cpp
@@ -555,7 +555,8 @@ status_t ScreenshotClient::update() {
if (s == NULL) return NO_INIT;
mHeap = 0;
return s->captureScreen(0, &mHeap,
- &mWidth, &mHeight, &mFormat, 0, 0);
+ &mWidth, &mHeight, &mFormat, 0, 0,
+ 0, -1UL);
}
status_t ScreenshotClient::update(uint32_t reqWidth, uint32_t reqHeight) {
@@ -563,7 +564,18 @@ status_t ScreenshotClient::update(uint32_t reqWidth, uint32_t reqHeight) {
if (s == NULL) return NO_INIT;
mHeap = 0;
return s->captureScreen(0, &mHeap,
- &mWidth, &mHeight, &mFormat, reqWidth, reqHeight);
+ &mWidth, &mHeight, &mFormat, reqWidth, reqHeight,
+ 0, -1UL);
+}
+
+status_t ScreenshotClient::update(uint32_t reqWidth, uint32_t reqHeight,
+ uint32_t minLayerZ, uint32_t maxLayerZ) {
+ sp<ISurfaceComposer> s(ComposerService::getComposerService());
+ if (s == NULL) return NO_INIT;
+ mHeap = 0;
+ return s->captureScreen(0, &mHeap,
+ &mWidth, &mHeight, &mFormat, reqWidth, reqHeight,
+ minLayerZ, maxLayerZ);
}
void ScreenshotClient::release() {