Index: ui/gfx/render_text.cc |
diff --git a/ui/gfx/render_text.cc b/ui/gfx/render_text.cc |
index bf98bc0cde55524f3fba35a8657a9f3bf99e8600..3b6cf09043bdc1e4e50547776b0a55cd676f9000 100644 |
--- a/ui/gfx/render_text.cc |
+++ b/ui/gfx/render_text.cc |
@@ -396,13 +396,22 @@ RenderText* RenderText::CreateInstance() { |
#if defined(OS_MACOSX) && defined(TOOLKIT_VIEWS) |
// Use the more complete HarfBuzz implementation for Views controls on Mac. |
return new RenderTextHarfBuzz; |
+#endif |
+ |
+#if defined(OS_LINUX) |
msw
2014/10/07 18:29:01
nit: elif?
Daniel Erat
2014/10/08 02:03:43
sure, done
|
+ // RenderTextPango has severe performance issues (http://crbug.com/376077), so |
+ // default to RenderTextHarfBuzz on Linux (and Chrome OS). |
+ if (!CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kDisableHarfBuzzRenderText)) { |
+ return new RenderTextHarfBuzz; |
+ } |
#else |
if (CommandLine::ForCurrentProcess()->HasSwitch( |
switches::kEnableHarfBuzzRenderText)) { |
return new RenderTextHarfBuzz; |
} |
- return CreateNativeInstance(); |
#endif |
+ return CreateNativeInstance(); |
msw
2014/10/07 18:29:01
nit q: will this trigger unreachable code warnings
Daniel Erat
2014/10/08 02:03:43
good point. i think that nested ifdefs are pretty
|
} |
void RenderText::SetText(const base::string16& text) { |