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

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

Issue 564973002: Move a bunch more painting code out of RenderBoxModelObject and into BoxPainter. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Merged, made more things static. 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 | « no previous file | Source/core/paint/BoxPainter.cpp » ('j') | Source/core/rendering/RenderObject.h » ('J')
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 {
(...skipping 11 matching lines...) Expand all
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); 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); 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&); 30 static InterpolationQuality chooseInterpolationQuality(RenderBoxModelObject& , GraphicsContext*, Image*, const void*, const LayoutSize&);
31 static void clipRoundedInnerRect(GraphicsContext*, const LayoutRect&, const RoundedRect& clipRect); 31 static void clipRoundedInnerRect(GraphicsContext*, const LayoutRect&, const RoundedRect& clipRect);
32 static bool paintNinePieceImage(RenderBoxModelObject&, GraphicsContext*, con st LayoutRect&, const RenderStyle*, const NinePieceImage&, CompositeOperator = C ompositeSourceOver);
33 static void paintBorder(RenderBoxModelObject&, const PaintInfo&, const Layou tRect&, const RenderStyle*, BackgroundBleedAvoidance = BackgroundBleedNone, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true);
34 static void paintBoxShadow(const PaintInfo&, const LayoutRect&, const Render Style*, ShadowStyle, bool includeLogicalLeftEdge = true, bool includeLogicalRigh tEdge = true);
35 static bool shouldAntialiasLines(GraphicsContext*);
32 36
33 private: 37 private:
34 void paintBackground(const PaintInfo&, const LayoutRect&, const Color& backg roundColor, BackgroundBleedAvoidance = BackgroundBleedNone); 38 void paintBackground(const PaintInfo&, const LayoutRect&, const Color& backg roundColor, BackgroundBleedAvoidance = BackgroundBleedNone);
35 void paintRootBoxFillLayers(const PaintInfo&); 39 void paintRootBoxFillLayers(const PaintInfo&);
36 void paintFillLayer(const PaintInfo&, const Color&, const FillLayer&, const LayoutRect&, BackgroundBleedAvoidance, CompositeOperator, RenderObject* backgrou ndObject, bool skipBaseColor = false); 40 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&); 41 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 ); 42 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, 43 static RoundedRect getBackgroundRoundedRect(RenderObject&, const LayoutRect& , InlineFlowBox*, LayoutUnit inlineBoxWidth, LayoutUnit inlineBoxHeight,
40 bool includeLogicalLeftEdge, bool includeLogicalRightEdge); 44 bool includeLogicalLeftEdge, bool includeLogicalRightEdge);
41 static bool isDocumentElementWithOpaqueBackground(RenderObject&); 45 static bool isDocumentElementWithOpaqueBackground(RenderObject&);
42 static void applyBoxShadowForBackground(GraphicsContext*, RenderObject&); 46 static void applyBoxShadowForBackground(GraphicsContext*, RenderObject&);
43 static bool fixedBackgroundPaintsInLocalCoordinates(const RenderObject&); 47 static bool fixedBackgroundPaintsInLocalCoordinates(const RenderObject&);
44 static IntSize calculateFillTileSize(const RenderBoxModelObject&, const Fill Layer&, const IntSize& scaledPositioningAreaSize); 48 static IntSize calculateFillTileSize(const RenderBoxModelObject&, const Fill Layer&, const IntSize& scaledPositioningAreaSize);
49 static void paintTranslucentBorderSides(RenderObject&, GraphicsContext*, con st RenderStyle*, const RoundedRect& outerBorder, const RoundedRect& innerBorder, const IntPoint& innerBorderAdjustment,
50 const BorderEdge[], BorderEdgeFlags, BackgroundBleedAvoidance, bool incl udeLogicalLeftEdge, bool includeLogicalRightEdge, bool antialias = false);
51 static LayoutRect borderInnerRectAdjustedForBleedAvoidance(GraphicsContext*, const LayoutRect&, BackgroundBleedAvoidance);
52 static void paintOneBorderSide(RenderObject&, GraphicsContext*, const Render Style*, const RoundedRect& outerBorder, const RoundedRect& innerBorder,
53 const IntRect& sideRect, BoxSide, BoxSide adjacentSide1, BoxSide adjacen tSide2, const BorderEdge[],
54 const Path*, BackgroundBleedAvoidance, bool includeLogicalLeftEdge, bool includeLogicalRightEdge, bool antialias, const Color* overrideColor = 0);
55 static void paintBorderSides(RenderObject&, GraphicsContext*, const RenderSt yle*, const RoundedRect& outerBorder, const RoundedRect& innerBorder,
56 const IntPoint& innerBorderAdjustment, const BorderEdge[], BorderEdgeFla gs, BackgroundBleedAvoidance,
57 bool includeLogicalLeftEdge, bool includeLogicalRightEdge, bool antialia s = false, const Color* overrideColor = 0);
58 static void drawBoxSideFromPath(GraphicsContext*, const LayoutRect&, const P ath&, const BorderEdge[],
59 float thickness, float drawThickness, BoxSide, const RenderStyle*,
60 Color, EBorderStyle, BackgroundBleedAvoidance, bool includeLogicalLeftEd ge, bool includeLogicalRightEdge);
61 static void clipBorderSidePolygon(GraphicsContext*, const RoundedRect& outer Border, const RoundedRect& innerBorder,
62 BoxSide, bool firstEdgeMatches, bool secondEdgeMatches);
63 static void clipBorderSideForComplexInnerPath(GraphicsContext*, const Rounde dRect&, const RoundedRect&, BoxSide, const BorderEdge[]);
45 64
46 // FIXME: this should be const. 65 // FIXME: this should be const.
47 RenderBox& m_renderBox; 66 RenderBox& m_renderBox;
48 }; 67 };
49 68
50 } // namespace blink 69 } // namespace blink
51 70
52 #endif 71 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/paint/BoxPainter.cpp » ('j') | Source/core/rendering/RenderObject.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698