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 LayerPainter_h | 5 #ifndef LayerPainter_h |
6 #define LayerPainter_h | 6 #define LayerPainter_h |
7 | 7 |
8 #include "core/paint/ClipRecorder.h" | 8 #include "core/paint/ClipRecorder.h" |
9 #include "core/rendering/LayerFragment.h" | 9 #include "core/rendering/LayerFragment.h" |
10 #include "core/rendering/LayerPaintingInfo.h" | 10 #include "core/rendering/LayerPaintingInfo.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 // paint() assumes that the caller will clip to the bounds of damageRect if
necessary. | 23 // paint() assumes that the caller will clip to the bounds of damageRect if
necessary. |
24 void paint(GraphicsContext*, const LayoutRect& damageRect, PaintBehavior = P
aintBehaviorNormal, RenderObject* paintingRoot = 0, PaintLayerFlags = 0); | 24 void paint(GraphicsContext*, const LayoutRect& damageRect, PaintBehavior = P
aintBehaviorNormal, RenderObject* paintingRoot = 0, PaintLayerFlags = 0); |
25 // paintLayer() assumes that the caller will clip to the bounds of the paint
ing dirty if necessary. | 25 // paintLayer() assumes that the caller will clip to the bounds of the paint
ing dirty if necessary. |
26 void paintLayer(GraphicsContext*, const LayerPaintingInfo&, PaintLayerFlags)
; | 26 void paintLayer(GraphicsContext*, const LayerPaintingInfo&, PaintLayerFlags)
; |
27 // paintLayerContents() assumes that the caller will clip to the bounds of t
he painting dirty rect if necessary. | 27 // paintLayerContents() assumes that the caller will clip to the bounds of t
he painting dirty rect if necessary. |
28 void paintLayerContents(GraphicsContext*, const LayerPaintingInfo&, PaintLay
erFlags); | 28 void paintLayerContents(GraphicsContext*, const LayerPaintingInfo&, PaintLay
erFlags); |
29 | 29 |
30 void paintOverlayScrollbars(GraphicsContext*, const LayoutRect& damageRect,
PaintBehavior, RenderObject* paintingRoot = 0); | 30 void paintOverlayScrollbars(GraphicsContext*, const LayoutRect& damageRect,
PaintBehavior, RenderObject* paintingRoot = 0); |
31 | 31 |
32 enum BorderRadiusClippingRule { IncludeSelfForBorderRadius, DoNotIncludeSelf
ForBorderRadius }; | 32 enum BorderRadiusClippingRule { IncludeSelfForBorderRadius, DoNotIncludeSelf
ForBorderRadius }; |
33 static void applyRoundedRectClips(RenderLayer&, const LayerPaintingInfo&, Gr
aphicsContext*, PaintLayerFlags, ClipRecorder&, BorderRadiusClippingRule = Inclu
deSelfForBorderRadius); | 33 |
| 34 // Set rounded clip rectangles defined by border radii all the way from the
LayerPaintingInfo |
| 35 // "root" layer down to the specified layer (or the parent of said layer, in
case |
| 36 // BorderRadiusClippingRule says to skip self). fragmentOffset is used for m
ulticol, to specify |
| 37 // the translation required to get from flow thread coordinates to visual co
ordinates for a |
| 38 // certain column. |
| 39 // FIXME: The BorderRadiusClippingRule parameter is really useless now. If w
e want to skip self, |
| 40 // why not just supply the parent layer as the first parameter instead? |
| 41 static void applyRoundedRectClips(RenderLayer&, const LayerPaintingInfo&, Gr
aphicsContext*, const LayoutPoint& fragmentOffset, PaintLayerFlags, ClipRecorder
&, BorderRadiusClippingRule = IncludeSelfForBorderRadius); |
34 | 42 |
35 private: | 43 private: |
36 enum ClipState { HasNotClipped, HasClipped }; | 44 enum ClipState { HasNotClipped, HasClipped }; |
37 | 45 |
38 void paintLayerContentsAndReflection(GraphicsContext*, const LayerPaintingIn
fo&, PaintLayerFlags); | 46 void paintLayerContentsAndReflection(GraphicsContext*, const LayerPaintingIn
fo&, PaintLayerFlags); |
39 void paintLayerByApplyingTransform(GraphicsContext*, const LayerPaintingInfo
&, PaintLayerFlags, const LayoutPoint& translationOffset = LayoutPoint()); | 47 void paintLayerByApplyingTransform(GraphicsContext*, const LayerPaintingInfo
&, PaintLayerFlags, const LayoutPoint& translationOffset = LayoutPoint()); |
40 | 48 |
41 void paintChildren(unsigned childrenToVisit, GraphicsContext*, const LayerPa
intingInfo&, PaintLayerFlags); | 49 void paintChildren(unsigned childrenToVisit, GraphicsContext*, const LayerPa
intingInfo&, PaintLayerFlags); |
42 void paintPaginatedChildLayer(RenderLayer* childLayer, GraphicsContext*, con
st LayerPaintingInfo&, PaintLayerFlags); | 50 void paintPaginatedChildLayer(RenderLayer* childLayer, GraphicsContext*, con
st LayerPaintingInfo&, PaintLayerFlags); |
43 void paintChildLayerIntoColumns(RenderLayer* childLayer, GraphicsContext*, c
onst LayerPaintingInfo&, PaintLayerFlags, const Vector<RenderLayer*>& columnLaye
rs, size_t columnIndex); | 51 void paintChildLayerIntoColumns(RenderLayer* childLayer, GraphicsContext*, c
onst LayerPaintingInfo&, PaintLayerFlags, const Vector<RenderLayer*>& columnLaye
rs, size_t columnIndex); |
(...skipping 18 matching lines...) Expand all Loading... |
62 // layers). | 70 // layers). |
63 bool shouldPaintLayerInSoftwareMode(const LayerPaintingInfo&, PaintLayerFlag
s paintFlags); | 71 bool shouldPaintLayerInSoftwareMode(const LayerPaintingInfo&, PaintLayerFlag
s paintFlags); |
64 bool shouldCreateTransparencyLayerForBlendMode(); | 72 bool shouldCreateTransparencyLayerForBlendMode(); |
65 | 73 |
66 RenderLayer& m_renderLayer; | 74 RenderLayer& m_renderLayer; |
67 }; | 75 }; |
68 | 76 |
69 } // namespace blink | 77 } // namespace blink |
70 | 78 |
71 #endif // LayerPainter_h | 79 #endif // LayerPainter_h |
OLD | NEW |