h/q/d: Drop layers from composition on NULL ROI.
While optimizing layer list for composition, drop the layers
blindly on encountering NULL ROI.
CRs-Fixed: 605482
Change-Id: Ib81f43e8f34d140e6222135f3caa9491cdbbd41e
diff --git a/libhwcomposer/hwc_mdpcomp.cpp b/libhwcomposer/hwc_mdpcomp.cpp
index 8008d39..0d89c79 100644
--- a/libhwcomposer/hwc_mdpcomp.cpp
+++ b/libhwcomposer/hwc_mdpcomp.cpp
@@ -451,6 +451,7 @@
if(!isValidRect(visibleRect)) {
mCurrentFrame.drop[i] = true;
mCurrentFrame.dropCount++;
+ continue;
}
const hwc_layer_1_t* layer = &list->hwLayers[i];
@@ -472,17 +473,17 @@
}else {
/* Reset frame ROI when any layer which needs scaling also needs ROI
* cropping */
- if((res_w != dst_w || res_h != dst_h) &&
- needsScaling (layer)) {
+ if((res_w != dst_w || res_h != dst_h) && needsScaling (layer)) {
ALOGI("%s: Resetting ROI due to scaling", __FUNCTION__);
memset(&mCurrentFrame.drop, 0, sizeof(mCurrentFrame.drop));
mCurrentFrame.dropCount = 0;
return false;
}
- }
- if (layer->blending == HWC_BLENDING_NONE)
- visibleRect = deductRect(visibleRect, res);
+ /* deduct any opaque region from visibleRect */
+ if (layer->blending == HWC_BLENDING_NONE)
+ visibleRect = deductRect(visibleRect, res);
+ }
}
return true;
}