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 PaintLayerPainter_h | 5 #ifndef PaintLayerPainter_h |
6 #define PaintLayerPainter_h | 6 #define PaintLayerPainter_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "core/paint/PaintLayerFragment.h" | 9 #include "core/paint/PaintLayerFragment.h" |
10 #include "core/paint/PaintLayerPaintingInfo.h" | 10 #include "core/paint/PaintLayerPaintingInfo.h" |
11 #include "core/paint/PaintResult.h" | 11 #include "core/paint/PaintResult.h" |
12 #include "wtf/Allocator.h" | 12 #include "wtf/Allocator.h" |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
16 class ClipRect; | 16 class ClipRect; |
17 class PaintLayer; | 17 class PaintLayer; |
18 class GraphicsContext; | 18 class GraphicsContext; |
| 19 class LayerClipRecorder; |
19 class LayoutPoint; | 20 class LayoutPoint; |
20 | 21 |
21 // This class is responsible for painting self-painting PaintLayer. | 22 // This class is responsible for painting self-painting PaintLayer. |
22 // | 23 // |
23 // See PainterLayer SELF-PAINTING LAYER section about what 'self-painting' | 24 // See PainterLayer SELF-PAINTING LAYER section about what 'self-painting' |
24 // means and how it impacts this class. | 25 // means and how it impacts this class. |
25 class CORE_EXPORT PaintLayerPainter { | 26 class CORE_EXPORT PaintLayerPainter { |
26 STACK_ALLOCATED(); | 27 STACK_ALLOCATED(); |
27 | 28 |
28 public: | 29 public: |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 PaintLayerFlags); | 114 PaintLayerFlags); |
114 void paintMaskForFragments(const PaintLayerFragments&, | 115 void paintMaskForFragments(const PaintLayerFragments&, |
115 GraphicsContext&, | 116 GraphicsContext&, |
116 const PaintLayerPaintingInfo&, | 117 const PaintLayerPaintingInfo&, |
117 PaintLayerFlags); | 118 PaintLayerFlags); |
118 void paintChildClippingMaskForFragments(const PaintLayerFragments&, | 119 void paintChildClippingMaskForFragments(const PaintLayerFragments&, |
119 GraphicsContext&, | 120 GraphicsContext&, |
120 const PaintLayerPaintingInfo&, | 121 const PaintLayerPaintingInfo&, |
121 PaintLayerFlags); | 122 PaintLayerFlags); |
122 | 123 |
| 124 void fillMaskingFragment(GraphicsContext&, const LayerClipRecorder&); |
| 125 |
123 static bool needsToClip(const PaintLayerPaintingInfo& localPaintingInfo, | 126 static bool needsToClip(const PaintLayerPaintingInfo& localPaintingInfo, |
124 const ClipRect&); | 127 const ClipRect&); |
125 | 128 |
126 // Returns whether this layer should be painted during sofware painting (i.e., | 129 // Returns whether this layer should be painted during sofware painting (i.e., |
127 // not via calls from CompositedLayerMapping to draw into composited layers). | 130 // not via calls from CompositedLayerMapping to draw into composited layers). |
128 bool shouldPaintLayerInSoftwareMode(const GlobalPaintFlags, | 131 bool shouldPaintLayerInSoftwareMode(const GlobalPaintFlags, |
129 PaintLayerFlags paintFlags); | 132 PaintLayerFlags paintFlags); |
130 | 133 |
131 // Returns true if the painted output of this PaintLayer and its children is | 134 // Returns true if the painted output of this PaintLayer and its children is |
132 // invisible and therefore can't impact painted output. | 135 // invisible and therefore can't impact painted output. |
133 bool paintedOutputInvisible(const PaintLayerPaintingInfo&); | 136 bool paintedOutputInvisible(const PaintLayerPaintingInfo&); |
134 | 137 |
135 PaintLayer& m_paintLayer; | 138 PaintLayer& m_paintLayer; |
136 | 139 |
137 FRIEND_TEST_ALL_PREFIXES(PaintLayerPainterTest, DontPaintWithTinyOpacity); | 140 FRIEND_TEST_ALL_PREFIXES(PaintLayerPainterTest, DontPaintWithTinyOpacity); |
138 FRIEND_TEST_ALL_PREFIXES(PaintLayerPainterTest, | 141 FRIEND_TEST_ALL_PREFIXES(PaintLayerPainterTest, |
139 DontPaintWithTinyOpacityAndBackdropFilter); | 142 DontPaintWithTinyOpacityAndBackdropFilter); |
140 FRIEND_TEST_ALL_PREFIXES(PaintLayerPainterTest, | 143 FRIEND_TEST_ALL_PREFIXES(PaintLayerPainterTest, |
141 DoPaintWithCompositedTinyOpacity); | 144 DoPaintWithCompositedTinyOpacity); |
142 FRIEND_TEST_ALL_PREFIXES(PaintLayerPainterTest, DoPaintWithNonTinyOpacity); | 145 FRIEND_TEST_ALL_PREFIXES(PaintLayerPainterTest, DoPaintWithNonTinyOpacity); |
143 }; | 146 }; |
144 | 147 |
145 } // namespace blink | 148 } // namespace blink |
146 | 149 |
147 #endif // PaintLayerPainter_h | 150 #endif // PaintLayerPainter_h |
OLD | NEW |