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

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

Issue 2707083002: Remove the text blob cache (Closed)
Patch Set: Created 3 years, 10 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
Index: third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp b/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp
index 9ac4fea49f4dd9f08459bd7172b6f5d942508c5d..b46e742c2e33dbb443ce2d3856c22bb16242dc8d 100644
--- a/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp
@@ -442,24 +442,8 @@ Path AppliedDecorationPainter::prepareWavyStrokePath() {
return path;
}
-typedef WTF::HashMap<const InlineTextBox*, TextBlobPtr>
- InlineTextBoxBlobCacheMap;
-static InlineTextBoxBlobCacheMap* gTextBlobCache;
-
static const int misspellingLineThickness = 3;
-void InlineTextBoxPainter::removeFromTextBlobCache(
- const InlineTextBox& inlineTextBox) {
- if (gTextBlobCache)
- gTextBlobCache->remove(&inlineTextBox);
-}
-
-static TextBlobPtr* addToTextBlobCache(const InlineTextBox& inlineTextBox) {
- if (!gTextBlobCache)
- gTextBlobCache = new InlineTextBoxBlobCacheMap;
- return &gTextBlobCache->insert(&inlineTextBox, nullptr).storedValue->value;
-}
-
LayoutObject& InlineTextBoxPainter::inlineLayoutObject() const {
return *LineLayoutAPIShim::layoutObjectFrom(
m_inlineTextBox.getLineLayoutItem());
@@ -692,26 +676,13 @@ void InlineTextBoxPainter::paint(const PaintInfo& paintInfo,
endOffset = selectionStart;
}
- // FIXME: This cache should probably ultimately be held somewhere else.
- // A hashmap is convenient to avoid a memory hit when the
- // RuntimeEnabledFeature is off.
- bool textBlobIsCacheable = startOffset == 0 && endOffset == length;
- TextBlobPtr* cachedTextBlob = 0;
- if (textBlobIsCacheable)
- cachedTextBlob = addToTextBlobCache(m_inlineTextBox);
- textPainter.paint(startOffset, endOffset, length, textStyle,
- cachedTextBlob);
+ textPainter.paint(startOffset, endOffset, length, textStyle);
}
if ((paintSelectedTextOnly || paintSelectedTextSeparately) &&
selectionStart < selectionEnd) {
// paint only the text that is selected
- bool textBlobIsCacheable = selectionStart == 0 && selectionEnd == length;
- TextBlobPtr* cachedTextBlob = 0;
- if (textBlobIsCacheable)
- cachedTextBlob = addToTextBlobCache(m_inlineTextBox);
- textPainter.paint(selectionStart, selectionEnd, length, selectionStyle,
- cachedTextBlob);
+ textPainter.paint(selectionStart, selectionEnd, length, selectionStyle);
}
// Paint decorations
@@ -1365,7 +1336,7 @@ void InlineTextBoxPainter::paintTextMatchMarkerForeground(
m_inlineTextBox.isHorizontal());
textPainter.paint(paintOffsets.first, paintOffsets.second,
- m_inlineTextBox.len(), textStyle, 0);
+ m_inlineTextBox.len(), textStyle);
}
void InlineTextBoxPainter::paintTextMatchMarkerBackground(
« no previous file with comments | « third_party/WebKit/Source/core/paint/InlineTextBoxPainter.h ('k') | third_party/WebKit/Source/core/paint/TextPainter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698