summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2010-12-08 17:40:28 -0800
committerMathias Agopian <mathias@google.com>2010-12-08 17:40:28 -0800
commitac843f28f677734263307ed4a3a79cc39dcff4f2 (patch)
treea187f1af828b9b3c18ee78f5ae11d4b58cf5c352
parent2d54cd6637d3bf2eb55e2ff6a48c50fea80f796f (diff)
downloadframeworks_base-ac843f28f677734263307ed4a3a79cc39dcff4f2.zip
frameworks_base-ac843f28f677734263307ed4a3a79cc39dcff4f2.tar.gz
frameworks_base-ac843f28f677734263307ed4a3a79cc39dcff4f2.tar.bz2
[3211070] camera preview image is rendered offset from the UI overlay frame
somehow this change got lost. Change-Id: I36f6c7ef3f782918042b77e9dc91a4c811d84a40
-rw-r--r--services/surfaceflinger/Layer.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 85fd2c7..80aef5f 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -233,11 +233,18 @@ void Layer::setPerFrameData(hwc_layer_t* hwcl) {
return;
}
hwcl->handle = buffer->handle;
- // TODO: set the crop value properly
- hwcl->sourceCrop.left = 0;
- hwcl->sourceCrop.top = 0;
- hwcl->sourceCrop.right = buffer->width;
- hwcl->sourceCrop.bottom = buffer->height;
+
+ if (!mBufferCrop.isEmpty()) {
+ hwcl->sourceCrop.left = mBufferCrop.left;
+ hwcl->sourceCrop.top = mBufferCrop.top;
+ hwcl->sourceCrop.right = mBufferCrop.right;
+ hwcl->sourceCrop.bottom = mBufferCrop.bottom;
+ } else {
+ hwcl->sourceCrop.left = 0;
+ hwcl->sourceCrop.top = 0;
+ hwcl->sourceCrop.right = buffer->width;
+ hwcl->sourceCrop.bottom = buffer->height;
+ }
}
void Layer::reloadTexture(const Region& dirty)