Commit 03715bca authored by Etienne Bergeron's avatar Etienne Bergeron Committed by Commit Bot

Turn on by default platform font skia on windows.

The PlatformFontSkiaOnWindows is changing the use of
PlatformFontWin by PlatformFontSkia.
The experiment is deployed on canary and dev.

This CL setting the default state of the experiment to
enroll user in the PlatformFontSkia group.

The legacy code (PlatformFontWin_ is kept as a kill-switch
and will be remove soon.


Bug: 944227
Change-Id: Ib32f2fdee225650d6f0728c2f791d358857f853c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1888314Reviewed-by: default avatarMichael Wasserman <msw@chromium.org>
Reviewed-by: default avatarAlexei Svitkine <asvitkine@chromium.org>
Commit-Queue: Etienne Bergeron <etienneb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711332}
parent e1d08ca3
......@@ -29,6 +29,7 @@
#include "base/win/win_util.h"
#include "base/win/windows_version.h"
#include "ui/display/win/dpi.h"
#include "ui/gfx/platform_font_win.h"
#include "ui/gfx/system_fonts_win.h"
#endif
......@@ -159,7 +160,15 @@ TEST_F(LayoutProviderTest, MAYBE_LegacyFontSizeConstants) {
EXPECT_EQ(11, title_font.GetCapHeight());
#endif
#if defined(OS_WIN)
if (base::FeatureList::IsEnabled(gfx::kPlatformFontSkiaOnWindows)) {
EXPECT_EQ(7, title_font.GetExpectedTextWidth(1));
} else {
EXPECT_EQ(8, title_font.GetExpectedTextWidth(1));
}
#else
EXPECT_EQ(8, title_font.GetExpectedTextWidth(1));
#endif
gfx::FontList small_font = rb.GetFontList(ui::ResourceBundle::SmallFont);
gfx::FontList base_font = rb.GetFontList(ui::ResourceBundle::BaseFont);
......
......@@ -4633,21 +4633,6 @@
]
}
],
"PlatformFontSkiaOnWindows": [
{
"platforms": [
"windows"
],
"experiments": [
{
"name": "Enabled",
"enable_features": [
"PlatformFontSkiaOnWindows"
]
}
]
}
],
"PolicyAtomicGroup": [
{
"platforms": [
......
......@@ -43,10 +43,6 @@
namespace {
// Enable the use of PlatformFontSkia instead of PlatformFontWin.
const base::Feature kPlatformFontSkiaOnWindows{
"PlatformFontSkiaOnWindows", base::FEATURE_DISABLED_BY_DEFAULT};
// Sets style properties on |font_info| based on |font_style|.
void SetLogFontStyle(int font_style, LOGFONT* font_info) {
font_info->lfUnderline = (font_style & gfx::Font::UNDERLINE) != 0;
......@@ -239,6 +235,10 @@ HRESULT GetMatchingDirectWriteFont(LOGFONT* font_info,
namespace gfx {
// Enable the use of PlatformFontSkia instead of PlatformFontWin.
const base::Feature kPlatformFontSkiaOnWindows{
"PlatformFontSkiaOnWindows", base::FEATURE_ENABLED_BY_DEFAULT};
// static
PlatformFontWin::HFontRef* PlatformFontWin::base_font_ref_;
......
......@@ -10,6 +10,7 @@
#include <string>
#include "base/compiler_specific.h"
#include "base/feature_list.h"
#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
......@@ -22,6 +23,9 @@ struct IDWriteFont;
namespace gfx {
// Deprecation of PlatformFontWin (See http://crbug.com/944227).
extern GFX_EXPORT const base::Feature kPlatformFontSkiaOnWindows;
class GFX_EXPORT PlatformFontWin : public PlatformFont {
public:
PlatformFontWin();
......
......@@ -146,8 +146,12 @@ TEST(PlatformFontWinTest, DefaultFontRenderParams) {
TEST(PlatformFontWinTest, SkiaTypefaceConstructor) {
gfx::Font default_font;
EXPECT_EQ(default_font.platform_font()->GetNativeSkTypefaceIfAvailable(),
nullptr);
// The PlatformFontWin constructor doesn't create a skia typeface.
if (!base::FeatureList::IsEnabled(kPlatformFontSkiaOnWindows)) {
EXPECT_EQ(default_font.platform_font()->GetNativeSkTypefaceIfAvailable(),
nullptr);
}
sk_sp<SkFontMgr> font_mgr = SkFontMgr::RefDefault();
sk_sp<SkTypeface> typeface(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment