OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 { | 499 { |
500 TRACE_EVENT0("blink_rendering", "RenderLayerCompositor::computeCompo
sitingRequirements"); | 500 TRACE_EVENT0("blink_rendering", "RenderLayerCompositor::computeCompo
sitingRequirements"); |
501 OverlapMap overlapTestRequestMap; | 501 OverlapMap overlapTestRequestMap; |
502 | 502 |
503 // FIXME: Passing these unclippedDescendants down and keeping track | 503 // FIXME: Passing these unclippedDescendants down and keeping track |
504 // of them dynamically, we are requiring a full tree walk. This | 504 // of them dynamically, we are requiring a full tree walk. This |
505 // should be removed as soon as proper overlap testing based on | 505 // should be removed as soon as proper overlap testing based on |
506 // scrolling and animation bounds is implemented (crbug.com/252472). | 506 // scrolling and animation bounds is implemented (crbug.com/252472). |
507 Vector<RenderLayer*> unclippedDescendants; | 507 Vector<RenderLayer*> unclippedDescendants; |
508 IntRect absoluteDecendantBoundingBox; | 508 IntRect absoluteDecendantBoundingBox; |
509 computeCompositingRequirements(0, updateRoot, &overlapTestRequestMap
, recursionData, saw3DTransform, unclippedDescendants, absoluteDecendantBounding
Box); | 509 computeCompositingRequirements(0, updateRoot, overlapTestRequestMap,
recursionData, saw3DTransform, unclippedDescendants, absoluteDecendantBoundingB
ox); |
510 #if !ASSERT_DISABLED | 510 #if !ASSERT_DISABLED |
511 assertNeedsRecomputeBoundsBitsCleared(updateRoot); | 511 assertNeedsRecomputeBoundsBitsCleared(updateRoot); |
512 #endif | 512 #endif |
513 } | 513 } |
514 | 514 |
515 { | 515 { |
516 TRACE_EVENT0("blink_rendering", "RenderLayerCompositor::assignLayers
ToBackings"); | 516 TRACE_EVENT0("blink_rendering", "RenderLayerCompositor::assignLayers
ToBackings"); |
517 assignLayersToBackings(updateRoot, layersChanged); | 517 assignLayersToBackings(updateRoot, layersChanged); |
518 } | 518 } |
519 | 519 |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
927 | 927 |
928 // Recurse through the layers in z-index and overflow order (which is equivalen
t to painting order) | 928 // Recurse through the layers in z-index and overflow order (which is equivalen
t to painting order) |
929 // For the z-order children of a compositing layer: | 929 // For the z-order children of a compositing layer: |
930 // If a child layers has a compositing layer, then all subsequent layers mu
st | 930 // If a child layers has a compositing layer, then all subsequent layers mu
st |
931 // be compositing in order to render above that layer. | 931 // be compositing in order to render above that layer. |
932 // | 932 // |
933 // If a child in the negative z-order list is compositing, then the layer i
tself | 933 // If a child in the negative z-order list is compositing, then the layer i
tself |
934 // must be compositing so that its contents render over that child. | 934 // must be compositing so that its contents render over that child. |
935 // This implies that its positive z-index children must also be compositing
. | 935 // This implies that its positive z-index children must also be compositing
. |
936 // | 936 // |
937 void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestor
Layer, RenderLayer* layer, OverlapMap* overlapMap, CompositingRecursionData& cur
rentRecursionData, bool& descendantHas3DTransform, Vector<RenderLayer*>& unclipp
edDescendants, IntRect& absoluteDecendantBoundingBox) | 937 void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestor
Layer, RenderLayer* layer, OverlapMap& overlapMap, CompositingRecursionData& cur
rentRecursionData, bool& descendantHas3DTransform, Vector<RenderLayer*>& unclipp
edDescendants, IntRect& absoluteDecendantBoundingBox) |
938 { | 938 { |
939 layer->stackingNode()->updateLayerListsIfNeeded(); | 939 layer->stackingNode()->updateLayerListsIfNeeded(); |
940 | 940 |
941 if (overlapMap) | 941 overlapMap.geometryMap().pushMappingsToAncestor(layer, ancestorLayer); |
942 overlapMap->geometryMap().pushMappingsToAncestor(layer, ancestorLayer); | |
943 | 942 |
944 // Clear the flag | 943 // Clear the flag |
945 layer->setHasCompositingDescendant(false); | 944 layer->setHasCompositingDescendant(false); |
946 layer->setHasNonCompositedChild(false); | 945 layer->setHasNonCompositedChild(false); |
947 | 946 |
948 // Start by assuming this layer will not need to composite. | 947 // Start by assuming this layer will not need to composite. |
949 CompositingReasons reasonsToComposite = CompositingReasonNone; | 948 CompositingReasons reasonsToComposite = CompositingReasonNone; |
950 | 949 |
951 // First accumulate the straightforward compositing reasons. | 950 // First accumulate the straightforward compositing reasons. |
952 CompositingReasons directReasons = m_compositingReasonFinder.directReasons(l
ayer, &m_needsToRecomputeCompositingRequirements); | 951 CompositingReasons directReasons = m_compositingReasonFinder.directReasons(l
ayer, &m_needsToRecomputeCompositingRequirements); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
985 // Remove irrelevant unclipped descendants in reverse order so our store
d | 984 // Remove irrelevant unclipped descendants in reverse order so our store
d |
986 // indices remain valid. | 985 // indices remain valid. |
987 for (size_t i = 0; i < unclippedDescendantsToRemove.size(); i++) | 986 for (size_t i = 0; i < unclippedDescendantsToRemove.size(); i++) |
988 unclippedDescendants.remove(unclippedDescendantsToRemove.at(unclippe
dDescendantsToRemove.size() - i - 1)); | 987 unclippedDescendants.remove(unclippedDescendantsToRemove.at(unclippe
dDescendantsToRemove.size() - i - 1)); |
989 | 988 |
990 if (reasonsToComposite & CompositingReasonOutOfFlowClipping) | 989 if (reasonsToComposite & CompositingReasonOutOfFlowClipping) |
991 unclippedDescendants.append(layer); | 990 unclippedDescendants.append(layer); |
992 } | 991 } |
993 | 992 |
994 IntRect absBounds; | 993 IntRect absBounds; |
995 if (overlapMap && !layer->isRootLayer()) { | 994 if (!layer->isRootLayer()) { |
996 if (currentRecursionData.m_recomputeLayerBoundsUpdateType == ForceUpdate
|| layer->needsToRecomputeBounds()) { | 995 if (currentRecursionData.m_recomputeLayerBoundsUpdateType == ForceUpdate
|| layer->needsToRecomputeBounds()) { |
997 // FIXME: If the absolute bounds didn't change, then we don't need t
o ForceUpdate descendant RenderLayers. | 996 // FIXME: If the absolute bounds didn't change, then we don't need t
o ForceUpdate descendant RenderLayers. |
998 currentRecursionData.m_recomputeLayerBoundsUpdateType = ForceUpdate; | 997 currentRecursionData.m_recomputeLayerBoundsUpdateType = ForceUpdate; |
999 absBounds = enclosingIntRect(overlapMap->geometryMap().absoluteRect(
layer->overlapBounds())); | 998 absBounds = enclosingIntRect(overlapMap.geometryMap().absoluteRect(l
ayer->overlapBounds())); |
1000 layer->setAbsoluteBoundingBox(absBounds); | 999 layer->setAbsoluteBoundingBox(absBounds); |
1001 } else { | 1000 } else { |
1002 absBounds = layer->absoluteBoundingBox(); | 1001 absBounds = layer->absoluteBoundingBox(); |
1003 } | 1002 } |
1004 // Setting the absBounds to 1x1 instead of 0x0 makes very little sense, | 1003 // Setting the absBounds to 1x1 instead of 0x0 makes very little sense, |
1005 // but removing this code will make JSGameBench sad. | 1004 // but removing this code will make JSGameBench sad. |
1006 // See https://codereview.chromium.org/13912020/ | 1005 // See https://codereview.chromium.org/13912020/ |
1007 if (absBounds.isEmpty()) | 1006 if (absBounds.isEmpty()) |
1008 absBounds.setSize(IntSize(1, 1)); | 1007 absBounds.setSize(IntSize(1, 1)); |
1009 } | 1008 } |
1010 | 1009 |
1011 absoluteDecendantBoundingBox = absBounds; | 1010 absoluteDecendantBoundingBox = absBounds; |
1012 | 1011 |
1013 if (overlapMap && currentRecursionData.m_testingOverlap && !requiresComposit
ingOrSquashing(directReasons)) | 1012 if (currentRecursionData.m_testingOverlap && !requiresCompositingOrSquashing
(directReasons)) |
1014 overlapCompositingReason = overlapMap->overlapsLayers(absBounds) ? Compo
sitingReasonOverlap : CompositingReasonNone; | 1013 overlapCompositingReason = overlapMap.overlapsLayers(absBounds) ? Compos
itingReasonOverlap : CompositingReasonNone; |
1015 | 1014 |
1016 reasonsToComposite |= overlapCompositingReason; | 1015 reasonsToComposite |= overlapCompositingReason; |
1017 | 1016 |
1018 // The children of this layer don't need to composite, unless there is | 1017 // The children of this layer don't need to composite, unless there is |
1019 // a compositing layer among them, so start by inheriting the compositing | 1018 // a compositing layer among them, so start by inheriting the compositing |
1020 // ancestor with m_subtreeIsCompositing set to false. | 1019 // ancestor with m_subtreeIsCompositing set to false. |
1021 CompositingRecursionData childRecursionData(currentRecursionData); | 1020 CompositingRecursionData childRecursionData(currentRecursionData); |
1022 childRecursionData.m_subtreeIsCompositing = false; | 1021 childRecursionData.m_subtreeIsCompositing = false; |
1023 | 1022 |
1024 bool willBeCompositedOrSquashed = canBeComposited(layer) && requiresComposit
ingOrSquashing(reasonsToComposite); | 1023 bool willBeCompositedOrSquashed = canBeComposited(layer) && requiresComposit
ingOrSquashing(reasonsToComposite); |
1025 if (willBeCompositedOrSquashed) { | 1024 if (willBeCompositedOrSquashed) { |
1026 // Tell the parent it has compositing descendants. | 1025 // Tell the parent it has compositing descendants. |
1027 currentRecursionData.m_subtreeIsCompositing = true; | 1026 currentRecursionData.m_subtreeIsCompositing = true; |
1028 // This layer now acts as the ancestor for kids. | 1027 // This layer now acts as the ancestor for kids. |
1029 childRecursionData.m_compositingAncestor = layer; | 1028 childRecursionData.m_compositingAncestor = layer; |
1030 | 1029 |
1031 // Here we know that all children and the layer's own contents can blind
ly paint into | 1030 // Here we know that all children and the layer's own contents can blind
ly paint into |
1032 // this layer's backing, until a descendant is composited. So, we don't
need to check | 1031 // this layer's backing, until a descendant is composited. So, we don't
need to check |
1033 // for overlap with anything behind this layer. | 1032 // for overlap with anything behind this layer. |
1034 if (overlapMap) | 1033 overlapMap.beginNewOverlapTestingContext(); |
1035 overlapMap->beginNewOverlapTestingContext(); | |
1036 // This layer is going to be composited, so children can safely ignore t
he fact that there's an | 1034 // This layer is going to be composited, so children can safely ignore t
he fact that there's an |
1037 // animation running behind this layer, meaning they can rely on the ove
rlap map testing again. | 1035 // animation running behind this layer, meaning they can rely on the ove
rlap map testing again. |
1038 childRecursionData.m_testingOverlap = true; | 1036 childRecursionData.m_testingOverlap = true; |
1039 } | 1037 } |
1040 | 1038 |
1041 #if !ASSERT_DISABLED | 1039 #if !ASSERT_DISABLED |
1042 LayerListMutationDetector mutationChecker(layer->stackingNode()); | 1040 LayerListMutationDetector mutationChecker(layer->stackingNode()); |
1043 #endif | 1041 #endif |
1044 | 1042 |
1045 bool anyDescendantHas3DTransform = false; | 1043 bool anyDescendantHas3DTransform = false; |
1046 bool willHaveForegroundLayer = false; | 1044 bool willHaveForegroundLayer = false; |
1047 | 1045 |
1048 if (layer->stackingNode()->isStackingContainer()) { | 1046 if (layer->stackingNode()->isStackingContainer()) { |
1049 RenderLayerStackingNodeIterator iterator(*layer->stackingNode(), Negativ
eZOrderChildren); | 1047 RenderLayerStackingNodeIterator iterator(*layer->stackingNode(), Negativ
eZOrderChildren); |
1050 while (RenderLayerStackingNode* curNode = iterator.next()) { | 1048 while (RenderLayerStackingNode* curNode = iterator.next()) { |
1051 IntRect absoluteChildDecendantBoundingBox; | 1049 IntRect absoluteChildDecendantBoundingBox; |
1052 computeCompositingRequirements(layer, curNode->layer(), overlapMap,
childRecursionData, anyDescendantHas3DTransform, unclippedDescendants, absoluteC
hildDecendantBoundingBox); | 1050 computeCompositingRequirements(layer, curNode->layer(), overlapMap,
childRecursionData, anyDescendantHas3DTransform, unclippedDescendants, absoluteC
hildDecendantBoundingBox); |
1053 absoluteDecendantBoundingBox.unite(absoluteChildDecendantBoundingBox
); | 1051 absoluteDecendantBoundingBox.unite(absoluteChildDecendantBoundingBox
); |
1054 | 1052 |
1055 // If we have to make a layer for this child, make one now so we can
have a contents layer | 1053 // If we have to make a layer for this child, make one now so we can
have a contents layer |
1056 // (since we need to ensure that the -ve z-order child renders under
neath our contents). | 1054 // (since we need to ensure that the -ve z-order child renders under
neath our contents). |
1057 if (childRecursionData.m_subtreeIsCompositing) { | 1055 if (childRecursionData.m_subtreeIsCompositing) { |
1058 reasonsToComposite |= CompositingReasonNegativeZIndexChildren; | 1056 reasonsToComposite |= CompositingReasonNegativeZIndexChildren; |
1059 | 1057 |
1060 if (!willBeCompositedOrSquashed) { | 1058 if (!willBeCompositedOrSquashed) { |
1061 // make layer compositing | 1059 // make layer compositing |
1062 childRecursionData.m_compositingAncestor = layer; | 1060 childRecursionData.m_compositingAncestor = layer; |
1063 if (overlapMap) | 1061 overlapMap.beginNewOverlapTestingContext(); |
1064 overlapMap->beginNewOverlapTestingContext(); | |
1065 willBeCompositedOrSquashed = true; | 1062 willBeCompositedOrSquashed = true; |
1066 willHaveForegroundLayer = true; | 1063 willHaveForegroundLayer = true; |
1067 | 1064 |
1068 // FIXME: temporary solution for the first negative z-index
composited child: | 1065 // FIXME: temporary solution for the first negative z-index
composited child: |
1069 // re-compute the absBounds for the child so that we
can add the | 1066 // re-compute the absBounds for the child so that we
can add the |
1070 // negative z-index child's bounds to the new overlap
context. | 1067 // negative z-index child's bounds to the new overlap
context. |
1071 if (overlapMap) { | 1068 overlapMap.geometryMap().pushMappingsToAncestor(curNode->lay
er(), layer); |
1072 overlapMap->geometryMap().pushMappingsToAncestor(curNode
->layer(), layer); | 1069 // The above call to computeCompositinRequirements will have
already updated this layer's absolute bounding box. |
1073 // The above call to computeCompositinRequirements will
have already updated this layer's absolute bounding box. | 1070 overlapMap.beginNewOverlapTestingContext(); |
1074 overlapMap->beginNewOverlapTestingContext(); | 1071 ASSERT(!curNode->layer()->needsToRecomputeBounds()); |
1075 ASSERT(!curNode->layer()->needsToRecomputeBounds()); | 1072 addToOverlapMap(overlapMap, curNode->layer(), curNode->layer
()->absoluteBoundingBox()); |
1076 addToOverlapMap(*overlapMap, curNode->layer(), curNode->
layer()->absoluteBoundingBox()); | 1073 overlapMap.finishCurrentOverlapTestingContext(); |
1077 overlapMap->finishCurrentOverlapTestingContext(); | 1074 overlapMap.geometryMap().popMappingsToAncestor(layer); |
1078 overlapMap->geometryMap().popMappingsToAncestor(layer); | |
1079 } | |
1080 } | 1075 } |
1081 } | 1076 } |
1082 } | 1077 } |
1083 } | 1078 } |
1084 | 1079 |
1085 if (overlapMap && willHaveForegroundLayer) { | 1080 if (willHaveForegroundLayer) { |
1086 ASSERT(willBeCompositedOrSquashed); | 1081 ASSERT(willBeCompositedOrSquashed); |
1087 // A foreground layer effectively is a new backing for all subsequent ch
ildren, so | 1082 // A foreground layer effectively is a new backing for all subsequent ch
ildren, so |
1088 // we don't need to test for overlap with anything behind this. So, we c
an finish | 1083 // we don't need to test for overlap with anything behind this. So, we c
an finish |
1089 // the previous context that was accumulating rects for the negative z-i
ndex | 1084 // the previous context that was accumulating rects for the negative z-i
ndex |
1090 // children, and start with a fresh new empty context. | 1085 // children, and start with a fresh new empty context. |
1091 overlapMap->finishCurrentOverlapTestingContext(); | 1086 overlapMap.finishCurrentOverlapTestingContext(); |
1092 overlapMap->beginNewOverlapTestingContext(); | 1087 overlapMap.beginNewOverlapTestingContext(); |
1093 // This layer is going to be composited, so children can safely ignore t
he fact that there's an | 1088 // This layer is going to be composited, so children can safely ignore t
he fact that there's an |
1094 // animation running behind this layer, meaning they can rely on the ove
rlap map testing again | 1089 // animation running behind this layer, meaning they can rely on the ove
rlap map testing again |
1095 childRecursionData.m_testingOverlap = true; | 1090 childRecursionData.m_testingOverlap = true; |
1096 } | 1091 } |
1097 | 1092 |
1098 if (requiresCompositing(reasonsToComposite)) { | 1093 if (requiresCompositing(reasonsToComposite)) { |
1099 currentRecursionData.m_mostRecentCompositedLayer = layer; | 1094 currentRecursionData.m_mostRecentCompositedLayer = layer; |
1100 childRecursionData.m_mostRecentCompositedLayer = layer; | 1095 childRecursionData.m_mostRecentCompositedLayer = layer; |
1101 } | 1096 } |
1102 | 1097 |
(...skipping 10 matching lines...) Expand all Loading... |
1113 | 1108 |
1114 // If we entered compositing mode during the recursion, the root will also n
eed to be composited (as long as accelerated compositing is enabled). | 1109 // If we entered compositing mode during the recursion, the root will also n
eed to be composited (as long as accelerated compositing is enabled). |
1115 if (layer->isRootLayer()) { | 1110 if (layer->isRootLayer()) { |
1116 if (inCompositingMode() && m_hasAcceleratedCompositing) | 1111 if (inCompositingMode() && m_hasAcceleratedCompositing) |
1117 willBeCompositedOrSquashed = true; | 1112 willBeCompositedOrSquashed = true; |
1118 } | 1113 } |
1119 | 1114 |
1120 // All layers (even ones that aren't being composited) need to get added to | 1115 // All layers (even ones that aren't being composited) need to get added to |
1121 // the overlap map. Layers that are not separately composited will paint int
o their | 1116 // the overlap map. Layers that are not separately composited will paint int
o their |
1122 // compositing ancestor's backing, and so are still considered for overlap. | 1117 // compositing ancestor's backing, and so are still considered for overlap. |
1123 if (overlapMap && childRecursionData.m_compositingAncestor && !childRecursio
nData.m_compositingAncestor->isRootLayer()) | 1118 if (childRecursionData.m_compositingAncestor && !childRecursionData.m_compos
itingAncestor->isRootLayer()) |
1124 addToOverlapMap(*overlapMap, layer, absBounds); | 1119 addToOverlapMap(overlapMap, layer, absBounds); |
1125 | 1120 |
1126 if (layer->stackingNode()->isStackingContext()) { | 1121 if (layer->stackingNode()->isStackingContext()) { |
1127 layer->setShouldIsolateCompositedDescendants(childRecursionData.m_hasUni
solatedCompositedBlendingDescendant); | 1122 layer->setShouldIsolateCompositedDescendants(childRecursionData.m_hasUni
solatedCompositedBlendingDescendant); |
1128 } else { | 1123 } else { |
1129 layer->setShouldIsolateCompositedDescendants(false); | 1124 layer->setShouldIsolateCompositedDescendants(false); |
1130 currentRecursionData.m_hasUnisolatedCompositedBlendingDescendant = child
RecursionData.m_hasUnisolatedCompositedBlendingDescendant; | 1125 currentRecursionData.m_hasUnisolatedCompositedBlendingDescendant = child
RecursionData.m_hasUnisolatedCompositedBlendingDescendant; |
1131 } | 1126 } |
1132 | 1127 |
1133 // Now check for reasons to become composited that depend on the state of de
scendant layers. | 1128 // Now check for reasons to become composited that depend on the state of de
scendant layers. |
1134 CompositingReasons subtreeCompositingReasons = subtreeReasonsForCompositing(
layer->renderer(), childRecursionData.m_subtreeIsCompositing, anyDescendantHas3D
Transform); | 1129 CompositingReasons subtreeCompositingReasons = subtreeReasonsForCompositing(
layer->renderer(), childRecursionData.m_subtreeIsCompositing, anyDescendantHas3D
Transform); |
1135 reasonsToComposite |= subtreeCompositingReasons; | 1130 reasonsToComposite |= subtreeCompositingReasons; |
1136 if (!willBeCompositedOrSquashed && canBeComposited(layer) && requiresComposi
tingOrSquashing(subtreeCompositingReasons)) { | 1131 if (!willBeCompositedOrSquashed && canBeComposited(layer) && requiresComposi
tingOrSquashing(subtreeCompositingReasons)) { |
1137 childRecursionData.m_compositingAncestor = layer; | 1132 childRecursionData.m_compositingAncestor = layer; |
1138 if (overlapMap) { | 1133 // FIXME: this context push is effectively a no-op but needs to exist fo
r |
1139 // FIXME: this context push is effectively a no-op but needs to exis
t for | 1134 // now, because the code is designed to push overlap information to the |
1140 // now, because the code is designed to push overlap information to
the | 1135 // second-from-top context of the stack. |
1141 // second-from-top context of the stack. | 1136 overlapMap.beginNewOverlapTestingContext(); |
1142 overlapMap->beginNewOverlapTestingContext(); | 1137 addToOverlapMap(overlapMap, layer, absoluteDecendantBoundingBox); |
1143 addToOverlapMap(*overlapMap, layer, absoluteDecendantBoundingBox); | |
1144 } | |
1145 willBeCompositedOrSquashed = true; | 1138 willBeCompositedOrSquashed = true; |
1146 } | 1139 } |
1147 | 1140 |
1148 // If the original layer is composited, the reflection needs to be, too. | 1141 // If the original layer is composited, the reflection needs to be, too. |
1149 if (layer->reflectionInfo()) { | 1142 if (layer->reflectionInfo()) { |
1150 // FIXME: Shouldn't we call computeCompositingRequirements to handle a r
eflection overlapping with another renderer? | 1143 // FIXME: Shouldn't we call computeCompositingRequirements to handle a r
eflection overlapping with another renderer? |
1151 RenderLayer* reflectionLayer = layer->reflectionInfo()->reflectionLayer(
); | 1144 RenderLayer* reflectionLayer = layer->reflectionInfo()->reflectionLayer(
); |
1152 reflectionLayer->clearNeedsToRecomputeBounds(); | 1145 reflectionLayer->clearNeedsToRecomputeBounds(); |
1153 CompositingReasons reflectionCompositingReason = willBeCompositedOrSquas
hed ? CompositingReasonReflectionOfCompositedParent : CompositingReasonNone; | 1146 CompositingReasons reflectionCompositingReason = willBeCompositedOrSquas
hed ? CompositingReasonReflectionOfCompositedParent : CompositingReasonNone; |
1154 reflectionLayer->setCompositingReasons(reflectionLayer->compositingReaso
ns() | reflectionCompositingReason); | 1147 reflectionLayer->setCompositingReasons(reflectionLayer->compositingReaso
ns() | reflectionCompositingReason); |
1155 } | 1148 } |
1156 | 1149 |
1157 // Subsequent layers in the parent's stacking context may also need to compo
site. | 1150 // Subsequent layers in the parent's stacking context may also need to compo
site. |
1158 if (childRecursionData.m_subtreeIsCompositing) | 1151 if (childRecursionData.m_subtreeIsCompositing) |
1159 currentRecursionData.m_subtreeIsCompositing = true; | 1152 currentRecursionData.m_subtreeIsCompositing = true; |
1160 | 1153 |
1161 if (willBeCompositedOrSquashed && layer->blendInfo().hasBlendMode()) | 1154 if (willBeCompositedOrSquashed && layer->blendInfo().hasBlendMode()) |
1162 currentRecursionData.m_hasUnisolatedCompositedBlendingDescendant = true; | 1155 currentRecursionData.m_hasUnisolatedCompositedBlendingDescendant = true; |
1163 | 1156 |
1164 // Set the flag to say that this SC has compositing children. | 1157 // Set the flag to say that this SC has compositing children. |
1165 layer->setHasCompositingDescendant(childRecursionData.m_subtreeIsCompositing
); | 1158 layer->setHasCompositingDescendant(childRecursionData.m_subtreeIsCompositing
); |
1166 | 1159 |
1167 // Turn overlap testing off for later layers if it's already off, or if we h
ave an animating transform. | 1160 // Turn overlap testing off for later layers if it's already off, or if we h
ave an animating transform. |
1168 // Note that if the layer clips its descendants, there's no reason to propag
ate the child animation to the parent layers. That's because | 1161 // Note that if the layer clips its descendants, there's no reason to propag
ate the child animation to the parent layers. That's because |
1169 // we know for sure the animation is contained inside the clipping rectangle
, which is already added to the overlap map. | 1162 // we know for sure the animation is contained inside the clipping rectangle
, which is already added to the overlap map. |
1170 bool isCompositedClippingLayer = canBeComposited(layer) && (reasonsToComposi
te & CompositingReasonClipsCompositingDescendants); | 1163 bool isCompositedClippingLayer = canBeComposited(layer) && (reasonsToComposi
te & CompositingReasonClipsCompositingDescendants); |
1171 if ((!childRecursionData.m_testingOverlap && !isCompositedClippingLayer) ||
isRunningAcceleratedTransformAnimation(layer->renderer())) | 1164 if ((!childRecursionData.m_testingOverlap && !isCompositedClippingLayer) ||
isRunningAcceleratedTransformAnimation(layer->renderer())) |
1172 currentRecursionData.m_testingOverlap = false; | 1165 currentRecursionData.m_testingOverlap = false; |
1173 | 1166 |
1174 if (overlapMap && childRecursionData.m_compositingAncestor == layer && !laye
r->isRootLayer()) | 1167 if (childRecursionData.m_compositingAncestor == layer && !layer->isRootLayer
()) |
1175 overlapMap->finishCurrentOverlapTestingContext(); | 1168 overlapMap.finishCurrentOverlapTestingContext(); |
1176 | 1169 |
1177 if (layer->isRootLayer()) { | 1170 if (layer->isRootLayer()) { |
1178 // The root layer needs to be composited if anything else in the tree is
composited. | 1171 // The root layer needs to be composited if anything else in the tree is
composited. |
1179 // Otherwise, we can disable compositing entirely. | 1172 // Otherwise, we can disable compositing entirely. |
1180 if (childRecursionData.m_subtreeIsCompositing || requiresCompositingOrSq
uashing(reasonsToComposite) || m_forceCompositingMode) { | 1173 if (childRecursionData.m_subtreeIsCompositing || requiresCompositingOrSq
uashing(reasonsToComposite) || m_forceCompositingMode) { |
1181 willBeCompositedOrSquashed = true; | 1174 willBeCompositedOrSquashed = true; |
1182 reasonsToComposite |= CompositingReasonRoot; | 1175 reasonsToComposite |= CompositingReasonRoot; |
1183 } else { | 1176 } else { |
1184 enableCompositingMode(false); | 1177 enableCompositingMode(false); |
1185 willBeCompositedOrSquashed = false; | 1178 willBeCompositedOrSquashed = false; |
1186 reasonsToComposite = CompositingReasonNone; | 1179 reasonsToComposite = CompositingReasonNone; |
1187 } | 1180 } |
1188 } | 1181 } |
1189 | 1182 |
1190 if (requiresCompositing(reasonsToComposite)) | 1183 if (requiresCompositing(reasonsToComposite)) |
1191 currentRecursionData.m_mostRecentCompositedLayer = layer; | 1184 currentRecursionData.m_mostRecentCompositedLayer = layer; |
1192 | 1185 |
1193 // At this point we have finished collecting all reasons to composite this l
ayer. | 1186 // At this point we have finished collecting all reasons to composite this l
ayer. |
1194 layer->setCompositingReasons(reasonsToComposite); | 1187 layer->setCompositingReasons(reasonsToComposite); |
1195 | 1188 |
1196 if (!willBeCompositedOrSquashed && layer->parent()) | 1189 if (!willBeCompositedOrSquashed && layer->parent()) |
1197 layer->parent()->setHasNonCompositedChild(true); | 1190 layer->parent()->setHasNonCompositedChild(true); |
1198 | 1191 |
1199 descendantHas3DTransform |= anyDescendantHas3DTransform || layer->has3DTrans
form(); | 1192 descendantHas3DTransform |= anyDescendantHas3DTransform || layer->has3DTrans
form(); |
1200 | 1193 overlapMap.geometryMap().popMappingsToAncestor(ancestorLayer); |
1201 if (overlapMap) | |
1202 overlapMap->geometryMap().popMappingsToAncestor(ancestorLayer); | |
1203 } | 1194 } |
1204 | 1195 |
1205 void RenderLayerCompositor::SquashingState::updateSquashingStateForNewMapping(Co
mpositedLayerMappingPtr newCompositedLayerMapping, bool hasNewCompositedLayerMap
ping, LayoutPoint newOffsetFromAbsoluteForSquashingCLM, RenderLayer* newClipping
AncestorForMostRecentMapping) | 1196 void RenderLayerCompositor::SquashingState::updateSquashingStateForNewMapping(Co
mpositedLayerMappingPtr newCompositedLayerMapping, bool hasNewCompositedLayerMap
ping, LayoutPoint newOffsetFromAbsoluteForSquashingCLM, RenderLayer* newClipping
AncestorForMostRecentMapping) |
1206 { | 1197 { |
1207 // The most recent backing is done accumulating any more squashing layers. | 1198 // The most recent backing is done accumulating any more squashing layers. |
1208 if (hasMostRecentMapping) | 1199 if (hasMostRecentMapping) |
1209 mostRecentMapping->finishAccumulatingSquashingLayers(nextSquashedLayerIn
dex); | 1200 mostRecentMapping->finishAccumulatingSquashingLayers(nextSquashedLayerIn
dex); |
1210 | 1201 |
1211 nextSquashedLayerIndex = 0; | 1202 nextSquashedLayerIndex = 0; |
1212 mostRecentMapping = newCompositedLayerMapping; | 1203 mostRecentMapping = newCompositedLayerMapping; |
(...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2307 } else if (graphicsLayer == m_scrollLayer.get()) { | 2298 } else if (graphicsLayer == m_scrollLayer.get()) { |
2308 name = "LocalFrame Scrolling Layer"; | 2299 name = "LocalFrame Scrolling Layer"; |
2309 } else { | 2300 } else { |
2310 ASSERT_NOT_REACHED(); | 2301 ASSERT_NOT_REACHED(); |
2311 } | 2302 } |
2312 | 2303 |
2313 return name; | 2304 return name; |
2314 } | 2305 } |
2315 | 2306 |
2316 } // namespace WebCore | 2307 } // namespace WebCore |
OLD | NEW |