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

Side by Side Diff: Source/core/rendering/RenderBoxModelObject.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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2003, 2006, 2007, 2009 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2006, 2007, 2009 Apple Inc. All rights reserved.
5 * Copyright (C) 2010 Google Inc. All rights reserved. 5 * Copyright (C) 2010 Google Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 LayoutUnit marginLogicalHeight() const { return marginBefore() + marginAfter (); } 149 LayoutUnit marginLogicalHeight() const { return marginBefore() + marginAfter (); }
150 LayoutUnit marginLogicalWidth() const { return marginStart() + marginEnd(); } 150 LayoutUnit marginLogicalWidth() const { return marginStart() + marginEnd(); }
151 151
152 bool hasInlineDirectionBordersPaddingOrMargin() const { return hasInlineDire ctionBordersOrPadding() || marginStart()|| marginEnd(); } 152 bool hasInlineDirectionBordersPaddingOrMargin() const { return hasInlineDire ctionBordersOrPadding() || marginStart()|| marginEnd(); }
153 bool hasInlineDirectionBordersOrPadding() const { return borderStart() || bo rderEnd() || paddingStart()|| paddingEnd(); } 153 bool hasInlineDirectionBordersOrPadding() const { return borderStart() || bo rderEnd() || paddingStart()|| paddingEnd(); }
154 154
155 virtual LayoutUnit containingBlockLogicalWidthForContent() const; 155 virtual LayoutUnit containingBlockLogicalWidthForContent() const;
156 156
157 virtual void childBecameNonInline(RenderObject* /*child*/) { } 157 virtual void childBecameNonInline(RenderObject* /*child*/) { }
158 158
159 void paintBorder(const PaintInfo&, const LayoutRect&, const RenderStyle*, Ba ckgroundBleedAvoidance = BackgroundBleedNone, bool includeLogicalLeftEdge = true , bool includeLogicalRightEdge = true);
160 bool paintNinePieceImage(GraphicsContext*, const LayoutRect&, const RenderSt yle*, const NinePieceImage&, CompositeOperator = CompositeSourceOver);
161 void paintBoxShadow(const PaintInfo&, const LayoutRect&, const RenderStyle*, ShadowStyle, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true);
162
163 virtual bool boxShadowShouldBeAppliedToBackground(BackgroundBleedAvoidance, InlineFlowBox* = 0) const; 159 virtual bool boxShadowShouldBeAppliedToBackground(BackgroundBleedAvoidance, InlineFlowBox* = 0) const;
164 160
165 // Overridden by subclasses to determine line height and baseline position. 161 // Overridden by subclasses to determine line height and baseline position.
166 virtual LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositio nMode = PositionOnContainingLine) const = 0; 162 virtual LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositio nMode = PositionOnContainingLine) const = 0;
167 virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode , LinePositionMode = PositionOnContainingLine) const = 0; 163 virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode , LinePositionMode = PositionOnContainingLine) const = 0;
168 164
169 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) c onst OVERRIDE; 165 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) c onst OVERRIDE;
170 virtual const RenderObject* pushMappingToContainer(const RenderLayerModelObj ect* ancestorToStopAt, RenderGeometryMap&) const OVERRIDE; 166 virtual const RenderObject* pushMappingToContainer(const RenderLayerModelObj ect* ancestorToStopAt, RenderGeometryMap&) const OVERRIDE;
171 167
172 virtual void setSelectionState(SelectionState) OVERRIDE; 168 virtual void setSelectionState(SelectionState) OVERRIDE;
173 169
174 void contentChanged(ContentChangeType); 170 void contentChanged(ContentChangeType);
175 bool hasAcceleratedCompositing() const; 171 bool hasAcceleratedCompositing() const;
176 172
177 virtual void computeLayerHitTestRects(LayerHitTestRects&) const OVERRIDE; 173 virtual void computeLayerHitTestRects(LayerHitTestRects&) const OVERRIDE;
178 174
179 protected: 175 protected:
180 virtual void willBeDestroyed() OVERRIDE; 176 virtual void willBeDestroyed() OVERRIDE;
181 177
182 LayoutPoint adjustedPositionRelativeToOffsetParent(const LayoutPoint&) const ; 178 LayoutPoint adjustedPositionRelativeToOffsetParent(const LayoutPoint&) const ;
183 179
184 bool calculateHasBoxDecorations() const; 180 bool calculateHasBoxDecorations() const;
185 LayoutRect borderInnerRectAdjustedForBleedAvoidance(GraphicsContext*, const LayoutRect&, BackgroundBleedAvoidance) const;
186 181
187 RenderBoxModelObject* continuation() const; 182 RenderBoxModelObject* continuation() const;
188 void setContinuation(RenderBoxModelObject*); 183 void setContinuation(RenderBoxModelObject*);
189 184
190 LayoutRect localCaretRectForEmptyElement(LayoutUnit width, LayoutUnit textIn dentOffset); 185 LayoutRect localCaretRectForEmptyElement(LayoutUnit width, LayoutUnit textIn dentOffset);
191 186
192 bool hasAutoHeightOrContainingBlockWithAutoHeight() const; 187 bool hasAutoHeightOrContainingBlockWithAutoHeight() const;
193 188
194 public: 189 public:
195 static bool shouldAntialiasLines(GraphicsContext*);
196 190
197 // For RenderBlocks and RenderInlines with m_style->styleType() == FIRST_LET TER, this tracks their remaining text fragments 191 // For RenderBlocks and RenderInlines with m_style->styleType() == FIRST_LET TER, this tracks their remaining text fragments
198 RenderTextFragment* firstLetterRemainingText() const; 192 RenderTextFragment* firstLetterRemainingText() const;
199 void setFirstLetterRemainingText(RenderTextFragment*); 193 void setFirstLetterRemainingText(RenderTextFragment*);
200 194
201 // These functions are only used internally to manipulate the render tree st ructure via remove/insert/appendChildNode. 195 // These functions are only used internally to manipulate the render tree st ructure via remove/insert/appendChildNode.
202 // Since they are typically called only to move objects around within anonym ous blocks (which only have layers in 196 // Since they are typically called only to move objects around within anonym ous blocks (which only have layers in
203 // the case of column spans), the default for fullRemoveInsert is false rath er than true. 197 // the case of column spans), the default for fullRemoveInsert is false rath er than true.
204 void moveChildTo(RenderBoxModelObject* toBoxModelObject, RenderObject* child , RenderObject* beforeChild, bool fullRemoveInsert = false); 198 void moveChildTo(RenderBoxModelObject* toBoxModelObject, RenderObject* child , RenderObject* beforeChild, bool fullRemoveInsert = false);
205 void moveChildTo(RenderBoxModelObject* toBoxModelObject, RenderObject* child , bool fullRemoveInsert = false) 199 void moveChildTo(RenderBoxModelObject* toBoxModelObject, RenderObject* child , bool fullRemoveInsert = false)
(...skipping 15 matching lines...) Expand all
221 moveChildrenTo(toBoxModelObject, startChild, endChild, 0, fullRemoveInse rt); 215 moveChildrenTo(toBoxModelObject, startChild, endChild, 0, fullRemoveInse rt);
222 } 216 }
223 void moveChildrenTo(RenderBoxModelObject* toBoxModelObject, RenderObject* st artChild, RenderObject* endChild, RenderObject* beforeChild, bool fullRemoveInse rt = false); 217 void moveChildrenTo(RenderBoxModelObject* toBoxModelObject, RenderObject* st artChild, RenderObject* endChild, RenderObject* beforeChild, bool fullRemoveInse rt = false);
224 218
225 enum ScaleByEffectiveZoomOrNot { ScaleByEffectiveZoom, DoNotScaleByEffective Zoom }; 219 enum ScaleByEffectiveZoomOrNot { ScaleByEffectiveZoom, DoNotScaleByEffective Zoom };
226 IntSize calculateImageIntrinsicDimensions(StyleImage*, const IntSize& scaled PositioningAreaSize, ScaleByEffectiveZoomOrNot) const; 220 IntSize calculateImageIntrinsicDimensions(StyleImage*, const IntSize& scaled PositioningAreaSize, ScaleByEffectiveZoomOrNot) const;
227 221
228 private: 222 private:
229 LayoutUnit computedCSSPadding(const Length&) const; 223 LayoutUnit computedCSSPadding(const Length&) const;
230 virtual bool isBoxModelObject() const OVERRIDE FINAL { return true; } 224 virtual bool isBoxModelObject() const OVERRIDE FINAL { return true; }
231
232 void clipBorderSidePolygon(GraphicsContext*, const RoundedRect& outerBorder, const RoundedRect& innerBorder,
233 BoxSide, bool firstEdgeMatches, bool secondEdgeMa tches);
234 void clipBorderSideForComplexInnerPath(GraphicsContext*, const RoundedRect&, const RoundedRect&, BoxSide, const BorderEdge[]);
235 void paintOneBorderSide(GraphicsContext*, const RenderStyle*, const RoundedR ect& outerBorder, const RoundedRect& innerBorder,
236 const IntRect& sideRect, BoxSide, BoxSide adjacentSide1, BoxSide adjacen tSide2, const BorderEdge[],
237 const Path*, BackgroundBleedAvoidance, bool includeLogicalLeftEdge, bool includeLogicalRightEdge, bool antialias, const Color* overrideColor = 0);
238 void paintTranslucentBorderSides(GraphicsContext*, const RenderStyle*, const RoundedRect& outerBorder, const RoundedRect& innerBorder, const IntPoint& inner BorderAdjustment,
239 const BorderEdge[], BorderEdgeFlags, BackgroundBleedAvoidance, bool incl udeLogicalLeftEdge, bool includeLogicalRightEdge, bool antialias = false);
240 void paintBorderSides(GraphicsContext*, const RenderStyle*, const RoundedRec t& outerBorder, const RoundedRect& innerBorder,
241 const IntPoint& innerBorderAdjustment, const BorderEdge[], BorderEdgeFla gs, BackgroundBleedAvoidance,
242 bool includeLogicalLeftEdge, bool includeLogicalRightEdge, bool antialia s = false, const Color* overrideColor = 0);
243 void drawBoxSideFromPath(GraphicsContext*, const LayoutRect&, const Path&, c onst BorderEdge[],
244 float thickness, float drawThickness, BoxSide, const RenderStyle*,
245 Color, EBorderStyle, BackgroundBleedAvoidance, bool includeLogicalLeftEdge, bool includeLogicalRightEdge);
246 }; 225 };
247 226
248 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBoxModelObject, isBoxModelObject()); 227 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBoxModelObject, isBoxModelObject());
249 228
250 } // namespace blink 229 } // namespace blink
251 230
252 #endif // RenderBoxModelObject_h 231 #endif // RenderBoxModelObject_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698