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

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

Issue 305883002: Switch arguments to const Length references for performance (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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/rendering/RenderBox.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 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 LayoutUnit intrinsicLogicalWidth() const { return style()->isHorizontalWriti ngMode() ? intrinsicSize().width() : intrinsicSize().height(); } 433 LayoutUnit intrinsicLogicalWidth() const { return style()->isHorizontalWriti ngMode() ? intrinsicSize().width() : intrinsicSize().height(); }
434 LayoutUnit intrinsicLogicalHeight() const { return style()->isHorizontalWrit ingMode() ? intrinsicSize().height() : intrinsicSize().width(); } 434 LayoutUnit intrinsicLogicalHeight() const { return style()->isHorizontalWrit ingMode() ? intrinsicSize().height() : intrinsicSize().width(); }
435 virtual LayoutUnit intrinsicContentLogicalHeight() const { return m_intrinsi cContentLogicalHeight; } 435 virtual LayoutUnit intrinsicContentLogicalHeight() const { return m_intrinsi cContentLogicalHeight; }
436 436
437 // Whether or not the element shrinks to its intrinsic width (rather than fi lling the width 437 // Whether or not the element shrinks to its intrinsic width (rather than fi lling the width
438 // of a containing block). HTML4 buttons, <select>s, <input>s, legends, and floating/compact elements do this. 438 // of a containing block). HTML4 buttons, <select>s, <input>s, legends, and floating/compact elements do this.
439 bool sizesLogicalWidthToFitContent(const Length& logicalWidth) const; 439 bool sizesLogicalWidthToFitContent(const Length& logicalWidth) const;
440 440
441 LayoutUnit shrinkLogicalWidthToAvoidFloats(LayoutUnit childMarginStart, Layo utUnit childMarginEnd, const RenderBlockFlow* cb) const; 441 LayoutUnit shrinkLogicalWidthToAvoidFloats(LayoutUnit childMarginStart, Layo utUnit childMarginEnd, const RenderBlockFlow* cb) const;
442 442
443 LayoutUnit computeLogicalWidthUsing(SizeType, Length logicalWidth, LayoutUni t availableLogicalWidth, const RenderBlock* containingBlock) const; 443 LayoutUnit computeLogicalWidthUsing(SizeType, const Length& logicalWidth, La youtUnit availableLogicalWidth, const RenderBlock* containingBlock) const;
444 LayoutUnit computeLogicalHeightUsing(const Length& height, LayoutUnit intrin sicContentHeight) const; 444 LayoutUnit computeLogicalHeightUsing(const Length& height, LayoutUnit intrin sicContentHeight) const;
445 LayoutUnit computeContentLogicalHeight(const Length& height, LayoutUnit intr insicContentHeight) const; 445 LayoutUnit computeContentLogicalHeight(const Length& height, LayoutUnit intr insicContentHeight) const;
446 LayoutUnit computeContentAndScrollbarLogicalHeightUsing(const Length& height , LayoutUnit intrinsicContentHeight) const; 446 LayoutUnit computeContentAndScrollbarLogicalHeightUsing(const Length& height , LayoutUnit intrinsicContentHeight) const;
447 LayoutUnit computeReplacedLogicalWidthUsing(Length width) const; 447 LayoutUnit computeReplacedLogicalWidthUsing(const Length& width) const;
448 LayoutUnit computeReplacedLogicalWidthRespectingMinMaxWidth(LayoutUnit logic alWidth, ShouldComputePreferred = ComputeActual) const; 448 LayoutUnit computeReplacedLogicalWidthRespectingMinMaxWidth(LayoutUnit logic alWidth, ShouldComputePreferred = ComputeActual) const;
449 LayoutUnit computeReplacedLogicalHeightUsing(Length height) const; 449 LayoutUnit computeReplacedLogicalHeightUsing(const Length& height) const;
450 LayoutUnit computeReplacedLogicalHeightRespectingMinMaxHeight(LayoutUnit log icalHeight) const; 450 LayoutUnit computeReplacedLogicalHeightRespectingMinMaxHeight(LayoutUnit log icalHeight) const;
451 451
452 virtual LayoutUnit computeReplacedLogicalWidth(ShouldComputePreferred = Com puteActual) const; 452 virtual LayoutUnit computeReplacedLogicalWidth(ShouldComputePreferred = Com puteActual) const;
453 virtual LayoutUnit computeReplacedLogicalHeight() const; 453 virtual LayoutUnit computeReplacedLogicalHeight() const;
454 454
455 static bool percentageLogicalHeightIsResolvableFromBlock(const RenderBlock* containingBlock, bool outOfFlowPositioned); 455 static bool percentageLogicalHeightIsResolvableFromBlock(const RenderBlock* containingBlock, bool outOfFlowPositioned);
456 LayoutUnit computePercentageLogicalHeight(const Length& height) const; 456 LayoutUnit computePercentageLogicalHeight(const Length& height) const;
457 457
458 // Block flows subclass availableWidth/Height to handle multi column layout (shrinking the width/height available to children when laying out.) 458 // Block flows subclass availableWidth/Height to handle multi column layout (shrinking the width/height available to children when laying out.)
459 virtual LayoutUnit availableLogicalWidth() const { return contentLogicalWidt h(); } 459 virtual LayoutUnit availableLogicalWidth() const { return contentLogicalWidt h(); }
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 void paintFillLayers(const PaintInfo&, const Color&, const FillLayer*, const LayoutRect&, BackgroundBleedAvoidance = BackgroundBleedNone, CompositeOperator = CompositeSourceOver, RenderObject* backgroundObject = 0); 640 void paintFillLayers(const PaintInfo&, const Color&, const FillLayer*, const LayoutRect&, BackgroundBleedAvoidance = BackgroundBleedNone, CompositeOperator = CompositeSourceOver, RenderObject* backgroundObject = 0);
641 641
642 void paintMaskImages(const PaintInfo&, const LayoutRect&); 642 void paintMaskImages(const PaintInfo&, const LayoutRect&);
643 void paintBoxDecorationsWithRect(PaintInfo&, const LayoutPoint&, const Layou tRect&); 643 void paintBoxDecorationsWithRect(PaintInfo&, const LayoutPoint&, const Layou tRect&);
644 644
645 BackgroundBleedAvoidance determineBackgroundBleedAvoidance(GraphicsContext*) const; 645 BackgroundBleedAvoidance determineBackgroundBleedAvoidance(GraphicsContext*) const;
646 bool backgroundHasOpaqueTopLayer() const; 646 bool backgroundHasOpaqueTopLayer() const;
647 647
648 void computePositionedLogicalWidth(LogicalExtentComputedValues&) const; 648 void computePositionedLogicalWidth(LogicalExtentComputedValues&) const;
649 649
650 LayoutUnit computeIntrinsicLogicalWidthUsing(Length logicalWidthLength, Layo utUnit availableLogicalWidth, LayoutUnit borderAndPadding) const; 650 LayoutUnit computeIntrinsicLogicalWidthUsing(const Length& logicalWidthLengt h, LayoutUnit availableLogicalWidth, LayoutUnit borderAndPadding) const;
651 LayoutUnit computeIntrinsicLogicalContentHeightUsing(Length logicalHeightLen gth, LayoutUnit intrinsicContentHeight, LayoutUnit borderAndPadding) const; 651 LayoutUnit computeIntrinsicLogicalContentHeightUsing(const Length& logicalHe ightLength, LayoutUnit intrinsicContentHeight, LayoutUnit borderAndPadding) cons t;
652 652
653 virtual bool shouldComputeSizeAsReplaced() const { return isReplaced() && !i sInlineBlockOrInlineTable(); } 653 virtual bool shouldComputeSizeAsReplaced() const { return isReplaced() && !i sInlineBlockOrInlineTable(); }
654 654
655 virtual void mapLocalToContainer(const RenderLayerModelObject* repaintContai ner, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed = 0) const OVERRIDE; 655 virtual void mapLocalToContainer(const RenderLayerModelObject* repaintContai ner, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed = 0) const OVERRIDE;
656 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) c onst OVERRIDE; 656 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) c onst OVERRIDE;
657 657
658 void paintRootBoxFillLayers(const PaintInfo&); 658 void paintRootBoxFillLayers(const PaintInfo&);
659 659
660 RenderObject* splitAnonymousBoxesAroundChild(RenderObject* beforeChild); 660 RenderObject* splitAnonymousBoxesAroundChild(RenderObject* beforeChild);
661 661
(...skipping 13 matching lines...) Expand all
675 bool repaintLayerRectsForImage(WrappedImagePtr image, const FillLayer* layer s, bool drawingBackground); 675 bool repaintLayerRectsForImage(WrappedImagePtr image, const FillLayer* layer s, bool drawingBackground);
676 676
677 bool skipContainingBlockForPercentHeightCalculation(const RenderBox* contain ingBlock) const; 677 bool skipContainingBlockForPercentHeightCalculation(const RenderBox* contain ingBlock) const;
678 678
679 LayoutUnit containingBlockLogicalWidthForPositioned(const RenderBoxModelObje ct* containingBlock, bool checkForPerpendicularWritingMode = true) const; 679 LayoutUnit containingBlockLogicalWidthForPositioned(const RenderBoxModelObje ct* containingBlock, bool checkForPerpendicularWritingMode = true) const;
680 LayoutUnit containingBlockLogicalHeightForPositioned(const RenderBoxModelObj ect* containingBlock, bool checkForPerpendicularWritingMode = true) const; 680 LayoutUnit containingBlockLogicalHeightForPositioned(const RenderBoxModelObj ect* containingBlock, bool checkForPerpendicularWritingMode = true) const;
681 681
682 void computePositionedLogicalHeight(LogicalExtentComputedValues&) const; 682 void computePositionedLogicalHeight(LogicalExtentComputedValues&) const;
683 void computePositionedLogicalWidthUsing(Length logicalWidth, const RenderBox ModelObject* containerBlock, TextDirection containerDirection, 683 void computePositionedLogicalWidthUsing(Length logicalWidth, const RenderBox ModelObject* containerBlock, TextDirection containerDirection,
684 LayoutUnit containerLogicalWidth, La youtUnit bordersPlusPadding, 684 LayoutUnit containerLogicalWidth, La youtUnit bordersPlusPadding,
685 Length logicalLeft, Length logicalRi ght, Length marginLogicalLeft, Length marginLogicalRight, 685 const Length& logicalLeft, const Len gth& logicalRight, const Length& marginLogicalLeft,
686 LogicalExtentComputedValues&) const; 686 const Length& marginLogicalRight, Lo gicalExtentComputedValues&) const;
687 void computePositionedLogicalHeightUsing(Length logicalHeightLength, const R enderBoxModelObject* containerBlock, 687 void computePositionedLogicalHeightUsing(Length logicalHeightLength, const R enderBoxModelObject* containerBlock,
688 LayoutUnit containerLogicalHeight, LayoutUnit bordersPlusPadding, LayoutUnit logicalHeight, 688 LayoutUnit containerLogicalHeight, LayoutUnit bordersPlusPadding, LayoutUnit logicalHeight,
689 Length logicalTop, Length logicalBo ttom, Length marginLogicalTop, Length marginLogicalBottom, 689 const Length& logicalTop, const Len gth& logicalBottom, const Length& marginLogicalTop,
690 LogicalExtentComputedValues&) const ; 690 const Length& marginLogicalBottom, LogicalExtentComputedValues&) const;
691 691
692 void computePositionedLogicalHeightReplaced(LogicalExtentComputedValues&) co nst; 692 void computePositionedLogicalHeightReplaced(LogicalExtentComputedValues&) co nst;
693 void computePositionedLogicalWidthReplaced(LogicalExtentComputedValues&) con st; 693 void computePositionedLogicalWidthReplaced(LogicalExtentComputedValues&) con st;
694 694
695 LayoutUnit fillAvailableMeasure(LayoutUnit availableLogicalWidth) const; 695 LayoutUnit fillAvailableMeasure(LayoutUnit availableLogicalWidth) const;
696 LayoutUnit fillAvailableMeasure(LayoutUnit availableLogicalWidth, LayoutUnit & marginStart, LayoutUnit& marginEnd) const; 696 LayoutUnit fillAvailableMeasure(LayoutUnit availableLogicalWidth, LayoutUnit & marginStart, LayoutUnit& marginEnd) const;
697 697
698 virtual void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, Layo utUnit& maxLogicalWidth) const; 698 virtual void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, Layo utUnit& maxLogicalWidth) const;
699 699
700 // This function calculates the minimum and maximum preferred widths for an object. 700 // This function calculates the minimum and maximum preferred widths for an object.
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
774 if (UNLIKELY(inlineBoxWrapper() != 0)) 774 if (UNLIKELY(inlineBoxWrapper() != 0))
775 deleteLineBoxWrapper(); 775 deleteLineBoxWrapper();
776 } 776 }
777 777
778 ensureRareData().m_inlineBoxWrapper = boxWrapper; 778 ensureRareData().m_inlineBoxWrapper = boxWrapper;
779 } 779 }
780 780
781 } // namespace WebCore 781 } // namespace WebCore
782 782
783 #endif // RenderBox_h 783 #endif // RenderBox_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/rendering/RenderBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698