summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicardo Cerqueira <cyanogenmod@cerqueira.org>2013-10-26 03:43:03 +0100
committerAbhisek Devkota <ciwrl@cyanogenmod.com>2014-12-09 22:27:53 +0000
commit122f3e26f3515c9bc01405af25b0c5f7f28b277e (patch)
treeca6e3e4913ee1a1ca734d71e96054126cf4c7432
parent37b16c838c0ac14742de83a6cc95c74ca89c7aee (diff)
downloadandroid_frameworks_native-122f3e26f3515c9bc01405af25b0c5f7f28b277e.tar.gz
android_frameworks_native-122f3e26f3515c9bc01405af25b0c5f7f28b277e.tar.bz2
android_frameworks_native-122f3e26f3515c9bc01405af25b0c5f7f28b277e.zip
Support forcing all screenshots into a CPU consumer
Looks like a full GPU path is less efficient on some GPU drivers that we're still using, and CPU is reliably faster... (there's probably a locking condition going on somewhere, this needs to be looked into) Change-Id: I8878796a117d65bf2324507cf8755cadce49f6dc
-rw-r--r--libs/gui/SurfaceComposerClient.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp
index 74103597e..6ec4f2394 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -687,6 +687,12 @@ status_t SurfaceComposerClient::getAnimationFrameStats(FrameStats* outStats) {
// ----------------------------------------------------------------------------
+#ifndef FORCE_SCREENSHOT_CPU_PATH
+#define SS_CPU_CONSUMER false
+#else
+#define SS_CPU_CONSUMER true
+#endif
+
status_t ScreenshotClient::capture(
const sp<IBinder>& display,
const sp<IGraphicBufferProducer>& producer,
@@ -704,7 +710,7 @@ status_t ScreenshotClient::capture(
#endif
return s->captureScreen(display, producer, sourceCrop,
reqWidth, reqHeight, minLayerZ, maxLayerZ, useIdentityTransform,
- ISurfaceComposer::eRotateNone, false);
+ ISurfaceComposer::eRotateNone, SS_CPU_CONSUMER);
}
ScreenshotClient::ScreenshotClient()