diff options
| author | 2010-12-08 17:47:04 -0800 | |
|---|---|---|
| committer | 2010-12-08 17:47:04 -0800 | |
| commit | f23cf9741e305fde432f426578044a78bfd5a4cb (patch) | |
| tree | 1b45887cd8418cb15b86f12656f89625c95a932a | |
| parent | b5393dc479183740c58c73daffbce8fd24d8ddd7 (diff) | |
| parent | ac843f28f677734263307ed4a3a79cc39dcff4f2 (diff) | |
Merge "[3211070] camera preview image is rendered offset from the UI overlay frame"
| -rw-r--r-- | services/surfaceflinger/Layer.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index 85fd2c7f30d6..80aef5fcc2c5 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) |