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 * Copyright (C) 2014 Google Inc. All rights reserved. | 3 * Copyright (C) 2014 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 Node* node = layer.layoutObject()->node(); | 43 Node* node = layer.layoutObject()->node(); |
44 if (node && isHTMLVideoElement(*node)) { | 44 if (node && isHTMLVideoElement(*node)) { |
45 HTMLVideoElement* element = toHTMLVideoElement(node); | 45 HTMLVideoElement* element = toHTMLVideoElement(node); |
46 if (element->isFullscreen() && element->usesOverlayFullscreenVideo()) | 46 if (element->isFullscreen() && element->usesOverlayFullscreenVideo()) |
47 return false; | 47 return false; |
48 } | 48 } |
49 return true; | 49 return true; |
50 } | 50 } |
51 | 51 |
52 void GraphicsLayerTreeBuilder::rebuild(PaintLayer& layer, AncestorInfo info) { | 52 void GraphicsLayerTreeBuilder::rebuild(PaintLayer& layer, AncestorInfo info) { |
53 // Make the layer compositing if necessary, and set up clipping and content la
yers. | 53 // Make the layer compositing if necessary, and set up clipping and content |
54 // Note that we can only do work here that is independent of whether the desce
ndant layers | 54 // layers. Note that we can only do work here that is independent of whether |
55 // have been processed. computeCompositingRequirements() will already have don
e the paint invalidation if necessary. | 55 // the descendant layers have been processed. computeCompositingRequirements() |
| 56 // will already have done the paint invalidation if necessary. |
56 | 57 |
57 layer.stackingNode()->updateLayerListsIfNeeded(); | 58 layer.stackingNode()->updateLayerListsIfNeeded(); |
58 | 59 |
59 const bool hasCompositedLayerMapping = layer.hasCompositedLayerMapping(); | 60 const bool hasCompositedLayerMapping = layer.hasCompositedLayerMapping(); |
60 CompositedLayerMapping* currentCompositedLayerMapping = | 61 CompositedLayerMapping* currentCompositedLayerMapping = |
61 layer.compositedLayerMapping(); | 62 layer.compositedLayerMapping(); |
62 | 63 |
63 // If this layer has a compositedLayerMapping, then that is where we place sub
sequent children GraphicsLayers. | 64 // If this layer has a compositedLayerMapping, then that is where we place |
64 // Otherwise children continue to append to the child list of the enclosing la
yer. | 65 // subsequent children GraphicsLayers. Otherwise children continue to append |
| 66 // to the child list of the enclosing layer. |
65 GraphicsLayerVector layerChildren; | 67 GraphicsLayerVector layerChildren; |
66 AncestorInfo infoForChildren(info); | 68 AncestorInfo infoForChildren(info); |
67 if (hasCompositedLayerMapping) { | 69 if (hasCompositedLayerMapping) { |
68 infoForChildren.childLayersOfEnclosingCompositedLayer = &layerChildren; | 70 infoForChildren.childLayersOfEnclosingCompositedLayer = &layerChildren; |
69 infoForChildren.enclosingCompositedLayer = &layer; | 71 infoForChildren.enclosingCompositedLayer = &layer; |
70 } | 72 } |
71 | 73 |
72 #if ENABLE(ASSERT) | 74 #if ENABLE(ASSERT) |
73 LayerListMutationDetector mutationChecker(layer.stackingNode()); | 75 LayerListMutationDetector mutationChecker(layer.stackingNode()); |
74 #endif | 76 #endif |
75 | 77 |
76 if (layer.stackingNode()->isStackingContext()) { | 78 if (layer.stackingNode()->isStackingContext()) { |
77 PaintLayerStackingNodeIterator iterator(*layer.stackingNode(), | 79 PaintLayerStackingNodeIterator iterator(*layer.stackingNode(), |
78 NegativeZOrderChildren); | 80 NegativeZOrderChildren); |
79 while (PaintLayerStackingNode* curNode = iterator.next()) | 81 while (PaintLayerStackingNode* curNode = iterator.next()) |
80 rebuild(*curNode->layer(), infoForChildren); | 82 rebuild(*curNode->layer(), infoForChildren); |
81 | 83 |
82 // If a negative z-order child is compositing, we get a foreground layer whi
ch needs to get parented. | 84 // If a negative z-order child is compositing, we get a foreground layer |
| 85 // which needs to get parented. |
83 if (hasCompositedLayerMapping && | 86 if (hasCompositedLayerMapping && |
84 currentCompositedLayerMapping->foregroundLayer()) | 87 currentCompositedLayerMapping->foregroundLayer()) |
85 infoForChildren.childLayersOfEnclosingCompositedLayer->append( | 88 infoForChildren.childLayersOfEnclosingCompositedLayer->append( |
86 currentCompositedLayerMapping->foregroundLayer()); | 89 currentCompositedLayerMapping->foregroundLayer()); |
87 } | 90 } |
88 | 91 |
89 PaintLayerStackingNodeIterator iterator( | 92 PaintLayerStackingNodeIterator iterator( |
90 *layer.stackingNode(), NormalFlowChildren | PositiveZOrderChildren); | 93 *layer.stackingNode(), NormalFlowChildren | PositiveZOrderChildren); |
91 while (PaintLayerStackingNode* curNode = iterator.next()) | 94 while (PaintLayerStackingNode* curNode = iterator.next()) |
92 rebuild(*curNode->layer(), infoForChildren); | 95 rebuild(*curNode->layer(), infoForChildren); |
(...skipping 18 matching lines...) Expand all Loading... |
111 ->compositedLayerMapping() | 114 ->compositedLayerMapping() |
112 ->needsToReparentOverflowControls() && | 115 ->needsToReparentOverflowControls() && |
113 layer.scrollParent()->getScrollableArea()->topmostScrollChild() == &layer) | 116 layer.scrollParent()->getScrollableArea()->topmostScrollChild() == &layer) |
114 info.childLayersOfEnclosingCompositedLayer->append( | 117 info.childLayersOfEnclosingCompositedLayer->append( |
115 layer.scrollParent() | 118 layer.scrollParent() |
116 ->compositedLayerMapping() | 119 ->compositedLayerMapping() |
117 ->detachLayerForOverflowControls(*info.enclosingCompositedLayer)); | 120 ->detachLayerForOverflowControls(*info.enclosingCompositedLayer)); |
118 } | 121 } |
119 | 122 |
120 } // namespace blink | 123 } // namespace blink |
OLD | NEW |