libhwcomposer: Mark all layers below the SKIP layer for GPU composition.

If there is a SKIP layer present, the SKIP layers are first composited
using the GPU. If there any layer below the SKIP layer that performs
any operations on the FrameBuffer, it results in undesireable results
on the screen e.g. artifacts, since SurfaceFlinger draws the SKIP layers
before the HWComposer.

Change-Id: I198236673e2a0bd19a6087ff01049061547abb47
CRs-fixed: 327392
This commit is contained in:
Naomi Luis 2012-01-12 10:46:08 -08:00 committed by Andrew Sutherland
parent d6b1474f2d
commit cf67073149

View File

@ -847,26 +847,13 @@ static int hwc_prepare(hwc_composer_device_t *dev, hwc_layer_list_t* list) {
if (isS3DCompositionNeeded)
markUILayerForS3DComposition(list->hwLayers[i], s3dVideoFormat);
if (hwcModule->compositionType
& (COMPOSITION_TYPE_C2D | COMPOSITION_TYPE_MDP)) {
// Ensure that HWC_OVERLAY layers below skip layers do not
// overwrite GPU composed skip layers.
ssize_t layer_countdown = ((ssize_t)i) - 1;
while (layer_countdown >= 0)
{
// Mark every non-mdp overlay layer below the
// skip-layer for GPU composition.
switch(list->hwLayers[layer_countdown].compositionType) {
case HWC_FRAMEBUFFER:
case HWC_USE_OVERLAY:
break;
case HWC_USE_COPYBIT:
default:
list->hwLayers[layer_countdown].compositionType = HWC_FRAMEBUFFER;
break;
}
layer_countdown--;
}
ssize_t layer_countdown = ((ssize_t)i) - 1;
// Mark every layer below the SKIP layer to be composed by the GPU
while (layer_countdown >= 0)
{
list->hwLayers[layer_countdown].compositionType = HWC_FRAMEBUFFER;
list->hwLayers[i].hints &= ~HWC_HINT_CLEAR_FB;
layer_countdown--;
}
continue;
}