hwc: Use dirtyRect details in solid fill
No need to clear a non updating region in case of swapRect. Use dirtyRect value of updating layer to achieve this. Before using dirtyRect value map it to respective displayFrame, as dirtyRect is with respect to sourceCrop. Change-Id: Ie5782a039f7075396e30405070f12ce2443c0a82
This commit is contained in:
committed by
radhakrishna
parent
75b427cc0a
commit
f4e2e0c579
@@ -534,20 +534,9 @@ bool CopyBit::draw(hwc_context_t *ctx, hwc_display_contents_1_t *list,
|
|||||||
|
|
||||||
mDirtyLayerIndex = checkDirtyRect(ctx, list, dpy);
|
mDirtyLayerIndex = checkDirtyRect(ctx, list, dpy);
|
||||||
hwc_rect_t clearRegion = {0,0,0,0};
|
hwc_rect_t clearRegion = {0,0,0,0};
|
||||||
if (CBUtils::getuiClearRegion(list, clearRegion, layerProp)){
|
if (CBUtils::getuiClearRegion(list, clearRegion, layerProp,
|
||||||
if (mDirtyLayerIndex != -1){
|
mDirtyLayerIndex))
|
||||||
hwc_layer_1_t *layer = &list->hwLayers[mDirtyLayerIndex];
|
|
||||||
#ifdef QCOM_BSP
|
|
||||||
hwc_rect_t result = getIntersection(layer->dirtyRect,clearRegion);
|
|
||||||
if(isValidRect(result))
|
|
||||||
clear(renderBuffer,result);
|
|
||||||
#else
|
|
||||||
clear(renderBuffer,clearRegion);
|
|
||||||
#endif
|
|
||||||
} else {
|
|
||||||
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)) {
|
||||||
|
|||||||
@@ -41,13 +41,36 @@ using namespace qhwc;
|
|||||||
namespace qdutils {
|
namespace qdutils {
|
||||||
|
|
||||||
int CBUtils::getuiClearRegion(hwc_display_contents_1_t* list,
|
int CBUtils::getuiClearRegion(hwc_display_contents_1_t* list,
|
||||||
hwc_rect_t &clearWormholeRect, LayerProp *layerProp) {
|
hwc_rect_t &clearWormholeRect, LayerProp *layerProp, int dirtyIndex) {
|
||||||
|
|
||||||
size_t last = list->numHwLayers - 1;
|
size_t last = list->numHwLayers - 1;
|
||||||
hwc_rect_t fbFrame = list->hwLayers[last].displayFrame;
|
hwc_rect_t fbFrame = list->hwLayers[last].displayFrame;
|
||||||
Rect fbFrameRect(fbFrame.left,fbFrame.top,fbFrame.right,fbFrame.bottom);
|
Rect fbFrameRect(fbFrame.left,fbFrame.top,fbFrame.right,fbFrame.bottom);
|
||||||
Region wormholeRegion(fbFrameRect);
|
Region wormholeRegion(fbFrameRect);
|
||||||
|
|
||||||
|
if (dirtyIndex != -1) {
|
||||||
|
#ifdef QCOM_BSP
|
||||||
|
/*
|
||||||
|
* 1. Map dirty rect of updating layer to its display frame.
|
||||||
|
* 2. Use this display frame as wormholeRegion instead of full Frame
|
||||||
|
* */
|
||||||
|
hwc_rect_t dirtyRect = list->hwLayers[dirtyIndex].dirtyRect;
|
||||||
|
hwc_rect_t displayFrame = list->hwLayers[dirtyIndex].displayFrame;
|
||||||
|
hwc_frect_t sCropF = list->hwLayers[dirtyIndex].sourceCropf;
|
||||||
|
hwc_rect_t srcRect = {int(ceilf(sCropF.left)), int(ceilf(sCropF.top)),
|
||||||
|
int(ceilf(sCropF.right)), int(ceilf(sCropF.bottom))};
|
||||||
|
|
||||||
|
displayFrame.left += dirtyRect.left - srcRect.left;
|
||||||
|
displayFrame.top += dirtyRect.top - srcRect.top;
|
||||||
|
displayFrame.right -= srcRect.right - dirtyRect.right;
|
||||||
|
displayFrame.bottom -= srcRect.bottom - dirtyRect.bottom;
|
||||||
|
|
||||||
|
Rect tmpRect(displayFrame.left,displayFrame.top,displayFrame.right,
|
||||||
|
displayFrame.bottom);
|
||||||
|
Region tmpRegion(tmpRect);
|
||||||
|
wormholeRegion = wormholeRegion.intersect(tmpRegion);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
if(cb_swap_rect::getInstance().checkSwapRectFeature_on() == true){
|
if(cb_swap_rect::getInstance().checkSwapRectFeature_on() == true){
|
||||||
wormholeRegion.set(0,0);
|
wormholeRegion.set(0,0);
|
||||||
for(size_t i = 0 ; i < last; i++) {
|
for(size_t i = 0 ; i < last; i++) {
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class CBUtils {
|
|||||||
public:
|
public:
|
||||||
static int getuiClearRegion(hwc_display_contents_1_t* list,
|
static int getuiClearRegion(hwc_display_contents_1_t* list,
|
||||||
hwc_rect_t &clearWormholeRec,
|
hwc_rect_t &clearWormholeRec,
|
||||||
LayerProp *layerProp);
|
LayerProp *layerProp, int dirtyIndex = -1);
|
||||||
};
|
};
|
||||||
}//namespace qdutils
|
}//namespace qdutils
|
||||||
#endif /* end of include guard: CB_UTIL_H*/
|
#endif /* end of include guard: CB_UTIL_H*/
|
||||||
|
|||||||
Reference in New Issue
Block a user