h/q/d: Optimize layer rects on sourceCropf
This change optimizes layer dest rects and updates its
corresponding source crop value on sourceCropf.
Change-Id: Ie921908aa23ae029d2cd3add61795f71a6e5294e
diff --git a/libhwcomposer/hwc_utils.cpp b/libhwcomposer/hwc_utils.cpp
index 5acbfbb..9a5d3d7 100644
--- a/libhwcomposer/hwc_utils.cpp
+++ b/libhwcomposer/hwc_utils.cpp
@@ -1093,7 +1093,8 @@
if(!needsScaling(&list->hwLayers[j])) {
hwc_layer_1_t* layer = (hwc_layer_1_t*)&list->hwLayers[j];
hwc_rect_t& bottomframe = layer->displayFrame;
- hwc_rect_t& bottomCrop = layer->sourceCrop;
+ hwc_rect_t bottomCrop =
+ integerizeSourceCrop(layer->sourceCropf);
int transform =layer->transform;
hwc_rect_t irect = getIntersection(bottomframe, topframe);
@@ -1103,7 +1104,11 @@
dest_rect = deductRect(bottomframe, irect);
qhwc::calculate_crop_rects(bottomCrop, bottomframe,
dest_rect, transform);
-
+ //Update layer sourceCropf
+ layer->sourceCropf.left = bottomCrop.left;
+ layer->sourceCropf.top = bottomCrop.top;
+ layer->sourceCropf.right = bottomCrop.right;
+ layer->sourceCropf.bottom = bottomCrop.bottom;
}
}
j--;