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

Unified Diff: ui/gfx/render_text.cc

Issue 630583002: Enable HarfBuzz by default everywhere except CrOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: disable on cros Created 6 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/render_text.cc
diff --git a/ui/gfx/render_text.cc b/ui/gfx/render_text.cc
index bf98bc0cde55524f3fba35a8657a9f3bf99e8600..3101c0455ca6c10b22d36698d5b95c8f24cc01a2 100644
--- a/ui/gfx/render_text.cc
+++ b/ui/gfx/render_text.cc
@@ -27,6 +27,10 @@
#include "ui/gfx/text_utils.h"
#include "ui/gfx/utf16_indexing.h"
+#if defined(OS_WIN)
+#include "base/win/windows_version.h"
+#endif
+
namespace gfx {
namespace {
@@ -393,16 +397,20 @@ 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;
+#if defined(OS_WIN)
+ bool default_is_harfbuzz = base::win::OSInfo::GetInstance()->version() <=
+ base::win::Version::VERSION_WIN8;
msw 2014/10/05 17:58:21 Are you sure the sizing problem only affects windo
ckocagil 2014/10/15 19:50:44 This should be fixed on both as of https://crrev.c
+#elif defined(OS_CHROMEOS)
+ bool default_is_harfbuzz = false;
msw 2014/10/05 17:58:21 What is the chrome os blocker(s)? Add a comment re
ckocagil 2014/10/15 19:50:44 Done.
#else
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableHarfBuzzRenderText)) {
- return new RenderTextHarfBuzz;
- }
- return CreateNativeInstance();
+ bool default_is_harfbuzz = true;
#endif
+
+ if (!default_is_harfbuzz || CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableHarfBuzzRenderText)) {
+ return CreateNativeInstance();
+ }
+ return new RenderTextHarfBuzz;
}
void RenderText::SetText(const base::string16& text) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698