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

Unified Diff: Source/core/platform/graphics/mac/ComplexTextController.cpp

Issue 68483006: Remove ComplexTextController dependency on core (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Try one more time 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/platform/graphics/Font.cpp ('k') | Source/core/rendering/line/BreakingContextInlineHeaders.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/platform/graphics/mac/ComplexTextController.cpp
diff --git a/Source/core/platform/graphics/mac/ComplexTextController.cpp b/Source/core/platform/graphics/mac/ComplexTextController.cpp
index 8b149f730816ff816f2fcf401d2a068617f2d367..9e34f8a5d853411e3ca58adf2f58149a9f091817 100644
--- a/Source/core/platform/graphics/mac/ComplexTextController.cpp
+++ b/Source/core/platform/graphics/mac/ComplexTextController.cpp
@@ -27,8 +27,6 @@
#include <ApplicationServices/ApplicationServices.h>
#include "core/platform/graphics/Font.h"
-#include "core/rendering/RenderBlockFlow.h"
-#include "core/rendering/RenderText.h"
#include "platform/geometry/FloatSize.h"
#include "platform/graphics/TextRun.h"
#include "platform/text/TextBreakIterator.h"
@@ -41,15 +39,14 @@ namespace WebCore {
class TextLayout {
public:
- static bool isNeeded(RenderText* text, const Font& font)
+ static bool isNeeded(const TextRun& run, const Font& font)
{
- TextRun run = RenderBlockFlow::constructTextRun(text, font, text, text->style());
return font.codePath(run) == Font::Complex;
}
- TextLayout(RenderText* text, const Font& font, float xPos)
+ TextLayout(const TextRun& run, unsigned textLength, const Font& font, float xPos)
: m_font(font)
- , m_run(constructTextRun(text, font, xPos))
+ , m_run(constructTextRun(run, textLength, font, xPos))
, m_controller(adoptPtr(new ComplexTextController(&m_font, m_run, true)))
{
}
@@ -66,10 +63,10 @@ public:
}
private:
- static TextRun constructTextRun(RenderText* text, const Font& font, float xPos)
+ static TextRun constructTextRun(const TextRun& textRun, unsigned textLength, const Font& font, float xPos)
{
- TextRun run = RenderBlockFlow::constructTextRun(text, font, text, text->style());
- run.setCharactersLength(text->textLength());
+ TextRun run = textRun;
+ run.setCharactersLength(textLength);
ASSERT(run.charactersLength() >= run.length());
run.setXPos(xPos);
@@ -82,11 +79,11 @@ private:
OwnPtr<ComplexTextController> m_controller;
};
-PassOwnPtr<TextLayout> Font::createLayout(RenderText* text, float xPos, bool collapseWhiteSpace) const
+PassOwnPtr<TextLayout> Font::createLayoutForMacComplexText(const TextRun& run, unsigned textLength, float xPos, bool collapseWhiteSpace) const
{
- if (!collapseWhiteSpace || !TextLayout::isNeeded(text, *this))
+ if (!collapseWhiteSpace || !TextLayout::isNeeded(run, *this))
return nullptr;
- return adoptPtr(new TextLayout(text, *this, xPos));
+ return adoptPtr(new TextLayout(run, textLength, *this, xPos));
}
void Font::deleteLayout(TextLayout* layout)
« no previous file with comments | « Source/core/platform/graphics/Font.cpp ('k') | Source/core/rendering/line/BreakingContextInlineHeaders.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698