| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef PaintArtifactCompositor_h | 5 #ifndef PaintArtifactCompositor_h |
| 6 #define PaintArtifactCompositor_h | 6 #define PaintArtifactCompositor_h |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "platform/PlatformExport.h" | 9 #include "platform/PlatformExport.h" |
| 10 #include "platform/RuntimeEnabledFeatures.h" | 10 #include "platform/RuntimeEnabledFeatures.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 | 103 |
| 104 PaintArtifactCompositor(); | 104 PaintArtifactCompositor(); |
| 105 | 105 |
| 106 class ContentLayerClientImpl; | 106 class ContentLayerClientImpl; |
| 107 | 107 |
| 108 // Collects the PaintChunks into groups which will end up in the same | 108 // Collects the PaintChunks into groups which will end up in the same |
| 109 // cc layer. This includes testing PaintChunks for "merge" compatibility (e.g. | 109 // cc layer. This includes testing PaintChunks for "merge" compatibility (e.g. |
| 110 // directly composited property tree states are separately composited) | 110 // directly composited property tree states are separately composited) |
| 111 // and overlap testing (PaintChunks that overlap existing PaintLayers they | 111 // and overlap testing (PaintChunks that overlap existing PaintLayers they |
| 112 // are not compatible with must be separately composited). | 112 // are not compatible with must be separately composited). |
| 113 void collectPendingLayers(const PaintArtifact&, | 113 void collectPendingLayers( |
| 114 Vector<PendingLayer>& pendingLayers, | 114 const PaintArtifact&, |
| 115 GeometryMapper&); | 115 Vector<PendingLayer>& pendingLayers, |
| 116 GeometryMapper&, |
| 117 const HashSet<const EffectPaintPropertyNode*>& compositedEffectNodes); |
| 118 |
| 119 void collectCompositedEffectNodes( |
| 120 const Vector<PendingLayer>& pendingLayers, |
| 121 HashSet<const EffectPaintPropertyNode*>& compositedEffectNodes); |
| 116 | 122 |
| 117 // Builds a leaf layer that represents a single paint chunk. | 123 // Builds a leaf layer that represents a single paint chunk. |
| 118 // Note: cc::Layer API assumes the layer bounds start at (0, 0), but the | 124 // Note: cc::Layer API assumes the layer bounds start at (0, 0), but the |
| 119 // bounding box of a paint chunk does not necessarily start at (0, 0) (and | 125 // bounding box of a paint chunk does not necessarily start at (0, 0) (and |
| 120 // could even be negative). Internally the generated layer translates the | 126 // could even be negative). Internally the generated layer translates the |
| 121 // paint chunk to align the bounding box to (0, 0) and return the actual | 127 // paint chunk to align the bounding box to (0, 0) and return the actual |
| 122 // origin of the paint chunk in the |layerOffset| outparam. | 128 // origin of the paint chunk in the |layerOffset| outparam. |
| 123 scoped_refptr<cc::Layer> compositedLayerForPendingLayer( | 129 scoped_refptr<cc::Layer> compositedLayerForPendingLayer( |
| 124 const PaintArtifact&, | 130 const PaintArtifact&, |
| 125 const PendingLayer&, | 131 const PendingLayer&, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 137 | 143 |
| 138 // This method is an implementation of Algorithm step 4 from goo.gl/6xP8Oe. | 144 // This method is an implementation of Algorithm step 4 from goo.gl/6xP8Oe. |
| 139 static scoped_refptr<cc::DisplayItemList> recordPendingLayer( | 145 static scoped_refptr<cc::DisplayItemList> recordPendingLayer( |
| 140 const PaintArtifact&, | 146 const PaintArtifact&, |
| 141 const PendingLayer&, | 147 const PendingLayer&, |
| 142 const gfx::Rect& combinedBounds, | 148 const gfx::Rect& combinedBounds, |
| 143 GeometryMapper&); | 149 GeometryMapper&); |
| 144 | 150 |
| 145 static bool canMergeInto(const PaintArtifact&, | 151 static bool canMergeInto(const PaintArtifact&, |
| 146 const PaintChunk& newChunk, | 152 const PaintChunk& newChunk, |
| 147 const PendingLayer& candidatePendingLayer); | 153 const PendingLayer& candidatePendingLayer, |
| 154 const HashSet<const EffectPaintPropertyNode*>* |
| 155 compositedEffectNodes = nullptr); |
| 148 | 156 |
| 149 // Returns true if |newChunk| might overlap |candidatePendingLayer| in the | 157 // Returns true if |newChunk| might overlap |candidatePendingLayer| in the |
| 150 // root property tree space. If it does overlap, it will always return true. | 158 // root property tree space. If it does overlap, it will always return true. |
| 151 // If it doesn't overlap, it might return true in cases were we can't | 159 // If it doesn't overlap, it might return true in cases were we can't |
| 152 // efficiently determine a false value, or the truth depends on | 160 // efficiently determine a false value, or the truth depends on |
| 153 // compositor animations. | 161 // compositor animations. |
| 154 static bool mightOverlap(const PaintChunk& newChunk, | 162 static bool mightOverlap(const PaintChunk& newChunk, |
| 155 const PendingLayer& candidatePendingLayer, | 163 const PendingLayer& candidatePendingLayer, |
| 156 GeometryMapper&); | 164 GeometryMapper&); |
| 157 | 165 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 PendingLayer); | 211 PendingLayer); |
| 204 FRIEND_TEST_ALL_PREFIXES(PaintArtifactCompositorTestWithPropertyTrees, | 212 FRIEND_TEST_ALL_PREFIXES(PaintArtifactCompositorTestWithPropertyTrees, |
| 205 PendingLayerWithGeometry); | 213 PendingLayerWithGeometry); |
| 206 FRIEND_TEST_ALL_PREFIXES(PaintArtifactCompositorTestWithPropertyTrees, | 214 FRIEND_TEST_ALL_PREFIXES(PaintArtifactCompositorTestWithPropertyTrees, |
| 207 PendingLayerKnownOpaque); | 215 PendingLayerKnownOpaque); |
| 208 }; | 216 }; |
| 209 | 217 |
| 210 } // namespace blink | 218 } // namespace blink |
| 211 | 219 |
| 212 #endif // PaintArtifactCompositor_h | 220 #endif // PaintArtifactCompositor_h |
| OLD | NEW |