summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorRicardo Cerqueira <cyanogenmod@cerqueira.org>2013-10-26 03:43:03 +0100
committerEthan Chen <intervigil@gmail.com>2015-10-16 14:45:55 -0700
commitf4fac7e93f4d5be175c95a795ffed0edabb456f7 (patch)
tree0b4742f26a56ee5cd68beca1df0ef7c20d871184 /libs
parentff59fbd8198f72fc251677cce4b4d9379318e921 (diff)
downloadframeworks_native-f4fac7e93f4d5be175c95a795ffed0edabb456f7.zip
frameworks_native-f4fac7e93f4d5be175c95a795ffed0edabb456f7.tar.gz
frameworks_native-f4fac7e93f4d5be175c95a795ffed0edabb456f7.tar.bz2
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
Diffstat (limited to 'libs')
-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 fe82e3b..9955faf 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -683,6 +683,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,
@@ -692,7 +698,7 @@ status_t ScreenshotClient::capture(
if (s == NULL) return NO_INIT;
return s->captureScreen(display, producer, sourceCrop,
reqWidth, reqHeight, minLayerZ, maxLayerZ, useIdentityTransform,
- ISurfaceComposer::eRotateNone, false);
+ ISurfaceComposer::eRotateNone, SS_CPU_CONSUMER);
}
ScreenshotClient::ScreenshotClient()