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

Unified Diff: Source/core/paint/BlockPainter.cpp

Issue 799563002: Use DrawingRecorder::canUseCachedDrawing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/paint/BoxPainter.cpp » ('j') | Source/core/paint/ImagePainter.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
}
« no previous file with comments | « no previous file | Source/core/paint/BoxPainter.cpp » ('j') | Source/core/paint/ImagePainter.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698