summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2010-09-24 18:07:41 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-09-24 18:07:41 -0700
commit495ad4f22096aa172d025c16c25497e7dad8f2bd (patch)
treeb8e2e16c2058b96b563102abc46bfbba0863e352 /libs
parentc388844d50a67ecd8eb93d29d618bae1fa3a3c5d (diff)
parentbeabe75a842d521b005999460d3a6361ab32108e (diff)
downloadframeworks_base-495ad4f22096aa172d025c16c25497e7dad8f2bd.zip
frameworks_base-495ad4f22096aa172d025c16c25497e7dad8f2bd.tar.gz
frameworks_base-495ad4f22096aa172d025c16c25497e7dad8f2bd.tar.bz2
am beabe75a: Merge changes I1f7c4535,I741c68a2 into gingerbread
Merge commit 'beabe75a842d521b005999460d3a6361ab32108e' into gingerbread-plus-aosp * commit 'beabe75a842d521b005999460d3a6361ab32108e': simple test app for screen capture API add support for [1974164] Be able to take a screen shot on the device
Diffstat (limited to 'libs')
-rw-r--r--libs/surfaceflinger_client/ISurfaceComposer.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/libs/surfaceflinger_client/ISurfaceComposer.cpp b/libs/surfaceflinger_client/ISurfaceComposer.cpp
index 5c111f6..040060e 100644
--- a/libs/surfaceflinger_client/ISurfaceComposer.cpp
+++ b/libs/surfaceflinger_client/ISurfaceComposer.cpp
@@ -124,6 +124,21 @@ public:
remote()->transact(BnSurfaceComposer::BOOT_FINISHED, data, &reply);
}
+ virtual status_t captureScreen(DisplayID dpy,
+ sp<IMemoryHeap>* heap,
+ uint32_t* width, uint32_t* height, PixelFormat* format)
+ {
+ Parcel data, reply;
+ data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
+ data.writeInt32(dpy);
+ remote()->transact(BnSurfaceComposer::CAPTURE_SCREEN, data, &reply);
+ *heap = interface_cast<IMemoryHeap>(reply.readStrongBinder());
+ *width = reply.readInt32();
+ *height = reply.readInt32();
+ *format = reply.readInt32();
+ return reply.readInt32();
+ }
+
virtual void signal() const
{
Parcel data, reply;
@@ -190,6 +205,19 @@ status_t BnSurfaceComposer::onTransact(
sp<IBinder> b = getCblk()->asBinder();
reply->writeStrongBinder(b);
} break;
+ case CAPTURE_SCREEN: {
+ CHECK_INTERFACE(ISurfaceComposer, data, reply);
+ DisplayID dpy = data.readInt32();
+ sp<IMemoryHeap> heap;
+ uint32_t w, h;
+ PixelFormat f;
+ status_t res = captureScreen(dpy, &heap, &w, &h, &f);
+ reply->writeStrongBinder(heap->asBinder());
+ reply->writeInt32(w);
+ reply->writeInt32(h);
+ reply->writeInt32(f);
+ reply->writeInt32(res);
+ } break;
default:
return BBinder::onTransact(code, data, reply, flags);
}