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

Unified Diff: Source/core/paint/EllipsisBoxPainter.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/DetailsMarkerPainter.cpp ('k') | Source/core/paint/EmbeddedObjectPainter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/EllipsisBoxPainter.cpp
diff --git a/Source/core/paint/EllipsisBoxPainter.cpp b/Source/core/paint/EllipsisBoxPainter.cpp
index 46a0a7431c50d3ef013332d5fb5f00dbc290a23f..1035e60b8a6d52bba5f9625a609ff4ed5933fb47 100644
--- a/Source/core/paint/EllipsisBoxPainter.cpp
+++ b/Source/core/paint/EllipsisBoxPainter.cpp
@@ -33,10 +33,12 @@ void EllipsisBoxPainter::paintEllipsis(const PaintInfo& paintInfo, const LayoutP
paintRect.moveBy(paintOffset);
GraphicsContext* context = paintInfo.context;
- DrawingRecorder recorder(*context, m_ellipsisBox, DisplayItem::paintPhaseToDrawingType(paintInfo.phase), paintRect);
- if (recorder.canUseCachedDrawing())
+ DisplayItem::Type displayItemType = DisplayItem::paintPhaseToDrawingType(paintInfo.phase);
+ if (DrawingRecorder::useCachedDrawingIfPossible(*context, m_ellipsisBox, displayItemType))
return;
+ DrawingRecorder recorder(*context, m_ellipsisBox, displayItemType, paintRect);
+
LayoutPoint boxOrigin = m_ellipsisBox.locationIncludingFlipping();
boxOrigin.moveBy(paintOffset);
LayoutRect boxRect(boxOrigin, LayoutSize(m_ellipsisBox.logicalWidth(), m_ellipsisBox.virtualLogicalHeight()));
« no previous file with comments | « Source/core/paint/DetailsMarkerPainter.cpp ('k') | Source/core/paint/EmbeddedObjectPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698