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