hwc: Add check for dirtyRect clear call.

We should call clear in dirtyRect only if its a
valid region to clear.
CRs-Fixed: 768200
Change-Id: If627170e9f4893fe13a85a9929511858132d5405
This commit is contained in:
Ramakant Singh
2014-12-08 17:09:31 +05:30
committed by radhakrishna
parent a1cb887cad
commit 75b427cc0a

View File

@@ -533,19 +533,21 @@ bool CopyBit::draw(hwc_context_t *ctx, hwc_display_contents_1_t *list,
} }
mDirtyLayerIndex = checkDirtyRect(ctx, list, dpy); mDirtyLayerIndex = checkDirtyRect(ctx, list, dpy);
if( mDirtyLayerIndex != -1){ hwc_rect_t clearRegion = {0,0,0,0};
hwc_layer_1_t *layer = &list->hwLayers[mDirtyLayerIndex]; if (CBUtils::getuiClearRegion(list, clearRegion, layerProp)){
if (mDirtyLayerIndex != -1){
hwc_layer_1_t *layer = &list->hwLayers[mDirtyLayerIndex];
#ifdef QCOM_BSP #ifdef QCOM_BSP
clear(renderBuffer,layer->dirtyRect); hwc_rect_t result = getIntersection(layer->dirtyRect,clearRegion);
if(isValidRect(result))
clear(renderBuffer,result);
#else #else
clear(renderBuffer,layer->displayFrame); clear(renderBuffer,clearRegion);
#endif #endif
} else { } else {
hwc_rect_t clearRegion = {0,0,0,0};
if(CBUtils::getuiClearRegion(list, clearRegion, layerProp))
clear(renderBuffer, clearRegion); clear(renderBuffer, clearRegion);
}
} }
// numAppLayers-1, as we iterate from 0th layer index with HWC_COPYBIT flag // numAppLayers-1, as we iterate from 0th layer index with HWC_COPYBIT flag
for (int i = 0; i <= (ctx->listStats[dpy].numAppLayers-1); i++) { for (int i = 0; i <= (ctx->listStats[dpy].numAppLayers-1); i++) {
if(!(layerProp[i].mFlags & HWC_COPYBIT)) { if(!(layerProp[i].mFlags & HWC_COPYBIT)) {