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

Unified Diff: Source/core/paint/SVGInlineTextBoxPainter.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/SVGImagePainter.cpp ('k') | Source/core/paint/SVGMaskPainter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/SVGInlineTextBoxPainter.cpp
diff --git a/Source/core/paint/SVGInlineTextBoxPainter.cpp b/Source/core/paint/SVGInlineTextBoxPainter.cpp
index 34d61464c3b1d45ebf58af391c988b66311ee480..f2aea5bac79bf65ed448df1bfac98caa5ade5560 100644
--- a/Source/core/paint/SVGInlineTextBoxPainter.cpp
+++ b/Source/core/paint/SVGInlineTextBoxPainter.cpp
@@ -59,16 +59,15 @@ void SVGInlineTextBoxPainter::paint(const PaintInfo& paintInfo, const LayoutPoin
LayoutObject& parentLayoutObject = m_svgInlineTextBox.parent()->layoutObject();
const ComputedStyle& style = parentLayoutObject.styleRef();
- {
- DrawingRecorder recorder(*paintInfo.context, m_svgInlineTextBox, DisplayItem::paintPhaseToDrawingType(paintInfo.phase), paintInfo.rect);
- if (!recorder.canUseCachedDrawing()) {
- InlineTextBoxPainter(m_svgInlineTextBox).paintDocumentMarkers(
- paintInfo.context, paintOffset, style,
- textLayoutObject.scaledFont(), true);
-
- if (!m_svgInlineTextBox.textFragments().isEmpty())
- paintTextFragments(paintInfo, parentLayoutObject);
- }
+ DisplayItem::Type displayItemType = DisplayItem::paintPhaseToDrawingType(paintInfo.phase);
+ if (!DrawingRecorder::useCachedDrawingIfPossible(*paintInfo.context, m_svgInlineTextBox, displayItemType)) {
+ DrawingRecorder recorder(*paintInfo.context, m_svgInlineTextBox, displayItemType, paintInfo.rect);
+ InlineTextBoxPainter(m_svgInlineTextBox).paintDocumentMarkers(
+ paintInfo.context, paintOffset, style,
+ textLayoutObject.scaledFont(), true);
+
+ if (!m_svgInlineTextBox.textFragments().isEmpty())
+ paintTextFragments(paintInfo, parentLayoutObject);
}
if (style.hasOutline() && parentLayoutObject.isLayoutInline())
« no previous file with comments | « Source/core/paint/SVGImagePainter.cpp ('k') | Source/core/paint/SVGMaskPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698