| 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 #ifndef ObjectPainter_h | 5 #ifndef ObjectPainter_h |
| 6 #define ObjectPainter_h | 6 #define ObjectPainter_h |
| 7 | 7 |
| 8 #include "core/style/ComputedStyleConstants.h" | 8 #include "core/style/ComputedStyleConstants.h" |
| 9 #include "platform/RuntimeEnabledFeatures.h" |
| 9 #include "wtf/Allocator.h" | 10 #include "wtf/Allocator.h" |
| 10 #include "wtf/Vector.h" | 11 #include "wtf/Vector.h" |
| 11 | 12 |
| 12 namespace blink { | 13 namespace blink { |
| 13 | 14 |
| 14 class Color; | 15 class Color; |
| 15 class GraphicsContext; | 16 class GraphicsContext; |
| 16 class LayoutPoint; | 17 class LayoutPoint; |
| 17 struct PaintInfo; | 18 struct PaintInfo; |
| 18 class LayoutObject; | 19 class LayoutObject; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 // Also see core/paint/README.md. | 54 // Also see core/paint/README.md. |
| 54 // | 55 // |
| 55 // It is expected that the caller will call this function independent of the | 56 // It is expected that the caller will call this function independent of the |
| 56 // value of paintInfo.phase, and this function will do atomic paint (for | 57 // value of paintInfo.phase, and this function will do atomic paint (for |
| 57 // PaintPhaseForeground), normal paint (for PaintPhaseSelection and | 58 // PaintPhaseForeground), normal paint (for PaintPhaseSelection and |
| 58 // PaintPhaseTextClip) or nothing (other paint phases) according to | 59 // PaintPhaseTextClip) or nothing (other paint phases) according to |
| 59 // paintInfo.phase. | 60 // paintInfo.phase. |
| 60 void paintAllPhasesAtomically(const PaintInfo&, | 61 void paintAllPhasesAtomically(const PaintInfo&, |
| 61 const LayoutPoint& paintOffset); | 62 const LayoutPoint& paintOffset); |
| 62 | 63 |
| 64 // When SlimmingPaintInvalidation is enabled, we compute paint offsets during |
| 65 // the pre-paint tree walk (PrePaintTreeWalk). This check verifies that the |
| 66 // paint offset computed during pre-paint matches the actual paint offset |
| 67 // during paint. |
| 68 void checkPaintOffset(const PaintInfo& paintInfo, |
| 69 const LayoutPoint& paintOffset) { |
| 70 #if DCHECK_IS_ON() |
| 71 // For now this works for SPv2 (implying SlimmingPaintInvalidation) only, |
| 72 // but not SlimmingPaintInvalidation on SPv1 because of complexities of |
| 73 // paint invalidation containers in SPv1. |
| 74 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) |
| 75 doCheckPaintOffset(paintInfo, paintOffset); |
| 76 #endif |
| 77 } |
| 78 |
| 63 private: | 79 private: |
| 64 static void drawDashedOrDottedBoxSide(GraphicsContext&, | 80 static void drawDashedOrDottedBoxSide(GraphicsContext&, |
| 65 int x1, | 81 int x1, |
| 66 int y1, | 82 int y1, |
| 67 int x2, | 83 int x2, |
| 68 int y2, | 84 int y2, |
| 69 BoxSide, | 85 BoxSide, |
| 70 Color, | 86 Color, |
| 71 int thickness, | 87 int thickness, |
| 72 EBorderStyle, | 88 EBorderStyle, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 98 int x1, | 114 int x1, |
| 99 int y1, | 115 int y1, |
| 100 int x2, | 116 int x2, |
| 101 int y2, | 117 int y2, |
| 102 BoxSide, | 118 BoxSide, |
| 103 Color, | 119 Color, |
| 104 int adjacentWidth1, | 120 int adjacentWidth1, |
| 105 int adjacentWidth2, | 121 int adjacentWidth2, |
| 106 bool antialias); | 122 bool antialias); |
| 107 | 123 |
| 124 #if DCHECK_IS_ON() |
| 125 void doCheckPaintOffset(const PaintInfo&, const LayoutPoint& paintOffset); |
| 126 #endif |
| 127 |
| 108 const LayoutObject& m_layoutObject; | 128 const LayoutObject& m_layoutObject; |
| 109 }; | 129 }; |
| 110 | 130 |
| 111 } // namespace blink | 131 } // namespace blink |
| 112 | 132 |
| 113 #endif | 133 #endif |
| OLD | NEW |