Chromium Code Reviews| 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 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 720 | 720 |
| 721 layer->setViewportConstrainedNotCompositedReason(viewportConstrainedNotC ompositedReason); | 721 layer->setViewportConstrainedNotCompositedReason(viewportConstrainedNotC ompositedReason); |
| 722 return true; | 722 return true; |
| 723 } | 723 } |
| 724 return false; | 724 return false; |
| 725 } | 725 } |
| 726 | 726 |
| 727 bool RenderLayerCompositor::canSquashIntoCurrentSquashingOwner(const RenderLayer * layer, const RenderLayerCompositor::SquashingState& squashingState, const Rend erLayer* clippingAncestor) | 727 bool RenderLayerCompositor::canSquashIntoCurrentSquashingOwner(const RenderLayer * layer, const RenderLayerCompositor::SquashingState& squashingState, const Rend erLayer* clippingAncestor) |
| 728 { | 728 { |
| 729 ASSERT(clippingAncestor); | 729 ASSERT(clippingAncestor); |
| 730 return clippingAncestor == squashingState.clippingAncestorForMostRecentMappi ng; | 730 if (clippingAncestor != squashingState.clippingAncestorForMostRecentMapping) |
| 731 return false; | |
| 732 | |
| 733 ASSERT(squashignState.hasMostRecentMapping); | |
|
jbroman
2014/03/15 05:29:24
drive-by: squashingState not squashignState
chrishtr
2014/03/17 16:58:52
Done.
| |
| 734 if (layer->scrollsWithRespectTo(&squashingState.mostRecentMapping->owningLay er())) | |
| 735 return false; | |
| 736 | |
| 737 return true; | |
| 731 } | 738 } |
| 732 | 739 |
| 733 RenderLayerCompositor::CompositingStateTransitionType RenderLayerCompositor::com puteCompositedLayerUpdate(RenderLayer* layer) | 740 RenderLayerCompositor::CompositingStateTransitionType RenderLayerCompositor::com puteCompositedLayerUpdate(RenderLayer* layer) |
| 734 { | 741 { |
| 735 CompositingStateTransitionType update = NoCompositingStateChange; | 742 CompositingStateTransitionType update = NoCompositingStateChange; |
| 736 if (needsOwnBacking(layer)) { | 743 if (needsOwnBacking(layer)) { |
| 737 if (!layer->hasCompositedLayerMapping()) { | 744 if (!layer->hasCompositedLayerMapping()) { |
| 738 update = AllocateOwnCompositedLayerMapping; | 745 update = AllocateOwnCompositedLayerMapping; |
| 739 } | 746 } |
| 740 } else { | 747 } else { |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 945 if (absBounds.isEmpty()) | 952 if (absBounds.isEmpty()) |
| 946 absBounds.setSize(IntSize(1, 1)); | 953 absBounds.setSize(IntSize(1, 1)); |
| 947 } | 954 } |
| 948 absoluteDecendantBoundingBox = absBounds; | 955 absoluteDecendantBoundingBox = absBounds; |
| 949 | 956 |
| 950 if (overlapMap && currentRecursionData.m_testingOverlap && !requiresComposit ingOrSquashing(directReasons)) | 957 if (overlapMap && currentRecursionData.m_testingOverlap && !requiresComposit ingOrSquashing(directReasons)) |
| 951 overlapCompositingReason = overlapMap->overlapsLayers(absBounds) ? Compo sitingReasonOverlap : CompositingReasonNone; | 958 overlapCompositingReason = overlapMap->overlapsLayers(absBounds) ? Compo sitingReasonOverlap : CompositingReasonNone; |
| 952 | 959 |
| 953 reasonsToComposite |= overlapCompositingReason; | 960 reasonsToComposite |= overlapCompositingReason; |
| 954 | 961 |
| 955 // If the layer is squashable, but would scroll differently than the | |
| 956 // most recent backing that it would squash onto, then don't squash it. | |
| 957 // Note that this happens before we know all possible compositing reasons | |
| 958 // for this layer, but it's OK because we're just forcing the layer conserva tively | |
| 959 // to be separately composited rather than squashed, anyway. | |
| 960 if (currentRecursionData.m_mostRecentCompositedLayer && requiresSquashing(re asonsToComposite) | |
| 961 && layer->scrollsWithRespectTo(currentRecursionData.m_mostRecentComposit edLayer)) | |
| 962 reasonsToComposite |= CompositingReasonOverlapsWithoutSquashingTarget; | |
| 963 | |
| 964 // The children of this layer don't need to composite, unless there is | 962 // The children of this layer don't need to composite, unless there is |
| 965 // a compositing layer among them, so start by inheriting the compositing | 963 // a compositing layer among them, so start by inheriting the compositing |
| 966 // ancestor with m_subtreeIsCompositing set to false. | 964 // ancestor with m_subtreeIsCompositing set to false. |
| 967 CompositingRecursionData childRecursionData(currentRecursionData); | 965 CompositingRecursionData childRecursionData(currentRecursionData); |
| 968 childRecursionData.m_subtreeIsCompositing = false; | 966 childRecursionData.m_subtreeIsCompositing = false; |
| 969 | 967 |
| 970 bool willBeCompositedOrSquashed = canBeComposited(layer) && requiresComposit ingOrSquashing(reasonsToComposite); | 968 bool willBeCompositedOrSquashed = canBeComposited(layer) && requiresComposit ingOrSquashing(reasonsToComposite); |
| 971 if (willBeCompositedOrSquashed) { | 969 if (willBeCompositedOrSquashed) { |
| 972 // Tell the parent it has compositing descendants. | 970 // Tell the parent it has compositing descendants. |
| 973 currentRecursionData.m_subtreeIsCompositing = true; | 971 currentRecursionData.m_subtreeIsCompositing = true; |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1177 if (reflectionLayer->hasCompositedLayerMapping()) | 1175 if (reflectionLayer->hasCompositedLayerMapping()) |
| 1178 reflectionLayer->compositedLayerMapping()->updateGraphicsLayerConfigurat ion(); | 1176 reflectionLayer->compositedLayerMapping()->updateGraphicsLayerConfigurat ion(); |
| 1179 } | 1177 } |
| 1180 | 1178 |
| 1181 void RenderLayerCompositor::assignLayersToBackingsInternal(RenderLayer* layer, S quashingState& squashingState, bool& layersChanged, RenderLayer* clippingAncesto r) | 1179 void RenderLayerCompositor::assignLayersToBackingsInternal(RenderLayer* layer, S quashingState& squashingState, bool& layersChanged, RenderLayer* clippingAncesto r) |
| 1182 { | 1180 { |
| 1183 if (layer->renderer()->hasClipOrOverflowClip()) | 1181 if (layer->renderer()->hasClipOrOverflowClip()) |
| 1184 clippingAncestor = layer; | 1182 clippingAncestor = layer; |
| 1185 | 1183 |
| 1186 if (layerSquashingEnabled() && requiresSquashing(layer->compositingReasons() ) && !canSquashIntoCurrentSquashingOwner(layer, squashingState, clippingAncestor )) | 1184 if (layerSquashingEnabled() && requiresSquashing(layer->compositingReasons() ) && !canSquashIntoCurrentSquashingOwner(layer, squashingState, clippingAncestor )) |
| 1187 layer->setCompositingReasons(layer->compositingReasons() | CompositingRe asonOverlapsWithoutSquashingTarget); | 1185 layer->setCompositingReasons(layer->compositingReasons() | CompositingRe asonNoSquashingTargetFound); |
| 1188 | 1186 |
| 1189 CompositingStateTransitionType compositedLayerUpdate = computeCompositedLaye rUpdate(layer); | 1187 CompositingStateTransitionType compositedLayerUpdate = computeCompositedLaye rUpdate(layer); |
| 1190 | 1188 |
| 1191 if (allocateOrClearCompositedLayerMapping(layer, compositedLayerUpdate)) | 1189 if (allocateOrClearCompositedLayerMapping(layer, compositedLayerUpdate)) |
| 1192 layersChanged = true; | 1190 layersChanged = true; |
| 1193 | 1191 |
| 1194 // FIXME: special-casing reflection layers here is not right. | 1192 // FIXME: special-casing reflection layers here is not right. |
| 1195 if (layer->reflectionInfo()) | 1193 if (layer->reflectionInfo()) |
| 1196 assignLayersToBackingsForReflectionLayer(layer->reflectionInfo()->reflec tionLayer(), layersChanged); | 1194 assignLayersToBackingsForReflectionLayer(layer->reflectionInfo()->reflec tionLayer(), layersChanged); |
| 1197 | 1195 |
| (...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2248 } else if (graphicsLayer == m_scrollLayer.get()) { | 2246 } else if (graphicsLayer == m_scrollLayer.get()) { |
| 2249 name = "LocalFrame Scrolling Layer"; | 2247 name = "LocalFrame Scrolling Layer"; |
| 2250 } else { | 2248 } else { |
| 2251 ASSERT_NOT_REACHED(); | 2249 ASSERT_NOT_REACHED(); |
| 2252 } | 2250 } |
| 2253 | 2251 |
| 2254 return name; | 2252 return name; |
| 2255 } | 2253 } |
| 2256 | 2254 |
| 2257 } // namespace WebCore | 2255 } // namespace WebCore |
| OLD | NEW |