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

Unified Diff: Source/platform/graphics/GraphicsLayer.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/svg/graphics/SVGImage.cpp ('k') | Source/platform/graphics/paint/DisplayItemListTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/GraphicsLayer.cpp
diff --git a/Source/platform/graphics/GraphicsLayer.cpp b/Source/platform/graphics/GraphicsLayer.cpp
index aa293079f3c08e1eb19ef284a47bd1d93323ca6c..d16aea9c1018e4fa0dcd9e3ba65cb7b1d326b256 100644
--- a/Source/platform/graphics/GraphicsLayer.cpp
+++ b/Source/platform/graphics/GraphicsLayer.cpp
@@ -288,9 +288,10 @@ void GraphicsLayer::paintGraphicsLayerContents(GraphicsContext& context, const I
if (m_displayItemList && contentsOpaque()) {
ASSERT(RuntimeEnabledFeatures::slimmingPaintEnabled());
FloatRect rect(FloatPoint(), size());
- DrawingRecorder recorder(context, *this, DisplayItem::DebugRedFill, rect);
- if (!recorder.canUseCachedDrawing())
+ if (!DrawingRecorder::useCachedDrawingIfPossible(context, *this, DisplayItem::DebugRedFill)) {
+ DrawingRecorder recorder(context, *this, DisplayItem::DebugRedFill, rect);
context.fillRect(rect, SK_ColorRED);
+ }
}
#endif
m_client->paintContents(this, context, m_paintingPhase, clip);
« no previous file with comments | « Source/core/svg/graphics/SVGImage.cpp ('k') | Source/platform/graphics/paint/DisplayItemListTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698