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

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

Issue 554613004: TextBlob: Start caching a text blob per InlineTextBox. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rewrite in light of changed Font::drawText signature Created 6 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
Index: Source/core/rendering/InlineTextBox.cpp
diff --git a/Source/core/rendering/InlineTextBox.cpp b/Source/core/rendering/InlineTextBox.cpp
index b1352fcb62c8278fb0873ae7de8e6ab011309024..a241b876332d27331ec49851d87bff335e1ba191 100644
--- a/Source/core/rendering/InlineTextBox.cpp
+++ b/Source/core/rendering/InlineTextBox.cpp
@@ -63,7 +63,7 @@ namespace blink {
struct SameSizeAsInlineTextBox : public InlineBox {
unsigned variables[1];
unsigned short variables2[2];
- void* pointers[2];
+ void* pointers[3];
};
COMPILE_ASSERT(sizeof(InlineTextBox) == sizeof(SameSizeAsInlineTextBox), InlineTextBox_should_stay_small);
@@ -588,7 +588,8 @@ void InlineTextBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset,
startOffset = selectionEnd;
endOffset = selectionStart;
}
- textPainter.paint(startOffset, endOffset, length, textStyle);
+ bool textBlobIsCacheable = RuntimeEnabledFeatures::textBlobEnabled() && startOffset == 0 && endOffset == length;
+ textPainter.paint(startOffset, endOffset, length, textStyle, textBlobIsCacheable ? &m_textBlobCache : 0);
}
if ((paintSelectedTextOnly || paintSelectedTextSeparately) && selectionStart < selectionEnd) {

Powered by Google App Engine
This is Rietveld 408576698