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

Unified Diff: Source/core/rendering/InlineTextBox.cpp

Issue 622253002: Pass start/length at InlineTextBox construction time. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: condense by one line Created 6 years, 2 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: Source/core/rendering/InlineTextBox.cpp
diff --git a/Source/core/rendering/InlineTextBox.cpp b/Source/core/rendering/InlineTextBox.cpp
index 24b24c55749c3ca464c6740252b51483da5dfaaf..d595b8cd16b4345f0dac98da47928e714be96d8c 100644
--- a/Source/core/rendering/InlineTextBox.cpp
+++ b/Source/core/rendering/InlineTextBox.cpp
@@ -74,6 +74,12 @@ static InlineTextBoxOverflowMap* gTextBoxesWithOverflow;
typedef WTF::HashMap<const InlineTextBox*, TextBlobPtr> InlineTextBoxBlobCacheMap;
static InlineTextBoxBlobCacheMap* gTextBlobCache;
+static void removeFromTextBlobCache(InlineTextBox* textBox)
+{
+ if (gTextBlobCache)
+ gTextBlobCache->remove(textBox);
+}
+
static const int misspellingLineThickness = 3;
void InlineTextBox::destroy()
@@ -82,16 +88,21 @@ void InlineTextBox::destroy()
if (!knownToHaveNoOverflow() && gTextBoxesWithOverflow)
gTextBoxesWithOverflow->remove(this);
- if (gTextBlobCache)
- gTextBlobCache->remove(this);
+ removeFromTextBlobCache(this);
InlineBox::destroy();
}
+void InlineTextBox::offsetRun(int delta)
+{
+ ASSERT(!isDirty());
+ removeFromTextBlobCache(this);
+ m_start += delta;
+}
+
void InlineTextBox::markDirty()
{
// FIXME: Is it actually possible to try and paint a dirty InlineTextBox?
- if (gTextBlobCache)
- gTextBlobCache->remove(this);
+ removeFromTextBlobCache(this);
m_len = 0;
m_start = 0;

Powered by Google App Engine
This is Rietveld 408576698