OLD | NEW |
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/FrameSelection.h" | 8 #include "core/editing/FrameSelection.h" |
9 #include "core/frame/Settings.h" | 9 #include "core/frame/Settings.h" |
10 #include "core/layout/LayoutFlexibleBox.h" | 10 #include "core/layout/LayoutFlexibleBox.h" |
11 #include "core/layout/LayoutInline.h" | 11 #include "core/layout/LayoutInline.h" |
12 #include "core/page/Page.h" | 12 #include "core/page/Page.h" |
13 #include "core/paint/BoxClipper.h" | 13 #include "core/paint/BoxClipper.h" |
14 #include "core/paint/BoxPainter.h" | 14 #include "core/paint/BoxPainter.h" |
15 #include "core/paint/DeprecatedPaintLayer.h" | 15 #include "core/paint/DeprecatedPaintLayer.h" |
16 #include "core/paint/GraphicsContextAnnotator.h" | |
17 #include "core/paint/InlinePainter.h" | 16 #include "core/paint/InlinePainter.h" |
18 #include "core/paint/LayoutObjectDrawingRecorder.h" | 17 #include "core/paint/LayoutObjectDrawingRecorder.h" |
19 #include "core/paint/LineBoxListPainter.h" | 18 #include "core/paint/LineBoxListPainter.h" |
20 #include "core/paint/PaintInfo.h" | 19 #include "core/paint/PaintInfo.h" |
21 #include "core/paint/ScopeRecorder.h" | 20 #include "core/paint/ScopeRecorder.h" |
22 #include "core/paint/ScrollRecorder.h" | 21 #include "core/paint/ScrollRecorder.h" |
23 #include "core/paint/ScrollableAreaPainter.h" | 22 #include "core/paint/ScrollableAreaPainter.h" |
24 #include "platform/graphics/paint/ClipRecorder.h" | 23 #include "platform/graphics/paint/ClipRecorder.h" |
25 | 24 |
26 namespace blink { | 25 namespace blink { |
27 | 26 |
28 void BlockPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOff
set) | 27 void BlockPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOff
set) |
29 { | 28 { |
30 PaintInfo localPaintInfo(paintInfo); | 29 PaintInfo localPaintInfo(paintInfo); |
31 | 30 |
32 ANNOTATE_GRAPHICS_CONTEXT(localPaintInfo, &m_layoutBlock); | |
33 | |
34 LayoutPoint adjustedPaintOffset = paintOffset + m_layoutBlock.location(); | 31 LayoutPoint adjustedPaintOffset = paintOffset + m_layoutBlock.location(); |
35 | 32 |
36 PaintPhase originalPhase = localPaintInfo.phase; | 33 PaintPhase originalPhase = localPaintInfo.phase; |
37 | 34 |
38 // Check if we need to do anything at all. | 35 // Check if we need to do anything at all. |
39 // FIXME: Could eliminate the isDocumentElement() check if we fix background
painting so that the LayoutView | 36 // FIXME: Could eliminate the isDocumentElement() check if we fix background
painting so that the LayoutView |
40 // paints the root's background. | 37 // paints the root's background. |
41 // TODO(schenney): Unroll m_layoutBlock.isDocumentElement() to try to get so
me insight into crbug.com/475698 | 38 // TODO(schenney): Unroll m_layoutBlock.isDocumentElement() to try to get so
me insight into crbug.com/475698 |
42 Node* blockNode = m_layoutBlock.node(); | 39 Node* blockNode = m_layoutBlock.node(); |
43 RELEASE_ASSERT(blockNode || m_layoutBlock.isAnonymous()); | 40 RELEASE_ASSERT(blockNode || m_layoutBlock.isAnonymous()); |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 LayoutBlock* block = flow->containingBlock(); | 512 LayoutBlock* block = flow->containingBlock(); |
516 for ( ; block && block != &m_layoutBlock; block = block->containingBlock
()) | 513 for ( ; block && block != &m_layoutBlock; block = block->containingBlock
()) |
517 accumulatedPaintOffset.moveBy(block->location()); | 514 accumulatedPaintOffset.moveBy(block->location()); |
518 ASSERT(block); | 515 ASSERT(block); |
519 InlinePainter(*flow).paintOutline(info, accumulatedPaintOffset); | 516 InlinePainter(*flow).paintOutline(info, accumulatedPaintOffset); |
520 } | 517 } |
521 } | 518 } |
522 | 519 |
523 | 520 |
524 } // namespace blink | 521 } // namespace blink |
OLD | NEW |