| 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/FrameView.h" | 7 #include "core/frame/FrameView.h" |
| 8 #include "core/frame/Settings.h" | 8 #include "core/frame/Settings.h" |
| 9 #include "core/layout/ClipPathOperation.h" | 9 #include "core/layout/ClipPathOperation.h" |
| 10 #include "core/layout/LayoutBlock.h" | 10 #include "core/layout/LayoutBlock.h" |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 | 216 |
| 217 static bool shouldRepaintSubsequence(PaintLayer& paintLayer, const PaintLayerPai
ntingInfo& paintingInfo, ShouldRespectOverflowClip respectOverflowClip, const La
youtSize& subpixelAccumulation) | 217 static bool shouldRepaintSubsequence(PaintLayer& paintLayer, const PaintLayerPai
ntingInfo& paintingInfo, ShouldRespectOverflowClip respectOverflowClip, const La
youtSize& subpixelAccumulation) |
| 218 { | 218 { |
| 219 bool needsRepaint = false; | 219 bool needsRepaint = false; |
| 220 | 220 |
| 221 // Repaint subsequence if the layer is marked for needing repaint. | 221 // Repaint subsequence if the layer is marked for needing repaint. |
| 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 ClipRects* clipRects = paintLayer.clipper().paintingClipRects(paintingInfo.r
ootLayer, respectOverflowClip, subpixelAccumulation); | 226 ClipRects& clipRects = paintLayer.clipper().paintingClipRects(paintingInfo.r
ootLayer, respectOverflowClip, subpixelAccumulation); |
| 227 ClipRects* previousClipRects = paintLayer.previousPaintingClipRects(); | 227 ClipRects* previousClipRects = paintLayer.previousPaintingClipRects(); |
| 228 if (!needsRepaint && clipRects != previousClipRects && (!clipRects || !previ
ousClipRects || *clipRects != *previousClipRects)) | 228 if (!needsRepaint && &clipRects != previousClipRects && (!previousClipRects
|| clipRects != *previousClipRects)) |
| 229 needsRepaint = true; | 229 needsRepaint = true; |
| 230 paintLayer.setPreviousPaintingClipRects(clipRects); | 230 paintLayer.setPreviousPaintingClipRects(clipRects); |
| 231 | 231 |
| 232 // Repaint if previously the layer might be clipped by paintDirtyRect and pa
intDirtyRect changes. | 232 // Repaint if previously the layer might be clipped by paintDirtyRect and pa
intDirtyRect changes. |
| 233 if (!needsRepaint && paintLayer.previousPaintResult() == PaintLayerPainter::
MayBeClippedByPaintDirtyRect && paintLayer.previousPaintDirtyRect() != paintingI
nfo.paintDirtyRect) | 233 if (!needsRepaint && paintLayer.previousPaintResult() == PaintLayerPainter::
MayBeClippedByPaintDirtyRect && paintLayer.previousPaintDirtyRect() != paintingI
nfo.paintDirtyRect) |
| 234 needsRepaint = true; | 234 needsRepaint = true; |
| 235 paintLayer.setPreviousPaintDirtyRect(paintingInfo.paintDirtyRect); | 235 paintLayer.setPreviousPaintDirtyRect(paintingInfo.paintDirtyRect); |
| 236 | 236 |
| 237 // Repaint if scroll offset accumulation changes. | 237 // Repaint if scroll offset accumulation changes. |
| 238 if (!needsRepaint && paintingInfo.scrollOffsetAccumulation != paintLayer.pre
viousScrollOffsetAccumulationForPainting()) | 238 if (!needsRepaint && paintingInfo.scrollOffsetAccumulation != paintLayer.pre
viousScrollOffsetAccumulationForPainting()) |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 if (!m_paintLayer.containsDirtyOverlayScrollbars()) | 736 if (!m_paintLayer.containsDirtyOverlayScrollbars()) |
| 737 return; | 737 return; |
| 738 | 738 |
| 739 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe
ct(damageRect)), paintFlags, LayoutSize()); | 739 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe
ct(damageRect)), paintFlags, LayoutSize()); |
| 740 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); | 740 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); |
| 741 | 741 |
| 742 m_paintLayer.setContainsDirtyOverlayScrollbars(false); | 742 m_paintLayer.setContainsDirtyOverlayScrollbars(false); |
| 743 } | 743 } |
| 744 | 744 |
| 745 } // namespace blink | 745 } // namespace blink |
| OLD | NEW |