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

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

Issue 18133003: Get rid of the extra vector when setting up the orderIterator. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 | « no previous file | Source/core/rendering/RenderFlexibleBox.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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 class OrderIterator { 77 class OrderIterator {
78 WTF_MAKE_NONCOPYABLE(OrderIterator); 78 WTF_MAKE_NONCOPYABLE(OrderIterator);
79 public: 79 public:
80 OrderIterator(const RenderFlexibleBox*); 80 OrderIterator(const RenderFlexibleBox*);
81 void setOrderValues(Vector<int>&); 81 void setOrderValues(Vector<int>&);
82 RenderBox* currentChild() const { return m_currentChild; } 82 RenderBox* currentChild() const { return m_currentChild; }
83 RenderBox* first(); 83 RenderBox* first();
84 RenderBox* next(); 84 RenderBox* next();
85 void reset(); 85 void reset();
86 86
87 Vector<int> m_orderValues;
88
87 private: 89 private:
88 const RenderFlexibleBox* m_flexibleBox; 90 const RenderFlexibleBox* m_flexibleBox;
89 RenderBox* m_currentChild; 91 RenderBox* m_currentChild;
90 Vector<int> m_orderValues;
91 Vector<int>::const_iterator m_orderValuesIterator; 92 Vector<int>::const_iterator m_orderValuesIterator;
92 }; 93 };
93 94
94 typedef HashMap<const RenderBox*, LayoutUnit> InflexibleFlexItemSize; 95 typedef HashMap<const RenderBox*, LayoutUnit> InflexibleFlexItemSize;
95 typedef Vector<RenderBox*> OrderedFlexItemList; 96 typedef Vector<RenderBox*> OrderedFlexItemList;
96 97
97 struct LineContext; 98 struct LineContext;
98 struct Violation; 99 struct Violation;
99 100
100 // Use an inline capacity of 8, since flexbox containers usually have less t han 8 children. 101 // Use an inline capacity of 8, since flexbox containers usually have less t han 8 children.
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 bool updateAutoMarginsInCrossAxis(RenderBox* child, LayoutUnit availableAlig nmentSpace); 145 bool updateAutoMarginsInCrossAxis(RenderBox* child, LayoutUnit availableAlig nmentSpace);
145 void repositionLogicalHeightDependentFlexItems(Vector<LineContext>&); 146 void repositionLogicalHeightDependentFlexItems(Vector<LineContext>&);
146 LayoutUnit clientLogicalBottomAfterRepositioning(); 147 LayoutUnit clientLogicalBottomAfterRepositioning();
147 void appendChildFrameRects(ChildFrameRects&); 148 void appendChildFrameRects(ChildFrameRects&);
148 void repaintChildrenDuringLayoutIfMoved(const ChildFrameRects&); 149 void repaintChildrenDuringLayoutIfMoved(const ChildFrameRects&);
149 150
150 LayoutUnit availableAlignmentSpaceForChild(LayoutUnit lineCrossAxisExtent, R enderBox*); 151 LayoutUnit availableAlignmentSpaceForChild(LayoutUnit lineCrossAxisExtent, R enderBox*);
151 LayoutUnit marginBoxAscentForChild(RenderBox*); 152 LayoutUnit marginBoxAscentForChild(RenderBox*);
152 153
153 LayoutUnit computeChildMarginValue(Length margin, RenderView*); 154 LayoutUnit computeChildMarginValue(Length margin, RenderView*);
154 void computeMainAxisPreferredSizes(Vector<int>&); 155 void prepareOrderIteratorAndMargins();
155 LayoutUnit adjustChildSizeForMinAndMax(RenderBox*, LayoutUnit childSize); 156 LayoutUnit adjustChildSizeForMinAndMax(RenderBox*, LayoutUnit childSize);
156 bool computeNextFlexLine(OrderedFlexItemList& orderedChildren, LayoutUnit& p referredMainAxisExtent, double& totalFlexGrow, double& totalWeightedFlexShrink, LayoutUnit& minMaxAppliedMainAxisExtent, bool& hasInfiniteLineLength); 157 bool computeNextFlexLine(OrderedFlexItemList& orderedChildren, LayoutUnit& p referredMainAxisExtent, double& totalFlexGrow, double& totalWeightedFlexShrink, LayoutUnit& minMaxAppliedMainAxisExtent, bool& hasInfiniteLineLength);
157 158
158 bool resolveFlexibleLengths(FlexSign, const OrderedFlexItemList&, LayoutUnit & availableFreeSpace, double& totalFlexGrow, double& totalWeightedFlexShrink, In flexibleFlexItemSize&, Vector<LayoutUnit>& childSizes, bool hasInfiniteLineLengt h); 159 bool resolveFlexibleLengths(FlexSign, const OrderedFlexItemList&, LayoutUnit & availableFreeSpace, double& totalFlexGrow, double& totalWeightedFlexShrink, In flexibleFlexItemSize&, Vector<LayoutUnit>& childSizes, bool hasInfiniteLineLengt h);
159 void freezeViolations(const Vector<Violation>&, LayoutUnit& availableFreeSpa ce, double& totalFlexGrow, double& totalWeightedFlexShrink, InflexibleFlexItemSi ze&, bool hasInfiniteLineLength); 160 void freezeViolations(const Vector<Violation>&, LayoutUnit& availableFreeSpa ce, double& totalFlexGrow, double& totalWeightedFlexShrink, InflexibleFlexItemSi ze&, bool hasInfiniteLineLength);
160 161
161 void resetAutoMarginsAndLogicalTopInCrossAxis(RenderBox*); 162 void resetAutoMarginsAndLogicalTopInCrossAxis(RenderBox*);
162 bool needToStretchChild(RenderBox*); 163 bool needToStretchChild(RenderBox*);
163 void setLogicalOverrideSize(RenderBox* child, LayoutUnit childPreferredSize) ; 164 void setLogicalOverrideSize(RenderBox* child, LayoutUnit childPreferredSize) ;
164 void prepareChildForPositionedLayout(RenderBox* child, LayoutUnit mainAxisOf fset, LayoutUnit crossAxisOffset, PositionedLayoutMode); 165 void prepareChildForPositionedLayout(RenderBox* child, LayoutUnit mainAxisOf fset, LayoutUnit crossAxisOffset, PositionedLayoutMode);
(...skipping 21 matching lines...) Expand all
186 ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isFlexibleBox()); 187 ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isFlexibleBox());
187 return static_cast<const RenderFlexibleBox*>(object); 188 return static_cast<const RenderFlexibleBox*>(object);
188 } 189 }
189 190
190 // This will catch anyone doing an unnecessary cast. 191 // This will catch anyone doing an unnecessary cast.
191 void toRenderFlexibleBox(const RenderFlexibleBox*); 192 void toRenderFlexibleBox(const RenderFlexibleBox*);
192 193
193 } // namespace WebCore 194 } // namespace WebCore
194 195
195 #endif // RenderFlexibleBox_h 196 #endif // RenderFlexibleBox_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/rendering/RenderFlexibleBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698