summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2013-08-21 15:23:15 -0700
committerMathias Agopian <mathias@google.com>2013-08-21 15:25:50 -0700
commit4ceff3d5efd27c164788bb2b3f0fd17c691a0204 (patch)
tree64abf1f1bd7b0795ca8bac27f22c60a018177dc1 /services
parent56968ec0bfbe70b76193a2614a23beacfc9cf9dc (diff)
downloadframeworks_native-4ceff3d5efd27c164788bb2b3f0fd17c691a0204.zip
frameworks_native-4ceff3d5efd27c164788bb2b3f0fd17c691a0204.tar.gz
frameworks_native-4ceff3d5efd27c164788bb2b3f0fd17c691a0204.tar.bz2
screenshot layers wouldn't work in some cases
specifically when the display size and the screenshot window size didn't match, the buffer would be rejected. We simply fix this by setting the scalling mode to "SCALE_TO_WINDOW". Bug: 9992306 Change-Id: Ib821767899af330bb70d3cbbfa7d41b02794a075
Diffstat (limited to 'services')
-rw-r--r--services/surfaceflinger/Layer.cpp2
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp1
2 files changed, 3 insertions, 0 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index d88f6d0..f867e86 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -991,6 +991,8 @@ Region Layer::latchBuffer(bool& recomputeVisibleRegions)
if (front.active.w != bufWidth ||
front.active.h != bufHeight) {
// reject this buffer
+ //ALOGD("rejecting buffer: bufWidth=%d, bufHeight=%d, front.active.{w=%d, h=%d}",
+ // bufWidth, bufHeight, front.active.w, front.active.h);
return true;
}
}
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 3058af7..a151142 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -2769,6 +2769,7 @@ status_t SurfaceFlinger::captureScreenImplLocked(
int err = 0;
err = native_window_set_buffers_dimensions(window, reqWidth, reqHeight);
+ err |= native_window_set_scaling_mode(window, NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW);
err |= native_window_set_buffers_format(window, HAL_PIXEL_FORMAT_RGBA_8888);
err |= native_window_set_usage(window, usage);