summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorPawit Pornkitprasan <p.pawit@gmail.com>2014-11-18 08:38:33 +0700
committerGerrit Code Review <gerrit@cyanogenmod.org>2015-10-16 14:45:10 -0700
commitfd1fb639a1dd9325a9bebb0cd3ca6ebd7d48931d (patch)
treeaae42e1747ba307ff2aa25e518aa85280728be2d /libs
parentbcce313feab557ab7cbb06cc1de941a7bf6657b0 (diff)
downloadframeworks_native-fd1fb639a1dd9325a9bebb0cd3ca6ebd7d48931d.zip
frameworks_native-fd1fb639a1dd9325a9bebb0cd3ca6ebd7d48931d.tar.gz
frameworks_native-fd1fb639a1dd9325a9bebb0cd3ca6ebd7d48931d.tar.bz2
Bring back support for glReadPixels screenshot path
Squashed commit of the following: commit 012d3fe41d1d6cd38a0858b59145e9a4447641fa Author: Hashcode <hashcode0f@gmail.com> Date: Sun Dec 8 19:36:50 2013 +0000 sf: Always use opengles for screen capture Go back to the usage of GRALLOC_USAGE_HW_TEXTURE and GRALLOC_USAGE_HW_RENDERER in captureScreenImplLocked regardless of useReadPixels value This fixes the EGL_NO_IMAGE_KHR error returned from eglCreateImageKHR (blank images returned from screenshot path) Change-Id: I62fe90a081607b9e89c67f3dcfd34c84efc89d35 commit 4866ddf98ac98d8e22a1cd6a21894bb17f274588 Author: Ricardo Cerqueira <cyanogenmod@cerqueira.org> Date: Thu Oct 31 03:53:39 2013 +0000 Revert "remove support for glReadPixels screenshot path" This reverts commit 3ca76f416bc8665a97636ca8a2d0128b9da9d92c. Conflicts: include/gui/ISurfaceComposer.h libs/gui/ISurfaceComposer.cpp libs/gui/SurfaceComposerClient.cpp services/surfaceflinger/SurfaceFlinger.cpp services/surfaceflinger/SurfaceFlinger.h Change-Id: I8c239e533757af770e418dbb198f5a86c736961f Change-Id: I8c239e533757af770e418dbb198f5a86c736961f
Diffstat (limited to 'libs')
-rw-r--r--libs/gui/ISurfaceComposer.cpp8
-rw-r--r--libs/gui/SurfaceComposerClient.cpp5
2 files changed, 9 insertions, 4 deletions
diff --git a/libs/gui/ISurfaceComposer.cpp b/libs/gui/ISurfaceComposer.cpp
index 78886d5..0ad6339 100644
--- a/libs/gui/ISurfaceComposer.cpp
+++ b/libs/gui/ISurfaceComposer.cpp
@@ -103,7 +103,8 @@ public:
Rect sourceCrop, uint32_t reqWidth, uint32_t reqHeight,
uint32_t minLayerZ, uint32_t maxLayerZ,
bool useIdentityTransform,
- ISurfaceComposer::Rotation rotation)
+ ISurfaceComposer::Rotation rotation,
+ bool isCpuConsumer)
{
Parcel data, reply;
data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
@@ -116,6 +117,7 @@ public:
data.writeUint32(maxLayerZ);
data.writeInt32(static_cast<int32_t>(useIdentityTransform));
data.writeInt32(static_cast<int32_t>(rotation));
+ data.writeInt32(isCpuConsumer);
remote()->transact(BnSurfaceComposer::CAPTURE_SCREEN, data, &reply);
return reply.readInt32();
}
@@ -361,11 +363,13 @@ status_t BnSurfaceComposer::onTransact(
uint32_t maxLayerZ = data.readUint32();
bool useIdentityTransform = static_cast<bool>(data.readInt32());
int32_t rotation = data.readInt32();
+ bool isCpuConsumer = data.readInt32();
status_t res = captureScreen(display, producer,
sourceCrop, reqWidth, reqHeight, minLayerZ, maxLayerZ,
useIdentityTransform,
- static_cast<ISurfaceComposer::Rotation>(rotation));
+ static_cast<ISurfaceComposer::Rotation>(rotation),
+ isCpuConsumer);
reply->writeInt32(res);
return NO_ERROR;
}
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp
index 6ad47d8..fe82e3b 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -691,7 +691,8 @@ status_t ScreenshotClient::capture(
sp<ISurfaceComposer> s(ComposerService::getComposerService());
if (s == NULL) return NO_INIT;
return s->captureScreen(display, producer, sourceCrop,
- reqWidth, reqHeight, minLayerZ, maxLayerZ, useIdentityTransform);
+ reqWidth, reqHeight, minLayerZ, maxLayerZ, useIdentityTransform,
+ ISurfaceComposer::eRotateNone, false);
}
ScreenshotClient::ScreenshotClient()
@@ -729,7 +730,7 @@ status_t ScreenshotClient::update(const sp<IBinder>& display,
status_t err = s->captureScreen(display, mProducer, sourceCrop,
reqWidth, reqHeight, minLayerZ, maxLayerZ, useIdentityTransform,
- static_cast<ISurfaceComposer::Rotation>(rotation));
+ static_cast<ISurfaceComposer::Rotation>(rotation), true);
if (err == NO_ERROR) {
err = mCpuConsumer->lockNextBuffer(&mBuffer);