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

Side by Side Diff: Source/core/paint/BlockPainter.cpp

Issue 596583002: Move paint code from RenderFlexibleBox to BlockPainter. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Merged. 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/paint/BlockPainter.h ('k') | Source/core/rendering/RenderFlexibleBox.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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/paint/BlockPainter.h" 6 #include "core/paint/BlockPainter.h"
7 7
8 #include "core/editing/Caret.h" 8 #include "core/editing/Caret.h"
9 #include "core/editing/FrameSelection.h" 9 #include "core/editing/FrameSelection.h"
10 #include "core/frame/LocalFrame.h" 10 #include "core/frame/LocalFrame.h"
11 #include "core/frame/Settings.h" 11 #include "core/frame/Settings.h"
12 #include "core/page/Page.h" 12 #include "core/page/Page.h"
13 #include "core/paint/BoxPainter.h" 13 #include "core/paint/BoxPainter.h"
14 #include "core/paint/InlinePainter.h" 14 #include "core/paint/InlinePainter.h"
15 #include "core/paint/LineBoxListPainter.h" 15 #include "core/paint/LineBoxListPainter.h"
16 #include "core/rendering/GraphicsContextAnnotator.h" 16 #include "core/rendering/GraphicsContextAnnotator.h"
17 #include "core/rendering/PaintInfo.h" 17 #include "core/rendering/PaintInfo.h"
18 #include "core/rendering/RenderBlock.h" 18 #include "core/rendering/RenderBlock.h"
19 #include "core/rendering/RenderFlexibleBox.h"
19 #include "core/rendering/RenderInline.h" 20 #include "core/rendering/RenderInline.h"
20 #include "core/rendering/RenderLayer.h" 21 #include "core/rendering/RenderLayer.h"
21 #include "platform/geometry/LayoutPoint.h" 22 #include "platform/geometry/LayoutPoint.h"
22 #include "platform/geometry/LayoutRect.h" 23 #include "platform/geometry/LayoutRect.h"
23 #include "platform/graphics/GraphicsContextCullSaver.h" 24 #include "platform/graphics/GraphicsContextCullSaver.h"
24 #include "platform/graphics/GraphicsContextStateSaver.h" 25 #include "platform/graphics/GraphicsContextStateSaver.h"
25 26
26 namespace blink { 27 namespace blink {
27 28
28 void BlockPainter::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset) 29 void BlockPainter::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 paintChild(child, paintInfo, paintOffset); 80 paintChild(child, paintInfo, paintOffset);
80 } 81 }
81 82
82 void BlockPainter::paintChild(RenderBox* child, PaintInfo& paintInfo, const Layo utPoint& paintOffset) 83 void BlockPainter::paintChild(RenderBox* child, PaintInfo& paintInfo, const Layo utPoint& paintOffset)
83 { 84 {
84 LayoutPoint childPoint = m_renderBlock.flipForWritingModeForChild(child, pai ntOffset); 85 LayoutPoint childPoint = m_renderBlock.flipForWritingModeForChild(child, pai ntOffset);
85 if (!child->hasSelfPaintingLayer() && !child->isFloating()) 86 if (!child->hasSelfPaintingLayer() && !child->isFloating())
86 child->paint(paintInfo, childPoint); 87 child->paint(paintInfo, childPoint);
87 } 88 }
88 89
90 void BlockPainter::paintChildrenOfFlexibleBox(RenderFlexibleBox& renderFlexibleB ox, PaintInfo& paintInfo, const LayoutPoint& paintOffset)
91 {
92 for (RenderBox* child = renderFlexibleBox.orderIterator().first(); child; ch ild = renderFlexibleBox.orderIterator().next())
93 BlockPainter(renderFlexibleBox).paintChildAsInlineBlock(child, paintInfo , paintOffset);
94 }
95
89 void BlockPainter::paintChildAsInlineBlock(RenderBox* child, PaintInfo& paintInf o, const LayoutPoint& paintOffset) 96 void BlockPainter::paintChildAsInlineBlock(RenderBox* child, PaintInfo& paintInf o, const LayoutPoint& paintOffset)
90 { 97 {
91 LayoutPoint childPoint = m_renderBlock.flipForWritingModeForChild(child, pai ntOffset); 98 LayoutPoint childPoint = m_renderBlock.flipForWritingModeForChild(child, pai ntOffset);
92 if (!child->hasSelfPaintingLayer() && !child->isFloating()) 99 if (!child->hasSelfPaintingLayer() && !child->isFloating())
93 paintAsInlineBlock(child, paintInfo, childPoint); 100 paintAsInlineBlock(child, paintInfo, childPoint);
94 } 101 }
95 102
96 void BlockPainter::paintInlineBox(InlineBox& inlineBox, PaintInfo& paintInfo, co nst LayoutPoint& paintOffset) 103 void BlockPainter::paintInlineBox(InlineBox& inlineBox, PaintInfo& paintInfo, co nst LayoutPoint& paintOffset)
97 { 104 {
98 if (!paintInfo.shouldPaintWithinRoot(&inlineBox.renderer()) || (paintInfo.ph ase != PaintPhaseForeground && paintInfo.phase != PaintPhaseSelection)) 105 if (!paintInfo.shouldPaintWithinRoot(&inlineBox.renderer()) || (paintInfo.ph ase != PaintPhaseForeground && paintInfo.phase != PaintPhaseSelection))
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 RenderBlock* block = flow->containingBlock(); 488 RenderBlock* block = flow->containingBlock();
482 for ( ; block && block != &m_renderBlock; block = block->containingBlock ()) 489 for ( ; block && block != &m_renderBlock; block = block->containingBlock ())
483 accumulatedPaintOffset.moveBy(block->location()); 490 accumulatedPaintOffset.moveBy(block->location());
484 ASSERT(block); 491 ASSERT(block);
485 InlinePainter(*flow).paintOutline(info, accumulatedPaintOffset); 492 InlinePainter(*flow).paintOutline(info, accumulatedPaintOffset);
486 } 493 }
487 } 494 }
488 495
489 496
490 } // namespace blink 497 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/paint/BlockPainter.h ('k') | Source/core/rendering/RenderFlexibleBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698