| 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" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 FullyPainted, | 32 FullyPainted, |
| 33 // Some part of the layer is out of the paint rect and may be not fully
painted. | 33 // Some part of the layer is out of the paint rect and may be not fully
painted. |
| 34 // The results cannot be cached because they may change when paint rect
changes. | 34 // The results cannot be cached because they may change when paint rect
changes. |
| 35 MaybeNotFullyPainted | 35 MaybeNotFullyPainted |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 PaintLayerPainter(PaintLayer& paintLayer) : m_paintLayer(paintLayer) { } | 38 PaintLayerPainter(PaintLayer& paintLayer) : m_paintLayer(paintLayer) { } |
| 39 | 39 |
| 40 // The paint() method paints the layers that intersect the damage rect from
back to front. | 40 // The paint() method paints the layers that intersect the damage rect from
back to front. |
| 41 // paint() assumes that the caller will clip to the bounds of damageRect if
necessary. | 41 // paint() assumes that the caller will clip to the bounds of damageRect if
necessary. |
| 42 void paint(GraphicsContext*, const LayoutRect& damageRect, const GlobalPaint
Flags = GlobalPaintNormalPhase, LayoutObject* paintingRoot = 0, PaintLayerFlags
= 0); | 42 void paint(GraphicsContext&, const LayoutRect& damageRect, const GlobalPaint
Flags = GlobalPaintNormalPhase, LayoutObject* paintingRoot = 0, PaintLayerFlags
= 0); |
| 43 // paintLayer() assumes that the caller will clip to the bounds of the paint
ing dirty if necessary. | 43 // paintLayer() assumes that the caller will clip to the bounds of the paint
ing dirty if necessary. |
| 44 PaintResult paintLayer(GraphicsContext*, const PaintLayerPaintingInfo&, Pain
tLayerFlags); | 44 PaintResult paintLayer(GraphicsContext&, const PaintLayerPaintingInfo&, Pain
tLayerFlags); |
| 45 // paintLayerContents() assumes that the caller will clip to the bounds of t
he painting dirty rect if necessary. | 45 // paintLayerContents() assumes that the caller will clip to the bounds of t
he painting dirty rect if necessary. |
| 46 PaintResult paintLayerContents(GraphicsContext*, const PaintLayerPaintingInf
o&, PaintLayerFlags, FragmentPolicy = AllowMultipleFragments); | 46 PaintResult paintLayerContents(GraphicsContext&, const PaintLayerPaintingInf
o&, PaintLayerFlags, FragmentPolicy = AllowMultipleFragments); |
| 47 | 47 |
| 48 void paintOverlayScrollbars(GraphicsContext*, const LayoutRect& damageRect,
const GlobalPaintFlags, LayoutObject* paintingRoot = 0); | 48 void paintOverlayScrollbars(GraphicsContext&, const LayoutRect& damageRect,
const GlobalPaintFlags, LayoutObject* paintingRoot = 0); |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 enum ClipState { HasNotClipped, HasClipped }; | 51 enum ClipState { HasNotClipped, HasClipped }; |
| 52 | 52 |
| 53 PaintResult paintLayerContentsAndReflection(GraphicsContext*, const PaintLay
erPaintingInfo&, PaintLayerFlags, FragmentPolicy = AllowMultipleFragments); | 53 PaintResult paintLayerContentsAndReflection(GraphicsContext&, const PaintLay
erPaintingInfo&, PaintLayerFlags, FragmentPolicy = AllowMultipleFragments); |
| 54 PaintResult paintLayerWithTransform(GraphicsContext*, const PaintLayerPainti
ngInfo&, PaintLayerFlags); | 54 PaintResult paintLayerWithTransform(GraphicsContext&, const PaintLayerPainti
ngInfo&, PaintLayerFlags); |
| 55 PaintResult paintFragmentByApplyingTransform(GraphicsContext*, const PaintLa
yerPaintingInfo&, PaintLayerFlags, const LayoutPoint& fragmentTranslation); | 55 PaintResult paintFragmentByApplyingTransform(GraphicsContext&, const PaintLa
yerPaintingInfo&, PaintLayerFlags, const LayoutPoint& fragmentTranslation); |
| 56 | 56 |
| 57 PaintResult paintChildren(unsigned childrenToVisit, GraphicsContext*, const
PaintLayerPaintingInfo&, PaintLayerFlags); | 57 PaintResult paintChildren(unsigned childrenToVisit, GraphicsContext&, const
PaintLayerPaintingInfo&, PaintLayerFlags); |
| 58 bool atLeastOneFragmentIntersectsDamageRect(PaintLayerFragments&, const Pain
tLayerPaintingInfo&, PaintLayerFlags, const LayoutPoint& offsetFromRoot); | 58 bool atLeastOneFragmentIntersectsDamageRect(PaintLayerFragments&, const Pain
tLayerPaintingInfo&, PaintLayerFlags, const LayoutPoint& offsetFromRoot); |
| 59 void paintFragmentWithPhase(PaintPhase, const PaintLayerFragment&, GraphicsC
ontext*, const ClipRect&, const PaintLayerPaintingInfo&, LayoutObject* paintingR
ootForLayoutObject, PaintLayerFlags, ClipState); | 59 void paintFragmentWithPhase(PaintPhase, const PaintLayerFragment&, GraphicsC
ontext&, const ClipRect&, const PaintLayerPaintingInfo&, LayoutObject* paintingR
ootForLayoutObject, PaintLayerFlags, ClipState); |
| 60 void paintBackgroundForFragments(const PaintLayerFragments&, GraphicsContext
*, | 60 void paintBackgroundForFragments(const PaintLayerFragments&, GraphicsContext
&, |
| 61 const LayoutRect& transparencyPaintDirtyRect, const PaintLayerPaintingIn
fo&, LayoutObject* paintingRootForLayoutObject, PaintLayerFlags); | 61 const LayoutRect& transparencyPaintDirtyRect, const PaintLayerPaintingIn
fo&, LayoutObject* paintingRootForLayoutObject, PaintLayerFlags); |
| 62 void paintForegroundForFragments(const PaintLayerFragments&, GraphicsContext
*, | 62 void paintForegroundForFragments(const PaintLayerFragments&, GraphicsContext
&, |
| 63 const LayoutRect& transparencyPaintDirtyRect, const PaintLayerPaintingIn
fo&, LayoutObject* paintingRootForLayoutObject, | 63 const LayoutRect& transparencyPaintDirtyRect, const PaintLayerPaintingIn
fo&, LayoutObject* paintingRootForLayoutObject, |
| 64 bool selectionOnly, PaintLayerFlags); | 64 bool selectionOnly, PaintLayerFlags); |
| 65 void paintForegroundForFragmentsWithPhase(PaintPhase, const PaintLayerFragme
nts&, GraphicsContext*, const PaintLayerPaintingInfo&, LayoutObject* paintingRoo
tForLayoutObject, PaintLayerFlags, ClipState); | 65 void paintForegroundForFragmentsWithPhase(PaintPhase, const PaintLayerFragme
nts&, GraphicsContext&, const PaintLayerPaintingInfo&, LayoutObject* paintingRoo
tForLayoutObject, PaintLayerFlags, ClipState); |
| 66 void paintOutlineForFragments(const PaintLayerFragments&, GraphicsContext*,
const PaintLayerPaintingInfo&, LayoutObject* paintingRootForLayoutObject, PaintL
ayerFlags); | 66 void paintOutlineForFragments(const PaintLayerFragments&, GraphicsContext&,
const PaintLayerPaintingInfo&, LayoutObject* paintingRootForLayoutObject, PaintL
ayerFlags); |
| 67 void paintOverflowControlsForFragments(const PaintLayerFragments&, GraphicsC
ontext*, const PaintLayerPaintingInfo&, PaintLayerFlags); | 67 void paintOverflowControlsForFragments(const PaintLayerFragments&, GraphicsC
ontext&, const PaintLayerPaintingInfo&, PaintLayerFlags); |
| 68 void paintMaskForFragments(const PaintLayerFragments&, GraphicsContext*, con
st PaintLayerPaintingInfo&, LayoutObject* paintingRootForLayoutObject, PaintLaye
rFlags); | 68 void paintMaskForFragments(const PaintLayerFragments&, GraphicsContext&, con
st PaintLayerPaintingInfo&, LayoutObject* paintingRootForLayoutObject, PaintLaye
rFlags); |
| 69 void paintChildClippingMaskForFragments(const PaintLayerFragments&, Graphics
Context*, const PaintLayerPaintingInfo&, LayoutObject* paintingRootForLayoutObje
ct, PaintLayerFlags); | 69 void paintChildClippingMaskForFragments(const PaintLayerFragments&, Graphics
Context&, const PaintLayerPaintingInfo&, LayoutObject* paintingRootForLayoutObje
ct, PaintLayerFlags); |
| 70 | 70 |
| 71 static bool needsToClip(const PaintLayerPaintingInfo& localPaintingInfo, con
st ClipRect&); | 71 static bool needsToClip(const PaintLayerPaintingInfo& localPaintingInfo, con
st ClipRect&); |
| 72 | 72 |
| 73 // Returns whether this layer should be painted during sofware painting (i.e
., not via calls from CompositedLayerMapping to draw into composited | 73 // Returns whether this layer should be painted during sofware painting (i.e
., not via calls from CompositedLayerMapping to draw into composited |
| 74 // layers). | 74 // layers). |
| 75 bool shouldPaintLayerInSoftwareMode(const GlobalPaintFlags, PaintLayerFlags
paintFlags); | 75 bool shouldPaintLayerInSoftwareMode(const GlobalPaintFlags, PaintLayerFlags
paintFlags); |
| 76 | 76 |
| 77 PaintLayer& m_paintLayer; | 77 PaintLayer& m_paintLayer; |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 } // namespace blink | 80 } // namespace blink |
| 81 | 81 |
| 82 #endif // PaintLayerPainter_h | 82 #endif // PaintLayerPainter_h |
| OLD | NEW |