| 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/rendering/LayerFragment.h" | 8 #include "core/rendering/LayerFragment.h" |
| 9 #include "core/rendering/LayerPaintingInfo.h" | 9 #include "core/rendering/LayerPaintingInfo.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 class ClipRect; | 13 class ClipRect; |
| 14 class LayoutPoint; | 14 class LayoutPoint; |
| 15 class RenderLayer; | 15 class RenderLayer; |
| 16 | 16 |
| 17 class LayerPainter { | 17 class LayerPainter { |
| 18 public: | 18 public: |
| 19 enum FragmentPolicy { AllowMultipleFragments, ForceSingleFragment }; |
| 20 |
| 19 LayerPainter(RenderLayer& renderLayer) : m_renderLayer(renderLayer) { } | 21 LayerPainter(RenderLayer& renderLayer) : m_renderLayer(renderLayer) { } |
| 20 | 22 |
| 21 // The paint() method paints the layers that intersect the damage rect from
back to front. | 23 // The paint() method paints the layers that intersect the damage rect from
back to front. |
| 22 // paint() assumes that the caller will clip to the bounds of damageRect if
necessary. | 24 // paint() assumes that the caller will clip to the bounds of damageRect if
necessary. |
| 23 void paint(GraphicsContext*, const LayoutRect& damageRect, PaintBehavior = P
aintBehaviorNormal, RenderObject* paintingRoot = 0, PaintLayerFlags = 0); | 25 void paint(GraphicsContext*, const LayoutRect& damageRect, PaintBehavior = P
aintBehaviorNormal, RenderObject* paintingRoot = 0, PaintLayerFlags = 0); |
| 24 // paintLayer() assumes that the caller will clip to the bounds of the paint
ing dirty if necessary. | 26 // paintLayer() assumes that the caller will clip to the bounds of the paint
ing dirty if necessary. |
| 25 void paintLayer(GraphicsContext*, const LayerPaintingInfo&, PaintLayerFlags)
; | 27 void paintLayer(GraphicsContext*, const LayerPaintingInfo&, PaintLayerFlags)
; |
| 26 // paintLayerContents() assumes that the caller will clip to the bounds of t
he painting dirty rect if necessary. | 28 // paintLayerContents() assumes that the caller will clip to the bounds of t
he painting dirty rect if necessary. |
| 27 void paintLayerContents(GraphicsContext*, const LayerPaintingInfo&, PaintLay
erFlags); | 29 void paintLayerContents(GraphicsContext*, const LayerPaintingInfo&, PaintLay
erFlags, FragmentPolicy = AllowMultipleFragments); |
| 28 | 30 |
| 29 void paintOverlayScrollbars(GraphicsContext*, const LayoutRect& damageRect,
PaintBehavior, RenderObject* paintingRoot = 0); | 31 void paintOverlayScrollbars(GraphicsContext*, const LayoutRect& damageRect,
PaintBehavior, RenderObject* paintingRoot = 0); |
| 30 | 32 |
| 31 private: | 33 private: |
| 32 enum ClipState { HasNotClipped, HasClipped }; | 34 enum ClipState { HasNotClipped, HasClipped }; |
| 33 | 35 |
| 34 void paintLayerContentsAndReflection(GraphicsContext*, const LayerPaintingIn
fo&, PaintLayerFlags); | 36 void paintLayerContentsAndReflection(GraphicsContext*, const LayerPaintingIn
fo&, PaintLayerFlags, FragmentPolicy = AllowMultipleFragments); |
| 35 void paintLayerWithTransform(GraphicsContext*, const LayerPaintingInfo&, Pai
ntLayerFlags); | 37 void paintLayerWithTransform(GraphicsContext*, const LayerPaintingInfo&, Pai
ntLayerFlags); |
| 36 void paintFragmentByApplyingTransform(GraphicsContext*, const LayerPaintingI
nfo&, PaintLayerFlags, const LayoutPoint& fragmentTranslation); | 38 void paintFragmentByApplyingTransform(GraphicsContext*, const LayerPaintingI
nfo&, PaintLayerFlags, const LayoutPoint& fragmentTranslation); |
| 37 | 39 |
| 38 void paintChildren(unsigned childrenToVisit, GraphicsContext*, const LayerPa
intingInfo&, PaintLayerFlags); | 40 void paintChildren(unsigned childrenToVisit, GraphicsContext*, const LayerPa
intingInfo&, PaintLayerFlags); |
| 39 void paintPaginatedChildLayer(RenderLayer* childLayer, GraphicsContext*, con
st LayerPaintingInfo&, PaintLayerFlags); | 41 void paintPaginatedChildLayer(RenderLayer* childLayer, GraphicsContext*, con
st LayerPaintingInfo&, PaintLayerFlags); |
| 40 void paintChildLayerIntoColumns(RenderLayer* childLayer, GraphicsContext*, c
onst LayerPaintingInfo&, PaintLayerFlags, const Vector<RenderLayer*>& columnLaye
rs, size_t columnIndex); | 42 void paintChildLayerIntoColumns(RenderLayer* childLayer, GraphicsContext*, c
onst LayerPaintingInfo&, PaintLayerFlags, const Vector<RenderLayer*>& columnLaye
rs, size_t columnIndex); |
| 41 bool atLeastOneFragmentIntersectsDamageRect(LayerFragments&, const LayerPain
tingInfo&, PaintLayerFlags, const LayoutPoint& offsetFromRoot); | 43 bool atLeastOneFragmentIntersectsDamageRect(LayerFragments&, const LayerPain
tingInfo&, PaintLayerFlags, const LayoutPoint& offsetFromRoot); |
| 42 void paintFragmentWithPhase(PaintPhase, const LayerFragment&, GraphicsContex
t*, const ClipRect&, const LayerPaintingInfo&, PaintBehavior, RenderObject* pain
tingRootForRenderer, PaintLayerFlags, ClipState); | 44 void paintFragmentWithPhase(PaintPhase, const LayerFragment&, GraphicsContex
t*, const ClipRect&, const LayerPaintingInfo&, PaintBehavior, RenderObject* pain
tingRootForRenderer, PaintLayerFlags, ClipState); |
| 43 void paintBackgroundForFragments(const LayerFragments&, GraphicsContext*, | 45 void paintBackgroundForFragments(const LayerFragments&, GraphicsContext*, |
| 44 const LayoutRect& transparencyPaintDirtyRect, const LayerPaintingInfo&,
PaintBehavior, RenderObject* paintingRootForRenderer, PaintLayerFlags); | 46 const LayoutRect& transparencyPaintDirtyRect, const LayerPaintingInfo&,
PaintBehavior, RenderObject* paintingRootForRenderer, PaintLayerFlags); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 56 // Returns whether this layer should be painted during sofware painting (i.e
., not via calls from CompositedLayerMapping to draw into composited | 58 // Returns whether this layer should be painted during sofware painting (i.e
., not via calls from CompositedLayerMapping to draw into composited |
| 57 // layers). | 59 // layers). |
| 58 bool shouldPaintLayerInSoftwareMode(const LayerPaintingInfo&, PaintLayerFlag
s paintFlags); | 60 bool shouldPaintLayerInSoftwareMode(const LayerPaintingInfo&, PaintLayerFlag
s paintFlags); |
| 59 | 61 |
| 60 RenderLayer& m_renderLayer; | 62 RenderLayer& m_renderLayer; |
| 61 }; | 63 }; |
| 62 | 64 |
| 63 } // namespace blink | 65 } // namespace blink |
| 64 | 66 |
| 65 #endif // LayerPainter_h | 67 #endif // LayerPainter_h |
| OLD | NEW |