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 22 matching lines...) Expand all Loading... |
33 #include "core/layout/compositing/PaintLayerCompositor.h" | 33 #include "core/layout/compositing/PaintLayerCompositor.h" |
34 #include "core/paint/PaintLayer.h" | 34 #include "core/paint/PaintLayer.h" |
35 | 35 |
36 namespace blink { | 36 namespace blink { |
37 | 37 |
38 GraphicsLayerTreeBuilder::GraphicsLayerTreeBuilder() {} | 38 GraphicsLayerTreeBuilder::GraphicsLayerTreeBuilder() {} |
39 | 39 |
40 GraphicsLayerTreeBuilder::~GraphicsLayerTreeBuilder() {} | 40 GraphicsLayerTreeBuilder::~GraphicsLayerTreeBuilder() {} |
41 | 41 |
42 static bool shouldAppendLayer(const PaintLayer& layer) { | 42 static bool shouldAppendLayer(const PaintLayer& layer) { |
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, | 52 void GraphicsLayerTreeBuilder::rebuild(PaintLayer& layer, |
53 GraphicsLayerVector& childLayers) { | 53 GraphicsLayerVector& childLayers) { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 currentCompositedLayerMapping->foregroundLayer()); | 87 currentCompositedLayerMapping->foregroundLayer()); |
88 } | 88 } |
89 | 89 |
90 PaintLayerStackingNodeIterator iterator( | 90 PaintLayerStackingNodeIterator iterator( |
91 *layer.stackingNode(), NormalFlowChildren | PositiveZOrderChildren); | 91 *layer.stackingNode(), NormalFlowChildren | PositiveZOrderChildren); |
92 while (PaintLayerStackingNode* curNode = iterator.next()) | 92 while (PaintLayerStackingNode* curNode = iterator.next()) |
93 rebuild(*curNode->layer(), *layerVectorForChildren); | 93 rebuild(*curNode->layer(), *layerVectorForChildren); |
94 | 94 |
95 if (hasCompositedLayerMapping) { | 95 if (hasCompositedLayerMapping) { |
96 bool parented = false; | 96 bool parented = false; |
97 if (layer.layoutObject()->isLayoutPart()) | 97 if (layer.layoutObject().isLayoutPart()) |
98 parented = PaintLayerCompositor::attachFrameContentLayersToIframeLayer( | 98 parented = PaintLayerCompositor::attachFrameContentLayersToIframeLayer( |
99 toLayoutPart(layer.layoutObject())); | 99 toLayoutPart(layer.layoutObject())); |
100 | 100 |
101 if (!parented) | 101 if (!parented) |
102 currentCompositedLayerMapping->setSublayers(thisLayerChildren); | 102 currentCompositedLayerMapping->setSublayers(thisLayerChildren); |
103 | 103 |
104 if (shouldAppendLayer(layer)) | 104 if (shouldAppendLayer(layer)) |
105 childLayers.push_back( | 105 childLayers.push_back( |
106 currentCompositedLayerMapping->childForSuperlayers()); | 106 currentCompositedLayerMapping->childForSuperlayers()); |
107 } | 107 } |
108 | 108 |
109 if (layer.scrollParent() && | 109 if (layer.scrollParent() && |
110 layer.scrollParent()->hasCompositedLayerMapping() && | 110 layer.scrollParent()->hasCompositedLayerMapping() && |
111 layer.scrollParent() | 111 layer.scrollParent() |
112 ->compositedLayerMapping() | 112 ->compositedLayerMapping() |
113 ->needsToReparentOverflowControls() && | 113 ->needsToReparentOverflowControls() && |
114 layer.scrollParent()->getScrollableArea()->topmostScrollChild() == | 114 layer.scrollParent()->getScrollableArea()->topmostScrollChild() == |
115 &layer) { | 115 &layer) { |
116 childLayers.push_back(layer.scrollParent() | 116 childLayers.push_back(layer.scrollParent() |
117 ->compositedLayerMapping() | 117 ->compositedLayerMapping() |
118 ->detachLayerForOverflowControls()); | 118 ->detachLayerForOverflowControls()); |
119 } | 119 } |
120 } | 120 } |
121 | 121 |
122 } // namespace blink | 122 } // namespace blink |
OLD | NEW |