OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "core/layout/compositing/CompositingInputsUpdater.h" | 5 #include "core/layout/compositing/CompositingInputsUpdater.h" |
6 | 6 |
7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
8 #include "core/frame/FrameHost.h" | 8 #include "core/frame/FrameHost.h" |
9 #include "core/frame/FrameView.h" | 9 #include "core/frame/FrameView.h" |
10 #include "core/layout/LayoutBlock.h" | 10 #include "core/layout/LayoutBlock.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 154 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
155 properties.unclippedAbsoluteBoundingBox = | 155 properties.unclippedAbsoluteBoundingBox = |
156 enclosingIntRect(m_geometryMap.absoluteRect( | 156 enclosingIntRect(m_geometryMap.absoluteRect( |
157 FloatRect(layer->boundingBoxForCompositingOverlapTest()))); | 157 FloatRect(layer->boundingBoxForCompositingOverlapTest()))); |
158 // FIXME: Setting the absBounds to 1x1 instead of 0x0 makes very little | 158 // FIXME: Setting the absBounds to 1x1 instead of 0x0 makes very little |
159 // sense, but removing this code will make JSGameBench sad. | 159 // sense, but removing this code will make JSGameBench sad. |
160 // See https://codereview.chromium.org/13912020/ | 160 // See https://codereview.chromium.org/13912020/ |
161 if (properties.unclippedAbsoluteBoundingBox.isEmpty()) | 161 if (properties.unclippedAbsoluteBoundingBox.isEmpty()) |
162 properties.unclippedAbsoluteBoundingBox.setSize(IntSize(1, 1)); | 162 properties.unclippedAbsoluteBoundingBox.setSize(IntSize(1, 1)); |
163 | 163 |
164 IntRect clipRect = pixelSnappedIntRect( | 164 ClipRect clipRect; |
165 layer->clipper(PaintLayer::DoNotUseGeometryMapper) | 165 layer->clipper(PaintLayer::DoNotUseGeometryMapper) |
166 .backgroundClipRect( | 166 .calculateBackgroundClipRect( |
167 ClipRectsContext(m_rootLayer, AbsoluteClipRects)) | 167 ClipRectsContext(m_rootLayer, AbsoluteClipRects), clipRect); |
168 .rect()); | 168 IntRect snappedClipRect = pixelSnappedIntRect(clipRect.rect()); |
169 properties.clippedAbsoluteBoundingBox = | 169 properties.clippedAbsoluteBoundingBox = |
170 properties.unclippedAbsoluteBoundingBox; | 170 properties.unclippedAbsoluteBoundingBox; |
171 properties.clippedAbsoluteBoundingBox.intersect(clipRect); | 171 properties.clippedAbsoluteBoundingBox.intersect(snappedClipRect); |
172 } | 172 } |
173 | 173 |
174 const PaintLayer* parent = layer->parent(); | 174 const PaintLayer* parent = layer->parent(); |
175 properties.opacityAncestor = | 175 properties.opacityAncestor = |
176 parent->isTransparent() ? parent : parent->opacityAncestor(); | 176 parent->isTransparent() ? parent : parent->opacityAncestor(); |
177 properties.transformAncestor = | 177 properties.transformAncestor = |
178 parent->transform() ? parent : parent->transformAncestor(); | 178 parent->transform() ? parent : parent->transformAncestor(); |
179 properties.filterAncestor = parent->hasFilterInducingProperty() | 179 properties.filterAncestor = parent->hasFilterInducingProperty() |
180 ? parent | 180 ? parent |
181 : parent->filterAncestor(); | 181 : parent->filterAncestor(); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 ASSERT(!layer->needsCompositingInputsUpdate()); | 272 ASSERT(!layer->needsCompositingInputsUpdate()); |
273 | 273 |
274 for (PaintLayer* child = layer->firstChild(); child; | 274 for (PaintLayer* child = layer->firstChild(); child; |
275 child = child->nextSibling()) | 275 child = child->nextSibling()) |
276 assertNeedsCompositingInputsUpdateBitsCleared(child); | 276 assertNeedsCompositingInputsUpdateBitsCleared(child); |
277 } | 277 } |
278 | 278 |
279 #endif | 279 #endif |
280 | 280 |
281 } // namespace blink | 281 } // namespace blink |
OLD | NEW |