Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Side by Side Diff: Source/core/paint/BoxPainter.h

Issue 559733005: Move painting code from RenderBoxModelObject into BoxPainter. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 void paintFillLayerExtended(const PaintInfo&, const Color&, const FillLayer& , const LayoutRect&, BackgroundBleedAvoidance, InlineFlowBox* = 0, const LayoutS ize& = LayoutSize(), CompositeOperator = CompositeSourceOver, RenderObject* back groundObject = 0, bool skipBaseColor = false);
29 void calculateBackgroundImageGeometry(const RenderLayerModelObject* paintCon tainer, const FillLayer&, const LayoutRect& paintRect, BackgroundImageGeometry&, RenderObject* = 0) const;
30 InterpolationQuality chooseInterpolationQuality(GraphicsContext*, Image*, co nst 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 void paintRootBackgroundColor(const PaintInfo&, const LayoutRect&, const Col or&);
38 RoundedRect backgroundRoundedRectAdjustedForBleedAvoidance(GraphicsContext*, const LayoutRect&, BackgroundBleedAvoidance, InlineFlowBox*, const LayoutSize&, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const;
39 RoundedRect getBackgroundRoundedRect(const LayoutRect&, InlineFlowBox*, Layo utUnit inlineBoxWidth, LayoutUnit inlineBoxHeight,
40 bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const;
41 bool isDocumentElementWithOpaqueBackground() const;
42 void applyBoxShadowForBackground(GraphicsContext*);
43 bool fixedBackgroundPaintsInLocalCoordinates() const;
44 IntSize calculateFillTileSize(const FillLayer&, const IntSize& scaledPositio ningAreaSize) const;
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698