Bug 999699 - Use GPU Composition when a frame needs intermediate surface. r=dwilson

This commit is contained in:
Sushil Chauhan 2014-05-05 13:26:51 -07:00
parent d64ce91d2d
commit 99c0f44fba

View File

@ -242,6 +242,10 @@ HwcComposer2D::PrepareLayerList(Layer* aLayer,
if (ContainerLayer* container = aLayer->AsContainerLayer()) {
if (container->UseIntermediateSurface()) {
LOGD("Container layer needs intermediate surface");
return false;
}
nsAutoTArray<Layer*, 12> children;
container->SortChildrenBy3DZOrder(children);
@ -326,24 +330,12 @@ HwcComposer2D::PrepareLayerList(Layer* aLayer,
}
HwcLayer& hwcLayer = mList->hwLayers[current];
hwcLayer.flags = 0;
if (ContainerLayer* parent = aLayer->GetParent()) {
if (parent->UseIntermediateSurface()) {
LOGD("Parent container needs intermediate surface");
hwcLayer.flags = HWC_SKIP_LAYER;
#if ANDROID_VERSION < 18
// No partial HWC Composition on older versions
return false;
#endif
}
}
hwcLayer.displayFrame = displayFrame;
setCrop(&hwcLayer, sourceCrop);
buffer_handle_t handle = fillColor ? nullptr : state.mSurface->getNativeBuffer()->handle;
hwcLayer.handle = handle;
hwcLayer.flags = 0;
hwcLayer.hints = 0;
hwcLayer.blending = isOpaque ? HWC_BLENDING_NONE : HWC_BLENDING_PREMULT;
#if ANDROID_VERSION >= 17