| 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/paint/PaintLayerPainter.h" | 5 #include "core/paint/PaintLayerPainter.h" |
| 6 | 6 |
| 7 #include "core/frame/LocalFrame.h" | 7 #include "core/frame/LocalFrame.h" |
| 8 #include "core/layout/LayoutView.h" | 8 #include "core/layout/LayoutView.h" |
| 9 #include "core/paint/ClipPathClipper.h" | 9 #include "core/paint/ClipPathClipper.h" |
| 10 #include "core/paint/FilterPainter.h" | 10 #include "core/paint/FilterPainter.h" |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 // won't cause the paint phases to become non-empty. | 221 // won't cause the paint phases to become non-empty. |
| 222 if (paintLayer.needsRepaint()) | 222 if (paintLayer.needsRepaint()) |
| 223 needsRepaint = true; | 223 needsRepaint = true; |
| 224 | 224 |
| 225 // Repaint if layer's clip changes. | 225 // Repaint if layer's clip changes. |
| 226 if (!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { | 226 if (!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { |
| 227 ClipRects& clipRects = | 227 ClipRects& clipRects = |
| 228 paintLayer.clipper(PaintLayer::DoNotUseGeometryMapper) | 228 paintLayer.clipper(PaintLayer::DoNotUseGeometryMapper) |
| 229 .paintingClipRects(paintingInfo.rootLayer, respectOverflowClip, | 229 .paintingClipRects(paintingInfo.rootLayer, respectOverflowClip, |
| 230 subpixelAccumulation); | 230 subpixelAccumulation); |
| 231 ClipRects* previousClipRects = paintLayer.previousPaintingClipRects(); | 231 if (!paintLayer.hasPreviousPaintingClipRects() || |
| 232 if (&clipRects != previousClipRects && | 232 clipRects != paintLayer.previousPaintingClipRects()) { |
| 233 (!previousClipRects || clipRects != *previousClipRects)) { | |
| 234 needsRepaint = true; | 233 needsRepaint = true; |
| 235 shouldClearEmptyPaintPhaseFlags = true; | 234 shouldClearEmptyPaintPhaseFlags = true; |
| 236 } | 235 } |
| 237 paintLayer.setPreviousPaintingClipRects(clipRects); | 236 paintLayer.setPreviousPaintingClipRects(clipRects); |
| 238 } | 237 } |
| 239 | 238 |
| 240 // Repaint if previously the layer might be clipped by paintDirtyRect and | 239 // Repaint if previously the layer might be clipped by paintDirtyRect and |
| 241 // paintDirtyRect changes. | 240 // paintDirtyRect changes. |
| 242 if (paintLayer.previousPaintResult() == MayBeClippedByPaintDirtyRect && | 241 if (paintLayer.previousPaintResult() == MayBeClippedByPaintDirtyRect && |
| 243 paintLayer.previousPaintDirtyRect() != paintingInfo.paintDirtyRect) { | 242 paintLayer.previousPaintDirtyRect() != paintingInfo.paintDirtyRect) { |
| (...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1202 context, layoutObject, PaintPhaseClippingMask)) | 1201 context, layoutObject, PaintPhaseClippingMask)) |
| 1203 return; | 1202 return; |
| 1204 | 1203 |
| 1205 IntRect snappedClipRect = pixelSnappedIntRect(clipRect.rect()); | 1204 IntRect snappedClipRect = pixelSnappedIntRect(clipRect.rect()); |
| 1206 LayoutObjectDrawingRecorder drawingRecorder( | 1205 LayoutObjectDrawingRecorder drawingRecorder( |
| 1207 context, layoutObject, PaintPhaseClippingMask, snappedClipRect); | 1206 context, layoutObject, PaintPhaseClippingMask, snappedClipRect); |
| 1208 context.fillRect(snappedClipRect, Color::black); | 1207 context.fillRect(snappedClipRect, Color::black); |
| 1209 } | 1208 } |
| 1210 | 1209 |
| 1211 } // namespace blink | 1210 } // namespace blink |
| OLD | NEW |