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/rendering/RenderFlexibleBox.cpp

Issue 569683004: Factor painting code from RenderBlock into BlockPainter. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed 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 | « Source/core/rendering/RenderBox.cpp ('k') | Source/core/rendering/RenderGrid.h » ('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 14 matching lines...) Expand all
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "config.h" 31 #include "config.h"
32 #include "core/rendering/RenderFlexibleBox.h" 32 #include "core/rendering/RenderFlexibleBox.h"
33 33
34 #include "core/frame/UseCounter.h" 34 #include "core/frame/UseCounter.h"
35 #include "core/paint/BlockPainter.h"
35 #include "core/rendering/RenderLayer.h" 36 #include "core/rendering/RenderLayer.h"
36 #include "core/rendering/RenderView.h" 37 #include "core/rendering/RenderView.h"
37 #include "core/rendering/TextAutosizer.h" 38 #include "core/rendering/TextAutosizer.h"
38 #include "platform/LengthFunctions.h" 39 #include "platform/LengthFunctions.h"
39 #include "wtf/MathExtras.h" 40 #include "wtf/MathExtras.h"
40 #include <limits> 41 #include <limits>
41 42
42 namespace blink { 43 namespace blink {
43 44
44 struct RenderFlexibleBox::LineContext { 45 struct RenderFlexibleBox::LineContext {
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 { 276 {
276 for (RenderBox* child = m_orderIterator.first(); child; child = m_orderItera tor.next()) { 277 for (RenderBox* child = m_orderIterator.first(); child; child = m_orderItera tor.next()) {
277 if (!child->isOutOfFlowPositioned()) 278 if (!child->isOutOfFlowPositioned())
278 childFrameRects.append(child->frameRect()); 279 childFrameRects.append(child->frameRect());
279 } 280 }
280 } 281 }
281 282
282 void RenderFlexibleBox::paintChildren(PaintInfo& paintInfo, const LayoutPoint& p aintOffset) 283 void RenderFlexibleBox::paintChildren(PaintInfo& paintInfo, const LayoutPoint& p aintOffset)
283 { 284 {
284 for (RenderBox* child = m_orderIterator.first(); child; child = m_orderItera tor.next()) 285 for (RenderBox* child = m_orderIterator.first(); child; child = m_orderItera tor.next())
285 paintChildAsInlineBlock(child, paintInfo, paintOffset); 286 BlockPainter(*this).paintChildAsInlineBlock(child, paintInfo, paintOffse t);
286 } 287 }
287 288
288 void RenderFlexibleBox::repositionLogicalHeightDependentFlexItems(Vector<LineCon text>& lineContexts) 289 void RenderFlexibleBox::repositionLogicalHeightDependentFlexItems(Vector<LineCon text>& lineContexts)
289 { 290 {
290 LayoutUnit crossAxisStartEdge = lineContexts.isEmpty() ? LayoutUnit() : line Contexts[0].crossAxisOffset; 291 LayoutUnit crossAxisStartEdge = lineContexts.isEmpty() ? LayoutUnit() : line Contexts[0].crossAxisOffset;
291 alignFlexLines(lineContexts); 292 alignFlexLines(lineContexts);
292 293
293 alignChildren(lineContexts); 294 alignChildren(lineContexts);
294 295
295 if (style()->flexWrap() == FlexWrapReverse) 296 if (style()->flexWrap() == FlexWrapReverse)
(...skipping 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after
1401 ASSERT(child); 1402 ASSERT(child);
1402 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent; 1403 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent;
1403 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge; 1404 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge;
1404 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent; 1405 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent;
1405 adjustAlignmentForChild(*child, newOffset - originalOffset); 1406 adjustAlignmentForChild(*child, newOffset - originalOffset);
1406 } 1407 }
1407 } 1408 }
1408 } 1409 }
1409 1410
1410 } 1411 }
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBox.cpp ('k') | Source/core/rendering/RenderGrid.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698