diff options
author | ananta <ananta@chromium.org> | 2014-11-03 18:05:51 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-04 02:06:08 +0000 |
commit | f2d0aaebeb1f0b390b62082f77176ee303942ffb (patch) | |
tree | 6c91f0deb401fb3fd9b068b66ff9fb21d6021b5b /content/browser/browser_main_runner.cc | |
parent | fe89e5a5a23f3323201d3586b2ec77174f042158 (diff) | |
download | chromium_src-f2d0aaebeb1f0b390b62082f77176ee303942ffb.zip chromium_src-f2d0aaebeb1f0b390b62082f77176ee303942ffb.tar.gz chromium_src-f2d0aaebeb1f0b390b62082f77176ee303942ffb.tar.bz2 |
Retrieve font metrics from skia if DirectWrite is enabled for font metrics calculations in the chrome browser UI.
The previous patch for getting the correct font metrics from DirectWrite https://codereview.chromium.org/692633003/
was wrong as it did not return the correct font metrics in all cases.
Getting the metrics from skia ensures that we get the same font metrics which would be used by skia for rendering.
Changes in this patch are as below:-
1. Removed DirectWrite factory code from PlatformFontWin. The PlatformFontWin::ConvertGDIFontToDirectWriteFont
function has been replaced by the CreateHFontRefFromSkia function. This function is called if DirectWrite is
enabled in the browser which sets a static bool on the PlatformFontWin class.
BUG=428645,427804,427802
Review URL: https://codereview.chromium.org/696913002
Cr-Commit-Position: refs/heads/master@{#302547}
Diffstat (limited to 'content/browser/browser_main_runner.cc')
-rw-r--r-- | content/browser/browser_main_runner.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/content/browser/browser_main_runner.cc b/content/browser/browser_main_runner.cc index e7381ae..4a74b6e 100644 --- a/content/browser/browser_main_runner.cc +++ b/content/browser/browser_main_runner.cc @@ -20,6 +20,7 @@ #include "ui/base/ime/input_method_initializer.h" #if defined(OS_WIN) +#include <dwrite.h> #include "base/win/win_util.h" #include "base/win/windows_version.h" #include "net/cert/sha256_legacy_support_win.h" @@ -140,7 +141,7 @@ void MaybeEnableDirectWriteFontRendering() { __uuidof(IDWriteFactory), reinterpret_cast<IUnknown**>(&factory)))); SetDefaultSkiaFactory(SkFontMgr_New_DirectWrite(factory)); - gfx::PlatformFontWin::set_direct_write_factory(factory); + gfx::PlatformFontWin::set_use_skia_for_font_metrics(true); } } |