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

Unified Diff: Source/core/paint/LayoutObjectDrawingRecorderTest.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/LayoutObjectDrawingRecorder.h ('k') | Source/core/paint/ListMarkerPainter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/LayoutObjectDrawingRecorderTest.cpp
diff --git a/Source/core/paint/LayoutObjectDrawingRecorderTest.cpp b/Source/core/paint/LayoutObjectDrawingRecorderTest.cpp
index 9e86707434e257940d82b03f430f1e0ba620ac41..93d8c4524609958083a954a31ffb9f2ccec9e3b6 100644
--- a/Source/core/paint/LayoutObjectDrawingRecorderTest.cpp
+++ b/Source/core/paint/LayoutObjectDrawingRecorderTest.cpp
@@ -52,18 +52,17 @@ namespace {
void drawNothing(GraphicsContext& context, const LayoutView& layoutView, PaintPhase phase, const FloatRect& bound)
{
- LayoutObjectDrawingRecorder drawingRecorder(context, layoutView, phase, bound);
-
- // Redundant when there's nothing to draw but we must always do this check.
- if (drawingRecorder.canUseCachedDrawing())
+ if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(context, layoutView, phase))
return;
+
+ LayoutObjectDrawingRecorder drawingRecorder(context, layoutView, phase, bound);
}
void drawRect(GraphicsContext& context, LayoutView& layoutView, PaintPhase phase, const FloatRect& bound)
{
- LayoutObjectDrawingRecorder drawingRecorder(context, layoutView, phase, bound);
- if (drawingRecorder.canUseCachedDrawing())
+ if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(context, layoutView, phase))
return;
+ LayoutObjectDrawingRecorder drawingRecorder(context, layoutView, phase, bound);
IntRect rect(0, 0, 10, 10);
context.drawRect(rect);
}
« no previous file with comments | « Source/core/paint/LayoutObjectDrawingRecorder.h ('k') | Source/core/paint/ListMarkerPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698