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

Side by Side Diff: Source/core/rendering/RenderBoxModelObject.h

Issue 381473002: Use reference for FillLayer if possible (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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/rendering/RenderBox.cpp ('k') | Source/core/rendering/RenderBoxModelObject.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 /* 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 bool hasInlineDirectionBordersPaddingOrMargin() const { return hasInlineDire ctionBordersOrPadding() || marginStart()|| marginEnd(); } 150 bool hasInlineDirectionBordersPaddingOrMargin() const { return hasInlineDire ctionBordersOrPadding() || marginStart()|| marginEnd(); }
151 bool hasInlineDirectionBordersOrPadding() const { return borderStart() || bo rderEnd() || paddingStart()|| paddingEnd(); } 151 bool hasInlineDirectionBordersOrPadding() const { return borderStart() || bo rderEnd() || paddingStart()|| paddingEnd(); }
152 152
153 virtual LayoutUnit containingBlockLogicalWidthForContent() const; 153 virtual LayoutUnit containingBlockLogicalWidthForContent() const;
154 154
155 virtual void childBecameNonInline(RenderObject* /*child*/) { } 155 virtual void childBecameNonInline(RenderObject* /*child*/) { }
156 156
157 void paintBorder(const PaintInfo&, const LayoutRect&, const RenderStyle*, Ba ckgroundBleedAvoidance = BackgroundBleedNone, bool includeLogicalLeftEdge = true , bool includeLogicalRightEdge = true); 157 void paintBorder(const PaintInfo&, const LayoutRect&, const RenderStyle*, Ba ckgroundBleedAvoidance = BackgroundBleedNone, bool includeLogicalLeftEdge = true , bool includeLogicalRightEdge = true);
158 bool paintNinePieceImage(GraphicsContext*, const LayoutRect&, const RenderSt yle*, const NinePieceImage&, CompositeOperator = CompositeSourceOver); 158 bool paintNinePieceImage(GraphicsContext*, const LayoutRect&, const RenderSt yle*, const NinePieceImage&, CompositeOperator = CompositeSourceOver);
159 void paintBoxShadow(const PaintInfo&, const LayoutRect&, const RenderStyle*, ShadowStyle, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true); 159 void paintBoxShadow(const PaintInfo&, const LayoutRect&, const RenderStyle*, ShadowStyle, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true);
160 void paintFillLayerExtended(const PaintInfo&, const Color&, const FillLayer* , const LayoutRect&, BackgroundBleedAvoidance, InlineFlowBox* = 0, const LayoutS ize& = LayoutSize(), CompositeOperator = CompositeSourceOver, RenderObject* back groundObject = 0); 160 void paintFillLayerExtended(const PaintInfo&, const Color&, const FillLayer& , const LayoutRect&, BackgroundBleedAvoidance, InlineFlowBox* = 0, const LayoutS ize& = LayoutSize(), CompositeOperator = CompositeSourceOver, RenderObject* back groundObject = 0);
161 161
162 virtual bool boxShadowShouldBeAppliedToBackground(BackgroundBleedAvoidance, InlineFlowBox* = 0) const; 162 virtual bool boxShadowShouldBeAppliedToBackground(BackgroundBleedAvoidance, InlineFlowBox* = 0) const;
163 163
164 // Overridden by subclasses to determine line height and baseline position. 164 // Overridden by subclasses to determine line height and baseline position.
165 virtual LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositio nMode = PositionOnContainingLine) const = 0; 165 virtual LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositio nMode = PositionOnContainingLine) const = 0;
166 virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode , LinePositionMode = PositionOnContainingLine) const = 0; 166 virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode , LinePositionMode = PositionOnContainingLine) const = 0;
167 167
168 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) c onst OVERRIDE; 168 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) c onst OVERRIDE;
169 virtual const RenderObject* pushMappingToContainer(const RenderLayerModelObj ect* ancestorToStopAt, RenderGeometryMap&) const OVERRIDE; 169 virtual const RenderObject* pushMappingToContainer(const RenderLayerModelObj ect* ancestorToStopAt, RenderGeometryMap&) const OVERRIDE;
170 170
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 IntPoint m_destOrigin; 237 IntPoint m_destOrigin;
238 IntPoint m_phase; 238 IntPoint m_phase;
239 IntSize m_tileSize; 239 IntSize m_tileSize;
240 IntSize m_repeatSpacing; 240 IntSize m_repeatSpacing;
241 bool m_hasNonLocalGeometry; // Has background-attachment: fixed. Implies that we can't always cheaply compute destRect. 241 bool m_hasNonLocalGeometry; // Has background-attachment: fixed. Implies that we can't always cheaply compute destRect.
242 }; 242 };
243 243
244 LayoutPoint adjustedPositionRelativeToOffsetParent(const LayoutPoint&) const ; 244 LayoutPoint adjustedPositionRelativeToOffsetParent(const LayoutPoint&) const ;
245 245
246 bool calculateHasBoxDecorations() const; 246 bool calculateHasBoxDecorations() const;
247 void calculateBackgroundImageGeometry(const RenderLayerModelObject* paintCon tainer, const FillLayer*, const LayoutRect& paintRect, BackgroundImageGeometry&, RenderObject* = 0) const; 247 void calculateBackgroundImageGeometry(const RenderLayerModelObject* paintCon tainer, const FillLayer&, const LayoutRect& paintRect, BackgroundImageGeometry&, RenderObject* = 0) const;
248 void getBorderEdgeInfo(class BorderEdge[], const RenderStyle*, bool includeL ogicalLeftEdge = true, bool includeLogicalRightEdge = true) const; 248 void getBorderEdgeInfo(class BorderEdge[], const RenderStyle*, bool includeL ogicalLeftEdge = true, bool includeLogicalRightEdge = true) const;
249 bool borderObscuresBackgroundEdge(const FloatSize& contextScale) const; 249 bool borderObscuresBackgroundEdge(const FloatSize& contextScale) const;
250 bool borderObscuresBackground() const; 250 bool borderObscuresBackground() const;
251 RoundedRect backgroundRoundedRectAdjustedForBleedAvoidance(GraphicsContext*, const LayoutRect&, BackgroundBleedAvoidance, InlineFlowBox*, const LayoutSize&, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const; 251 RoundedRect backgroundRoundedRectAdjustedForBleedAvoidance(GraphicsContext*, const LayoutRect&, BackgroundBleedAvoidance, InlineFlowBox*, const LayoutSize&, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const;
252 LayoutRect borderInnerRectAdjustedForBleedAvoidance(GraphicsContext*, const LayoutRect&, BackgroundBleedAvoidance) const; 252 LayoutRect borderInnerRectAdjustedForBleedAvoidance(GraphicsContext*, const LayoutRect&, BackgroundBleedAvoidance) const;
253 253
254 InterpolationQuality chooseInterpolationQuality(GraphicsContext*, Image*, co nst void*, const LayoutSize&); 254 InterpolationQuality chooseInterpolationQuality(GraphicsContext*, Image*, co nst void*, const LayoutSize&);
255 255
256 RenderBoxModelObject* continuation() const; 256 RenderBoxModelObject* continuation() const;
257 void setContinuation(RenderBoxModelObject*); 257 void setContinuation(RenderBoxModelObject*);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 } 293 }
294 void moveChildrenTo(RenderBoxModelObject* toBoxModelObject, RenderObject* st artChild, RenderObject* endChild, RenderObject* beforeChild, bool fullRemoveInse rt = false); 294 void moveChildrenTo(RenderBoxModelObject* toBoxModelObject, RenderObject* st artChild, RenderObject* endChild, RenderObject* beforeChild, bool fullRemoveInse rt = false);
295 295
296 enum ScaleByEffectiveZoomOrNot { ScaleByEffectiveZoom, DoNotScaleByEffective Zoom }; 296 enum ScaleByEffectiveZoomOrNot { ScaleByEffectiveZoom, DoNotScaleByEffective Zoom };
297 IntSize calculateImageIntrinsicDimensions(StyleImage*, const IntSize& scaled PositioningAreaSize, ScaleByEffectiveZoomOrNot) const; 297 IntSize calculateImageIntrinsicDimensions(StyleImage*, const IntSize& scaled PositioningAreaSize, ScaleByEffectiveZoomOrNot) const;
298 298
299 private: 299 private:
300 LayoutUnit computedCSSPadding(const Length&) const; 300 LayoutUnit computedCSSPadding(const Length&) const;
301 virtual bool isBoxModelObject() const OVERRIDE FINAL { return true; } 301 virtual bool isBoxModelObject() const OVERRIDE FINAL { return true; }
302 302
303 IntSize calculateFillTileSize(const FillLayer*, const IntSize& scaledPositio ningAreaSize) const; 303 IntSize calculateFillTileSize(const FillLayer&, const IntSize& scaledPositio ningAreaSize) const;
304 304
305 RoundedRect getBackgroundRoundedRect(const LayoutRect&, InlineFlowBox*, Layo utUnit inlineBoxWidth, LayoutUnit inlineBoxHeight, 305 RoundedRect getBackgroundRoundedRect(const LayoutRect&, InlineFlowBox*, Layo utUnit inlineBoxWidth, LayoutUnit inlineBoxHeight,
306 bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const; 306 bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const;
307 307
308 bool fixedBackgroundPaintsInLocalCoordinates() const; 308 bool fixedBackgroundPaintsInLocalCoordinates() const;
309 309
310 void clipBorderSidePolygon(GraphicsContext*, const RoundedRect& outerBorder, const RoundedRect& innerBorder, 310 void clipBorderSidePolygon(GraphicsContext*, const RoundedRect& outerBorder, const RoundedRect& innerBorder,
311 BoxSide, bool firstEdgeMatches, bool secondEdgeMa tches); 311 BoxSide, bool firstEdgeMatches, bool secondEdgeMa tches);
312 void clipBorderSideForComplexInnerPath(GraphicsContext*, const RoundedRect&, const RoundedRect&, BoxSide, const class BorderEdge[]); 312 void clipBorderSideForComplexInnerPath(GraphicsContext*, const RoundedRect&, const RoundedRect&, BoxSide, const class BorderEdge[]);
313 void paintOneBorderSide(GraphicsContext*, const RenderStyle*, const RoundedR ect& outerBorder, const RoundedRect& innerBorder, 313 void paintOneBorderSide(GraphicsContext*, const RenderStyle*, const RoundedR ect& outerBorder, const RoundedRect& innerBorder,
314 const IntRect& sideRect, BoxSide, BoxSide adjace ntSide1, BoxSide adjacentSide2, const class BorderEdge[], 314 const IntRect& sideRect, BoxSide, BoxSide adjace ntSide1, BoxSide adjacentSide2, const class BorderEdge[],
315 const Path*, BackgroundBleedAvoidance, bool incl udeLogicalLeftEdge, bool includeLogicalRightEdge, bool antialias, const Color* o verrideColor = 0); 315 const Path*, BackgroundBleedAvoidance, bool incl udeLogicalLeftEdge, bool includeLogicalRightEdge, bool antialias, const Color* o verrideColor = 0);
316 void paintTranslucentBorderSides(GraphicsContext*, const RenderStyle*, const RoundedRect& outerBorder, const RoundedRect& innerBorder, const IntPoint& inner BorderAdjustment, 316 void paintTranslucentBorderSides(GraphicsContext*, const RenderStyle*, const RoundedRect& outerBorder, const RoundedRect& innerBorder, const IntPoint& inner BorderAdjustment,
317 const class BorderEdge[], BorderEdgeFlags, BackgroundBleedAvoidance, boo l includeLogicalLeftEdge, bool includeLogicalRightEdge, bool antialias = false); 317 const class BorderEdge[], BorderEdgeFlags, BackgroundBleedAvoidance, boo l includeLogicalLeftEdge, bool includeLogicalRightEdge, bool antialias = false);
318 void paintBorderSides(GraphicsContext*, const RenderStyle*, const RoundedRec t& outerBorder, const RoundedRect& innerBorder, 318 void paintBorderSides(GraphicsContext*, const RenderStyle*, const RoundedRec t& outerBorder, const RoundedRect& innerBorder,
319 const IntPoint& innerBorderAdjustment, const class BorderEdge[], BorderE dgeFlags, BackgroundBleedAvoidance, 319 const IntPoint& innerBorderAdjustment, const class BorderEdge[], BorderE dgeFlags, BackgroundBleedAvoidance,
320 bool includeLogicalLeftEdge, bool includeLogicalRightEdge, bool antialia s = false, const Color* overrideColor = 0); 320 bool includeLogicalLeftEdge, bool includeLogicalRightEdge, bool antialia s = false, const Color* overrideColor = 0);
321 void drawBoxSideFromPath(GraphicsContext*, const LayoutRect&, const Path&, c onst class BorderEdge[], 321 void drawBoxSideFromPath(GraphicsContext*, const LayoutRect&, const Path&, c onst class BorderEdge[],
322 float thickness, float drawThickness, BoxSide, const RenderStyle*, 322 float thickness, float drawThickness, BoxSide, const RenderStyle*,
323 Color, EBorderStyle, BackgroundBleedAvoidance, bool includeLogicalLeftEdge, bool includeLogicalRightEdge); 323 Color, EBorderStyle, BackgroundBleedAvoidance, bool includeLogicalLeftEdge, bool includeLogicalRightEdge);
324 }; 324 };
325 325
326 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBoxModelObject, isBoxModelObject()); 326 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBoxModelObject, isBoxModelObject());
327 327
328 } // namespace WebCore 328 } // namespace WebCore
329 329
330 #endif // RenderBoxModelObject_h 330 #endif // RenderBoxModelObject_h
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBox.cpp ('k') | Source/core/rendering/RenderBoxModelObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698