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

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

Issue 1340133003: Paint offset caching/change-detection for InlineBoxes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Extract PaintInvalidationDelayedFullExtract updatePaintOffsetIfNeeded Created 5 years, 3 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/InlineFlowBoxPainter.cpp ('k') | Source/core/paint/LayoutObjectDrawingRecorder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/InlineTextBoxPainter.cpp
diff --git a/Source/core/paint/InlineTextBoxPainter.cpp b/Source/core/paint/InlineTextBoxPainter.cpp
index 3c59d7230d679a5cfa381371bffde239ebb465f5..5daba83ce862773b490bba9462251ba4bc827a44 100644
--- a/Source/core/paint/InlineTextBoxPainter.cpp
+++ b/Source/core/paint/InlineTextBoxPainter.cpp
@@ -15,10 +15,10 @@
#include "core/layout/LayoutTheme.h"
#include "core/layout/line/InlineTextBox.h"
#include "core/paint/BoxPainter.h"
+#include "core/paint/LayoutObjectDrawingRecorder.h"
#include "core/paint/PaintInfo.h"
#include "core/paint/TextPainter.h"
#include "platform/graphics/GraphicsContextStateSaver.h"
-#include "platform/graphics/paint/DrawingRecorder.h"
#include "wtf/Optional.h"
namespace blink {
@@ -80,18 +80,18 @@ void InlineTextBoxPainter::paint(const PaintInfo& paintInfo, const LayoutPoint&
return;
}
- // The text clip phase already has a DrawingRecorder. Text clips are initiated only in BoxPainter::paintLayerExtended, which is already
- // within a DrawingRecorder.
- Optional<DrawingRecorder> drawingRecorder;
+ // The text clip phase already has a LayoutObjectDrawingRecorder. Text clips are initiated only in BoxPainter::paintLayerExtended,
+ // which is already within a LayoutObjectDrawingRecorder.
+ Optional<LayoutObjectDrawingRecorder> drawingRecorder;
if (paintInfo.phase != PaintPhaseTextClip) {
- if (DrawingRecorder::useCachedDrawingIfPossible(*paintInfo.context, m_inlineTextBox, DisplayItem::paintPhaseToDrawingType(paintInfo.phase)))
+ if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*paintInfo.context, m_inlineTextBox, paintInfo.phase, paintOffset))
return;
LayoutRect paintRect(logicalVisualOverflow);
m_inlineTextBox.logicalRectToPhysicalRect(paintRect);
if (paintInfo.phase != PaintPhaseSelection && (haveSelection || paintsMarkerHighlights(m_inlineTextBox.layoutObject())))
paintRect.unite(m_inlineTextBox.localSelectionRect(m_inlineTextBox.start(), m_inlineTextBox.start() + m_inlineTextBox.len()));
paintRect.moveBy(adjustedPaintOffset);
- drawingRecorder.emplace(*paintInfo.context, m_inlineTextBox, DisplayItem::paintPhaseToDrawingType(paintInfo.phase), FloatRect(paintRect));
+ drawingRecorder.emplace(*paintInfo.context, m_inlineTextBox, paintInfo.phase, paintRect, paintOffset);
}
if (m_inlineTextBox.truncation() != cNoTruncation) {
« no previous file with comments | « Source/core/paint/InlineFlowBoxPainter.cpp ('k') | Source/core/paint/LayoutObjectDrawingRecorder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698