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 BoxPainter_h | 5 #ifndef BoxPainter_h |
6 #define BoxPainter_h | 6 #define BoxPainter_h |
7 | 7 |
8 #include "core/rendering/RenderBoxModelObject.h" | 8 #include "core/rendering/RenderBoxModelObject.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
11 | 11 |
12 class LayoutPoint; | 12 class LayoutPoint; |
13 struct PaintInfo; | 13 struct PaintInfo; |
14 class RenderBox; | 14 class RenderBox; |
15 class RenderObject; | 15 class RenderObject; |
16 | 16 |
17 class BoxPainter { | 17 class BoxPainter { |
18 public: | 18 public: |
19 BoxPainter(RenderBox& renderBox) : m_renderBox(renderBox) { } | 19 BoxPainter(RenderBox& renderBox) : m_renderBox(renderBox) { } |
20 void paint(PaintInfo&, const LayoutPoint&); | 20 void paint(PaintInfo&, const LayoutPoint&); |
21 | 21 |
22 void paintBoxDecorationBackground(PaintInfo&, const LayoutPoint&); | 22 void paintBoxDecorationBackground(PaintInfo&, const LayoutPoint&); |
23 void paintMask(PaintInfo&, const LayoutPoint&); | 23 void paintMask(PaintInfo&, const LayoutPoint&); |
24 void paintClippingMask(PaintInfo&, const LayoutPoint&); | 24 void paintClippingMask(PaintInfo&, const LayoutPoint&); |
25 void paintFillLayers(const PaintInfo&, const Color&, const FillLayer&, const LayoutRect&, BackgroundBleedAvoidance = BackgroundBleedNone, CompositeOperator = CompositeSourceOver, RenderObject* backgroundObject = 0); | 25 void paintFillLayers(const PaintInfo&, const Color&, const FillLayer&, const LayoutRect&, BackgroundBleedAvoidance = BackgroundBleedNone, CompositeOperator = CompositeSourceOver, RenderObject* backgroundObject = 0); |
26 void paintMaskImages(const PaintInfo&, const LayoutRect&); | 26 void paintMaskImages(const PaintInfo&, const LayoutRect&); |
27 void paintBoxDecorationBackgroundWithRect(PaintInfo&, const LayoutPoint&, co nst LayoutRect&); | 27 void paintBoxDecorationBackgroundWithRect(PaintInfo&, const LayoutPoint&, co nst LayoutRect&); |
28 static void paintFillLayerExtended(RenderBoxModelObject&, const PaintInfo&, const Color&, const FillLayer&, const LayoutRect&, BackgroundBleedAvoidance, Inl ineFlowBox* = 0, const LayoutSize& = LayoutSize(), CompositeOperator = Composite SourceOver, RenderObject* backgroundObject = 0, bool skipBaseColor = false); | |
pdr.
2014/09/11 23:28:06
Should all of these be const?
chrishtr
2014/09/11 23:40:19
I was able to make one of them const.
| |
29 static void calculateBackgroundImageGeometry(RenderBoxModelObject&, const Re nderLayerModelObject* paintContainer, const FillLayer&, const LayoutRect& paintR ect, BackgroundImageGeometry&, RenderObject* = 0); | |
30 static InterpolationQuality chooseInterpolationQuality(RenderBoxModelObject& , GraphicsContext*, Image*, const void*, const LayoutSize&); | |
31 static void clipRoundedInnerRect(GraphicsContext*, const LayoutRect&, const RoundedRect& clipRect); | |
28 | 32 |
29 private: | 33 private: |
30 void paintBackground(const PaintInfo&, const LayoutRect&, const Color& backg roundColor, BackgroundBleedAvoidance = BackgroundBleedNone); | 34 void paintBackground(const PaintInfo&, const LayoutRect&, const Color& backg roundColor, BackgroundBleedAvoidance = BackgroundBleedNone); |
31 void paintRootBoxFillLayers(const PaintInfo&); | 35 void paintRootBoxFillLayers(const PaintInfo&); |
32 void paintFillLayer(const PaintInfo&, const Color&, const FillLayer&, const LayoutRect&, BackgroundBleedAvoidance, CompositeOperator, RenderObject* backgrou ndObject, bool skipBaseColor = false); | 36 void paintFillLayer(const PaintInfo&, const Color&, const FillLayer&, const LayoutRect&, BackgroundBleedAvoidance, CompositeOperator, RenderObject* backgrou ndObject, bool skipBaseColor = false); |
37 static void paintRootBackgroundColor(RenderObject&, const PaintInfo&, const LayoutRect&, const Color&); | |
38 static RoundedRect backgroundRoundedRectAdjustedForBleedAvoidance(RenderObje ct&, GraphicsContext*, const LayoutRect&, BackgroundBleedAvoidance, InlineFlowBo x*, const LayoutSize&, bool includeLogicalLeftEdge, bool includeLogicalRightEdge ); | |
39 static RoundedRect getBackgroundRoundedRect(RenderObject&, const LayoutRect& , InlineFlowBox*, LayoutUnit inlineBoxWidth, LayoutUnit inlineBoxHeight, | |
40 bool includeLogicalLeftEdge, bool includeLogicalRightEdge); | |
41 static bool isDocumentElementWithOpaqueBackground(RenderObject&); | |
42 static void applyBoxShadowForBackground(GraphicsContext*, RenderObject&); | |
43 static bool fixedBackgroundPaintsInLocalCoordinates(RenderObject&); | |
44 static IntSize calculateFillTileSize(RenderBoxModelObject&, const FillLayer& , const IntSize& scaledPositioningAreaSize); | |
33 | 45 |
34 // FIXME: this should be const. | 46 // FIXME: this should be const. |
35 RenderBox& m_renderBox; | 47 RenderBox& m_renderBox; |
36 }; | 48 }; |
37 | 49 |
38 } // namespace blink | 50 } // namespace blink |
39 | 51 |
40 #endif | 52 #endif |
OLD | NEW |