HWC/copybit::Add condition for video layer composition
In case of non overlay target composition of the video layer should be based on composition of UI layer as well. (if taget has dynamic composition) Change-Id: I6f312978f9168dddcf6ad0b1ac72f347b94d6920 CRs-fixed: 516630
This commit is contained in:
@@ -195,24 +195,18 @@ bool CopyBit::prepare(hwc_context_t *ctx, hwc_display_contents_1_t *list,
|
|||||||
if (!useCopybitForYUV && ctx->listStats[dpy].yuvCount)
|
if (!useCopybitForYUV && ctx->listStats[dpy].yuvCount)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
mCopyBitDraw = false;
|
||||||
|
if (useCopybitForRGB &&
|
||||||
|
(useCopybitForYUV || !ctx->listStats[dpy].yuvCount)) {
|
||||||
|
mCopyBitDraw = true;
|
||||||
// numAppLayers-1, as we iterate till 0th layer index
|
// numAppLayers-1, as we iterate till 0th layer index
|
||||||
|
// Mark all layers to be drawn by copybit
|
||||||
for (int i = ctx->listStats[dpy].numAppLayers-1; i >= 0 ; i--) {
|
for (int i = ctx->listStats[dpy].numAppLayers-1; i >= 0 ; i--) {
|
||||||
private_handle_t *hnd = (private_handle_t *)list->hwLayers[i].handle;
|
|
||||||
|
|
||||||
if ((hnd->bufferType == BUFFER_TYPE_VIDEO && useCopybitForYUV) ||
|
|
||||||
(hnd->bufferType == BUFFER_TYPE_UI && useCopybitForRGB)) {
|
|
||||||
layerProp[i].mFlags |= HWC_COPYBIT;
|
layerProp[i].mFlags |= HWC_COPYBIT;
|
||||||
list->hwLayers[i].compositionType = HWC_OVERLAY;
|
list->hwLayers[i].compositionType = HWC_OVERLAY;
|
||||||
mCopyBitDraw = true;
|
|
||||||
} else {
|
|
||||||
// We currently cannot mix copybit layers with layers marked to
|
|
||||||
// be drawn on the framebuffer or that are on the layer cache.
|
|
||||||
mCopyBitDraw = false;
|
|
||||||
//There is no need to reset layer properties here as we return in
|
|
||||||
//draw if mCopyBitDraw is false
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user