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

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: Merged. 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
« no previous file with comments | « Source/core/paint/BackgroundImageGeometry.cpp ('k') | Source/core/paint/BoxPainter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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);
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(const RenderObject&);
44 static IntSize calculateFillTileSize(const RenderBoxModelObject&, const Fill Layer&, 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
OLDNEW
« no previous file with comments | « Source/core/paint/BackgroundImageGeometry.cpp ('k') | Source/core/paint/BoxPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698