Chromium Code Reviews| Index: Source/core/paint/BlockPainter.cpp |
| diff --git a/Source/core/paint/BlockPainter.cpp b/Source/core/paint/BlockPainter.cpp |
| index 809f8ba106cf29a26706314efc9060c4a52080ff..68ae45ec6128cb035d44eb22ee84a9305c7a9a24 100644 |
| --- a/Source/core/paint/BlockPainter.cpp |
| +++ b/Source/core/paint/BlockPainter.cpp |
| @@ -87,8 +87,9 @@ void BlockPainter::paintOverflowControlsIfNeeded(const PaintInfo& paintInfo, con |
| { |
| PaintPhase phase = paintInfo.phase; |
| if (m_renderBlock.hasOverflowClip() && m_renderBlock.style()->visibility() == VISIBLE && (phase == PaintPhaseBlockBackground || phase == PaintPhaseChildBlockBackground) && paintInfo.shouldPaintWithinRoot(&m_renderBlock) && !paintInfo.paintRootBackgroundOnly()) { |
| - RenderDrawingRecorder recorder(paintInfo.context, &m_renderBlock, paintInfo.phase, pixelSnappedIntRect(paintOffset, m_renderBlock.visualOverflowRect().size())); |
| - ScrollableAreaPainter(*m_renderBlock.layer()->scrollableArea()).paintOverflowControls(paintInfo.context, roundedIntPoint(paintOffset), paintInfo.rect, false /* paintingOverlayControls */); |
| + RenderDrawingRecorder recorder(paintInfo.context, m_renderBlock, paintInfo.phase, pixelSnappedIntRect(paintOffset, m_renderBlock.visualOverflowRect().size())); |
| + if (!recorder.canUseCachedDrawing()) |
| + ScrollableAreaPainter(*m_renderBlock.layer()->scrollableArea()).paintOverflowControls(paintInfo.context, roundedIntPoint(paintOffset), paintInfo.rect, false /* paintingOverlayControls */); |
|
chrishtr
2014/12/11 20:01:48
Why are these safe? Unless we are very careful, we
Xianzhu
2014/12/11 20:22:16
I think we'll emit DrawingDisplayItems/CachedDispl
chrishtr
2014/12/12 00:18:08
Oh right, it's within a block that has a DrawingRe
|
| } |
| } |
| @@ -178,14 +179,16 @@ void BlockPainter::paintObject(const PaintInfo& paintInfo, const LayoutPoint& pa |
| } |
| if (paintPhase == PaintPhaseMask && m_renderBlock.style()->visibility() == VISIBLE) { |
| - RenderDrawingRecorder recorder(paintInfo.context, &m_renderBlock, paintPhase, bounds); |
| - m_renderBlock.paintMask(paintInfo, paintOffset); |
| + RenderDrawingRecorder recorder(paintInfo.context, m_renderBlock, paintPhase, bounds); |
| + if (!recorder.canUseCachedDrawing()) |
| + m_renderBlock.paintMask(paintInfo, paintOffset); |
| return; |
| } |
| if (paintPhase == PaintPhaseClippingMask && m_renderBlock.style()->visibility() == VISIBLE) { |
| - RenderDrawingRecorder recorder(paintInfo.context, &m_renderBlock, paintPhase, bounds); |
| - m_renderBlock.paintClippingMask(paintInfo, paintOffset); |
| + RenderDrawingRecorder recorder(paintInfo.context, m_renderBlock, paintPhase, bounds); |
| + if (!recorder.canUseCachedDrawing()) |
| + m_renderBlock.paintClippingMask(paintInfo, paintOffset); |
| return; |
| } |
| @@ -225,8 +228,9 @@ void BlockPainter::paintObject(const PaintInfo& paintInfo, const LayoutPoint& pa |
| // If the caret's node's render object's containing block is this block, and the paint action is PaintPhaseForeground, |
| // then paint the caret. |
| if (paintPhase == PaintPhaseForeground) { |
| - RenderDrawingRecorder recorder(paintInfo.context, &m_renderBlock, paintPhase, bounds); |
| - paintCarets(paintInfo, paintOffset); |
| + RenderDrawingRecorder recorder(paintInfo.context, m_renderBlock, paintPhase, bounds); |
| + if (!recorder.canUseCachedDrawing()) |
| + paintCarets(paintInfo, paintOffset); |
| } |
| } |