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

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

Issue 23455024: Move ownership of the TextResourceDecoder to DecodedDataDocumentParser (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 7 years, 1 month 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/loader/TextResourceDecoderBuilder.cpp ('k') | Source/core/xml/XSLTProcessor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderText.cpp
diff --git a/Source/core/rendering/RenderText.cpp b/Source/core/rendering/RenderText.cpp
index 8fcee94eb5b0906b30294a4480352e5e67b099f0..b6473b6491904623c4e1a4edfe7bd96106ed3e48 100644
--- a/Source/core/rendering/RenderText.cpp
+++ b/Source/core/rendering/RenderText.cpp
@@ -184,6 +184,12 @@ bool RenderText::isWordBreak() const
return false;
}
+void RenderText::updateNeedsTranscoding()
+{
+ const WTF::TextEncoding* encoding = document()->encoding().isValid() ? &document()->encoding() : 0;
+ m_needsTranscoding = fontTranscoder().needsTranscoding(style()->font().fontDescription(), encoding);
+}
+
void RenderText::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
{
// There is no need to ever schedule repaints from a style change of a text run, since
@@ -1328,6 +1334,11 @@ void RenderText::setTextInternal(PassRefPtr<StringImpl> text)
{
ASSERT(text);
m_text = text;
+ if (m_needsTranscoding) {
+ const WTF::TextEncoding* encoding = document()->encoding().isValid() ? &document()->encoding() : 0;
+ fontTranscoder().convert(m_text, style()->font().fontDescription(), encoding);
+ }
+ ASSERT(m_text);
if (style()) {
applyTextTransform(style(), m_text, previousCharacter());
« no previous file with comments | « Source/core/loader/TextResourceDecoderBuilder.cpp ('k') | Source/core/xml/XSLTProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698