summaryrefslogtreecommitdiffstats
path: root/ui/gfx
diff options
context:
space:
mode:
authorandresantoso@chromium.org <andresantoso@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-11 11:02:02 +0000
committerandresantoso@chromium.org <andresantoso@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-11 11:02:02 +0000
commita0d10ec016075bbf64eecc5f1729a269ec7109ec (patch)
treea415ac56fbf2039bd7d792ed34bf9bde681a7fad /ui/gfx
parente34fb320f34df37346006edf356b35689930d87c (diff)
downloadchromium_src-a0d10ec016075bbf64eecc5f1729a269ec7109ec.zip
chromium_src-a0d10ec016075bbf64eecc5f1729a269ec7109ec.tar.gz
chromium_src-a0d10ec016075bbf64eecc5f1729a269ec7109ec.tar.bz2
MacViews: Enable RenderTextHarfBuzz to get Textfields to work.
Textfields require RenderTextHarfBuzz to work properly on the Mac because RenderTextMac's implementation is not complete. But RenderTextMac is used by the Cocoa UI to perform string sizing and elliding, HarfBuzz will not give the same answers. So for now we turn on HarfBuzz conditionally on OS_MACOSX and TOOLKIT_VIEWS. TextFieldModel and StyledLabel unit tests now pass without failures. BUG=378134 Review URL: https://codereview.chromium.org/326093004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276341 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx')
-rw-r--r--ui/gfx/render_text.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/ui/gfx/render_text.cc b/ui/gfx/render_text.cc
index 72a8c7a..9b17208 100644
--- a/ui/gfx/render_text.cc
+++ b/ui/gfx/render_text.cc
@@ -412,11 +412,16 @@ RenderText::~RenderText() {
}
RenderText* RenderText::CreateInstance() {
+#if defined(OS_MACOSX) && defined(TOOLKIT_VIEWS)
+ // Use the more complete HarfBuzz implementation for Views controls on Mac.
+ return new RenderTextHarfBuzz;
+#else
if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableHarfBuzzRenderText)) {
return new RenderTextHarfBuzz;
}
return CreateNativeInstance();
+#endif
}
void RenderText::SetText(const base::string16& text) {