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/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/BoxClipper.h" |
13 #include "core/paint/BoxPainter.h" | 14 #include "core/paint/BoxPainter.h" |
14 #include "core/paint/DrawingRecorder.h" | 15 #include "core/paint/DrawingRecorder.h" |
15 #include "core/paint/InlinePainter.h" | 16 #include "core/paint/InlinePainter.h" |
16 #include "core/paint/LineBoxListPainter.h" | 17 #include "core/paint/LineBoxListPainter.h" |
17 #include "core/rendering/GraphicsContextAnnotator.h" | 18 #include "core/rendering/GraphicsContextAnnotator.h" |
18 #include "core/rendering/PaintInfo.h" | 19 #include "core/rendering/PaintInfo.h" |
19 #include "core/rendering/RenderBlock.h" | 20 #include "core/rendering/RenderBlock.h" |
20 #include "core/rendering/RenderBoxClipper.h" | |
21 #include "core/rendering/RenderFlexibleBox.h" | 21 #include "core/rendering/RenderFlexibleBox.h" |
22 #include "core/rendering/RenderInline.h" | 22 #include "core/rendering/RenderInline.h" |
23 #include "core/rendering/RenderLayer.h" | 23 #include "core/rendering/RenderLayer.h" |
24 #include "core/rendering/RenderView.h" | 24 #include "core/rendering/RenderView.h" |
25 #include "platform/geometry/LayoutPoint.h" | 25 #include "platform/geometry/LayoutPoint.h" |
26 #include "platform/geometry/LayoutRect.h" | 26 #include "platform/geometry/LayoutRect.h" |
27 #include "platform/graphics/GraphicsContextCullSaver.h" | 27 #include "platform/graphics/GraphicsContextCullSaver.h" |
28 #include "platform/graphics/GraphicsContextStateSaver.h" | 28 #include "platform/graphics/GraphicsContextStateSaver.h" |
29 | 29 |
30 namespace blink { | 30 namespace blink { |
(...skipping 18 matching lines...) Expand all Loading... |
49 return; | 49 return; |
50 } | 50 } |
51 | 51 |
52 // There are some cases where not all clipped visual overflow is accounted f
or. | 52 // There are some cases where not all clipped visual overflow is accounted f
or. |
53 // FIXME: reduce the number of such cases. | 53 // FIXME: reduce the number of such cases. |
54 ContentsClipBehavior contentsClipBehavior = ForceContentsClip; | 54 ContentsClipBehavior contentsClipBehavior = ForceContentsClip; |
55 if (m_renderBlock.hasOverflowClip() && !m_renderBlock.hasControlClip() && !(
m_renderBlock.shouldPaintSelectionGaps() && phase == PaintPhaseForeground) && !h
asCaret()) | 55 if (m_renderBlock.hasOverflowClip() && !m_renderBlock.hasControlClip() && !(
m_renderBlock.shouldPaintSelectionGaps() && phase == PaintPhaseForeground) && !h
asCaret()) |
56 contentsClipBehavior = SkipContentsClipIfPossible; | 56 contentsClipBehavior = SkipContentsClipIfPossible; |
57 | 57 |
58 { | 58 { |
59 RenderBoxClipper boxClipper(m_renderBlock, paintInfo, adjustedPaintOffse
t, contentsClipBehavior); | 59 BoxClipper boxClipper(m_renderBlock, paintInfo, adjustedPaintOffset, con
tentsClipBehavior); |
60 GraphicsContextCullSaver cullSaver(*paintInfo.context); | 60 GraphicsContextCullSaver cullSaver(*paintInfo.context); |
61 // Cull if we have more than one child and we didn't already clip. | 61 // Cull if we have more than one child and we didn't already clip. |
62 bool shouldCull = m_renderBlock.document().settings()->containerCullingE
nabled() && !boxClipper.pushedClip() && !m_renderBlock.isDocumentElement() | 62 bool shouldCull = m_renderBlock.document().settings()->containerCullingE
nabled() && !boxClipper.pushedClip() && !m_renderBlock.isDocumentElement() |
63 && m_renderBlock.firstChild() && m_renderBlock.lastChild() && m_rend
erBlock.firstChild() != m_renderBlock.lastChild(); | 63 && m_renderBlock.firstChild() && m_renderBlock.lastChild() && m_rend
erBlock.firstChild() != m_renderBlock.lastChild(); |
64 if (shouldCull) | 64 if (shouldCull) |
65 cullSaver.cull(overflowBox); | 65 cullSaver.cull(overflowBox); |
66 | 66 |
67 m_renderBlock.paintObject(paintInfo, adjustedPaintOffset); | 67 m_renderBlock.paintObject(paintInfo, adjustedPaintOffset); |
68 } | 68 } |
69 | 69 |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 RenderBlock* block = flow->containingBlock(); | 482 RenderBlock* block = flow->containingBlock(); |
483 for ( ; block && block != &m_renderBlock; block = block->containingBlock
()) | 483 for ( ; block && block != &m_renderBlock; block = block->containingBlock
()) |
484 accumulatedPaintOffset.moveBy(block->location()); | 484 accumulatedPaintOffset.moveBy(block->location()); |
485 ASSERT(block); | 485 ASSERT(block); |
486 InlinePainter(*flow).paintOutline(info, accumulatedPaintOffset); | 486 InlinePainter(*flow).paintOutline(info, accumulatedPaintOffset); |
487 } | 487 } |
488 } | 488 } |
489 | 489 |
490 | 490 |
491 } // namespace blink | 491 } // namespace blink |
OLD | NEW |