summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2013-03-22 00:16:00 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-03-22 00:16:01 +0000
commit0188eeff1fecc3813ddb236be3e2b7a9ad156482 (patch)
tree9c41341053690802dd2ed4420811fc1d71bb3692 /services
parent504e1f2638f6a5d7ad7ce66a89eaaaba15b452db (diff)
parentb4b1730abb7824dc084468c4942f010d94a7e039 (diff)
downloadframeworks_native-0188eeff1fecc3813ddb236be3e2b7a9ad156482.zip
frameworks_native-0188eeff1fecc3813ddb236be3e2b7a9ad156482.tar.gz
frameworks_native-0188eeff1fecc3813ddb236be3e2b7a9ad156482.tar.bz2
Merge "only use glReadPixels() when needed when taking screenshots" into jb-mr2-dev
Diffstat (limited to 'services')
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp12
-rw-r--r--services/surfaceflinger/SurfaceFlinger.h1
2 files changed, 9 insertions, 4 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 8546920..2d84c54 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -109,6 +109,9 @@ SurfaceFlinger::SurfaceFlinger()
// debugging stuff...
char value[PROPERTY_VALUE_MAX];
+ property_get("ro.bq.gpu_to_cpu_unsupported", value, "0");
+ mGpuToCpuSupported = !!atoi(value);
+
property_get("debug.sf.showupdates", value, "0");
mDebugRegion = atoi(value);
@@ -2546,15 +2549,16 @@ status_t SurfaceFlinger::captureScreen(const sp<IBinder>& display,
virtual bool handler() {
Mutex::Autolock _l(flinger->mStateLock);
sp<const DisplayDevice> hw(flinger->getDisplayDevice(display));
- // TODO: if we know the GL->CPU path works, we can call
+ // When we know the GL->CPU path works, we can call
// captureScreenImplLocked() directly, instead of using the
// "CpuConsumer" version, which is much less efficient -- it is
// however needed by some older drivers.
- if (isCpuConsumer) {
- result = flinger->captureScreenImplCpuConsumerLocked(hw,
+
+ if (flinger->mGpuToCpuSupported || !isCpuConsumer) {
+ result = flinger->captureScreenImplLocked(hw,
producer, reqWidth, reqHeight, minLayerZ, maxLayerZ);
} else {
- result = flinger->captureScreenImplLocked(hw,
+ result = flinger->captureScreenImplCpuConsumerLocked(hw,
producer, reqWidth, reqHeight, minLayerZ, maxLayerZ);
}
return true;
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index 2aacfe7..ef88437 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -412,6 +412,7 @@ private:
HWComposer* mHwc;
GLuint mProtectedTexName;
nsecs_t mBootTime;
+ bool mGpuToCpuSupported;
sp<EventThread> mEventThread;
GLint mMaxViewportDims[2];
GLint mMaxTextureSize;