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

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

Issue 1220583004: Refactor DrawingRecorders to check for cached drawings earlier (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/paint/ObjectPainter.cpp ('k') | Source/core/paint/ReplacedPainter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/PartPainter.cpp
diff --git a/Source/core/paint/PartPainter.cpp b/Source/core/paint/PartPainter.cpp
index 4710e9121f9619bf971a2b23b825052d6188cf02..89b1eb09ba202bb3ea55c8b2839954989a408862 100644
--- a/Source/core/paint/PartPainter.cpp
+++ b/Source/core/paint/PartPainter.cpp
@@ -63,13 +63,12 @@ void PartPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOffs
}
// Paint a partially transparent wash over selected widgets.
- if (m_layoutPart.isSelected() && !m_layoutPart.document().printing()) {
+ if (m_layoutPart.isSelected() && !m_layoutPart.document().printing() && !LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*paintInfo.context, m_layoutPart, paintInfo.phase)) {
LayoutRect rect = m_layoutPart.localSelectionRect();
rect.moveBy(adjustedPaintOffset);
IntRect selectionRect = pixelSnappedIntRect(rect);
LayoutObjectDrawingRecorder drawingRecorder(*paintInfo.context, m_layoutPart, paintInfo.phase, selectionRect);
- if (!drawingRecorder.canUseCachedDrawing())
- paintInfo.context->fillRect(selectionRect, m_layoutPart.selectionBackgroundColor());
+ paintInfo.context->fillRect(selectionRect, m_layoutPart.selectionBackgroundColor());
}
if (m_layoutPart.canResize())
« no previous file with comments | « Source/core/paint/ObjectPainter.cpp ('k') | Source/core/paint/ReplacedPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698