Commit 7f6503d9 authored by Sergey Ulanov's avatar Sergey Ulanov Committed by Commit Bot

Reuse Android's gfx::GetFallbackFont() on Fuchsia

Android's implementation of GetFallbackFont() uses SkFontMgr , so it
works on Fuchsia as well. Moved it to a new font_fallback_skia.cc.
Also
1. Replaced font_render_params_fuchsia.cc and
   font_renderer_params_android.cc with font_render_params_skia.cc - the
   two implementations were almost identical.
2. Enabled test_fonts usage in gfx_unittests on Fuchsia.
3. Now all font-related unittests in gfx_unittests pass on Fuchsia.
   Updated test filter file accordingly.
4. Updated platform-specific ifdefs for some RenderText unittests to
   make them pass on Fuchsia.

Bug: 952652, 960389
Change-Id: I6bf14bfea7a1649b2ad795c0594265a6051cd7e3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1602286
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: default avatarEtienne Bergeron <etienneb@chromium.org>
Reviewed-by: default avatarAlexei Svitkine <asvitkine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#658715}
parent f08481dc
# https://crbug.com/952652 - Fail due to missing fonts.
-FontListTest.FirstAvailableOrFirst
-FontListTest.Fonts_*
-FontTest.LoadArial*
-FontTest.GetActualFontNameForTesting
-PlatformFontSkiaTest.DefaultFont
-RenderTextTest.HarfBuzz_BreakRunsByEmojiVariationSelectors
-RenderTextTest.HarfBuzz_FontListFallback
-RenderTextTest.HarfBuzz_UnicodeFallback
-RenderTextTest.SetFontList
-RenderTextTest.StringSizeBoldWidth
-RenderTextTest.StringSizeRespectsFontListMetrics
-RenderTextTest.StylePropagated
-RenderTextTest.SubpixelRenderingSuppressed
-RenderTextTest.TextDoesntClip
# https://crbug.com/952652 - GpuMemoryBufferHandle Mojo struct traits. # https://crbug.com/952652 - GpuMemoryBufferHandle Mojo struct traits.
-StructTraitsTest.GpuMemoryBufferHandle -StructTraitsTest.GpuMemoryBufferHandle
...@@ -69,7 +69,6 @@ jumbo_component("gfx") { ...@@ -69,7 +69,6 @@ jumbo_component("gfx") {
"font.cc", "font.cc",
"font.h", "font.h",
"font_fallback.h", "font_fallback.h",
"font_fallback_android.cc",
"font_fallback_linux.cc", "font_fallback_linux.cc",
"font_fallback_linux.h", "font_fallback_linux.h",
"font_fallback_mac.mm", "font_fallback_mac.mm",
...@@ -81,7 +80,6 @@ jumbo_component("gfx") { ...@@ -81,7 +80,6 @@ jumbo_component("gfx") {
"font_list_impl.h", "font_list_impl.h",
"font_render_params.cc", "font_render_params.cc",
"font_render_params.h", "font_render_params.h",
"font_render_params_android.cc",
"font_render_params_linux.cc", "font_render_params_linux.cc",
"font_render_params_mac.cc", "font_render_params_mac.cc",
"font_render_params_win.cc", "font_render_params_win.cc",
...@@ -299,6 +297,13 @@ jumbo_component("gfx") { ...@@ -299,6 +297,13 @@ jumbo_component("gfx") {
] ]
} }
if (is_android || is_fuchsia) {
sources += [
"font_fallback_skia.cc",
"font_render_params_skia.cc",
]
}
if (!is_ios) { if (!is_ios) {
sources += [ sources += [
"bidi_line_iterator.cc", "bidi_line_iterator.cc",
...@@ -363,13 +368,6 @@ jumbo_component("gfx") { ...@@ -363,13 +368,6 @@ jumbo_component("gfx") {
} else { } else {
sources -= [ "path_x11.cc" ] sources -= [ "path_x11.cc" ]
} }
if (is_fuchsia) {
sources += [
"font_fallback_fuchsia.cc",
"font_render_params_fuchsia.cc",
]
}
} }
jumbo_component("color_space") { jumbo_component("color_space") {
...@@ -666,7 +664,6 @@ test("gfx_unittests") { ...@@ -666,7 +664,6 @@ test("gfx_unittests") {
"color_space_unittest.cc", "color_space_unittest.cc",
"color_transform_unittest.cc", "color_transform_unittest.cc",
"color_utils_unittest.cc", "color_utils_unittest.cc",
"font_fallback_android_unittest.cc",
"font_fallback_linux_unittest.cc", "font_fallback_linux_unittest.cc",
"font_fallback_mac_unittest.cc", "font_fallback_mac_unittest.cc",
"font_list_unittest.cc", "font_list_unittest.cc",
...@@ -758,6 +755,10 @@ test("gfx_unittests") { ...@@ -758,6 +755,10 @@ test("gfx_unittests") {
deps += [ "//ui/android:ui_java" ] deps += [ "//ui/android:ui_java" ]
} }
if (is_android || is_fuchsia) {
sources += [ "font_fallback_skia_unittest.cc" ]
}
if (!use_aura && !is_ios) { if (!use_aura && !is_ios) {
sources -= [ "nine_image_painter_unittest.cc" ] sources -= [ "nine_image_painter_unittest.cc" ]
} }
...@@ -809,6 +810,10 @@ test("gfx_unittests") { ...@@ -809,6 +810,10 @@ test("gfx_unittests") {
sources += [ "linux/native_pixmap_dmabuf_unittest.cc" ] sources += [ "linux/native_pixmap_dmabuf_unittest.cc" ]
deps += [ "//third_party/fontconfig" ] deps += [ "//third_party/fontconfig" ]
} }
if (is_fuchsia) {
deps += [ "//skia:test_fonts" ]
}
} }
if (is_android) { if (is_android) {
......
...@@ -19,7 +19,8 @@ class Font; ...@@ -19,7 +19,8 @@ class Font;
// Given a font, returns the fonts that are suitable for fallback. // Given a font, returns the fonts that are suitable for fallback.
GFX_EXPORT std::vector<Font> GetFallbackFonts(const Font& font); GFX_EXPORT std::vector<Font> GetFallbackFonts(const Font& font);
#if defined(ANDROID) || defined(OS_MACOSX) || defined(OS_WIN) #if defined(ANDROID) || defined(OS_MACOSX) || defined(OS_WIN) || \
defined(OS_FUCHSIA)
// Finds a fallback font to render the specified |text| with respect to an // Finds a fallback font to render the specified |text| with respect to an
// initial |font|. Returns the resulting font via out param |result|. Returns // initial |font|. Returns the resulting font via out param |result|. Returns
...@@ -28,7 +29,7 @@ bool GFX_EXPORT GetFallbackFont(const Font& font, ...@@ -28,7 +29,7 @@ bool GFX_EXPORT GetFallbackFont(const Font& font,
base::StringPiece16 text, base::StringPiece16 text,
Font* result); Font* result);
#endif // ANDROID || OS_MACOSX || OS_WIN #endif // ANDROID || OS_MACOSX || OS_WIN || OS_FUCHSIA
} // namespace gfx } // namespace gfx
......
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/gfx/font_fallback.h"
#include <string>
#include <vector>
namespace gfx {
std::vector<Font> GetFallbackFonts(const Font& font) {
// TODO(fuchsia): Stubbed while bringing up headless build, see
// https://crbug.com/743296.
return std::vector<Font>();
}
} // namespace gfx
...@@ -7,9 +7,9 @@ ...@@ -7,9 +7,9 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "base/android/locale_utils.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/trace_event/trace_event.h" #include "base/trace_event/trace_event.h"
#include "build/build_config.h"
#include "third_party/icu/source/common/unicode/uchar.h" #include "third_party/icu/source/common/unicode/uchar.h"
#include "third_party/icu/source/common/unicode/uscript.h" #include "third_party/icu/source/common/unicode/uscript.h"
#include "third_party/icu/source/common/unicode/utf16.h" #include "third_party/icu/source/common/unicode/utf16.h"
...@@ -17,6 +17,10 @@ ...@@ -17,6 +17,10 @@
#include "third_party/skia/include/core/SkTypeface.h" #include "third_party/skia/include/core/SkTypeface.h"
#include "ui/gfx/font.h" #include "ui/gfx/font.h"
#if defined(OS_ANDROID)
#include "base/android/locale_utils.h"
#endif // defined(OS_ANDROID)
namespace gfx { namespace gfx {
std::vector<Font> GetFallbackFonts(const Font& font) { std::vector<Font> GetFallbackFonts(const Font& font) {
...@@ -31,8 +35,19 @@ bool GetFallbackFont(const Font& font, base::StringPiece16 text, Font* result) { ...@@ -31,8 +35,19 @@ bool GetFallbackFont(const Font& font, base::StringPiece16 text, Font* result) {
sk_sp<SkFontMgr> font_mgr(SkFontMgr::RefDefault()); sk_sp<SkFontMgr> font_mgr(SkFontMgr::RefDefault());
const char** bcp47_locales = nullptr;
int num_bcp_locals = 0;
// TODO(sergeyu): Specify bcp47 locale on all platforms. Ideally the locale
// should be passed here through gfx::RenderText.
#if defined(OS_ANDROID)
std::string locale = base::android::GetDefaultLocaleString(); std::string locale = base::android::GetDefaultLocaleString();
const char* bcp47_locales[] = {locale.c_str()}; const char* android_bcp47_locales[] = {locale.c_str()};
if (!locale.empty()) {
bcp47_locales = android_bcp47_locales;
num_bcp_locals = base::size(android_bcp47_locales);
}
#endif // defined(OS_ANDROID)
const int font_weight = (font.GetWeight() == Font::Weight::INVALID) const int font_weight = (font.GetWeight() == Font::Weight::INVALID)
? static_cast<int>(Font::Weight::NORMAL) ? static_cast<int>(Font::Weight::NORMAL)
...@@ -52,8 +67,7 @@ bool GetFallbackFont(const Font& font, base::StringPiece16 text, Font* result) { ...@@ -52,8 +67,7 @@ bool GetFallbackFont(const Font& font, base::StringPiece16 text, Font* result) {
U16_NEXT(text.data(), offset, text.length(), code_point); U16_NEXT(text.data(), offset, text.length(), code_point);
sk_sp<SkTypeface> typeface(font_mgr->matchFamilyStyleCharacter( sk_sp<SkTypeface> typeface(font_mgr->matchFamilyStyleCharacter(
font.GetFontName().c_str(), skia_style, font.GetFontName().c_str(), skia_style, bcp47_locales, num_bcp_locals,
locale.empty() ? nullptr : bcp47_locales, locale.empty() ? 0 : 1,
code_point)); code_point));
// If the typeface is not found or was already tested, skip it. // If the typeface is not found or was already tested, skip it.
if (!typeface || !tested_typeface.insert(typeface->uniqueID()).second) if (!typeface || !tested_typeface.insert(typeface->uniqueID()).second)
......
...@@ -14,13 +14,13 @@ namespace { ...@@ -14,13 +14,13 @@ namespace {
static const wchar_t* kFallbackFontTests[] = { static const wchar_t* kFallbackFontTests[] = {
L"\u0540\u0541", // Armenian, L"\u0540\u0541", // Armenian,
L"\u0631\u0632", // Arabic L"\u0631\u0632", // Arabic
L"\u0D21\u0D22", // Malayalam L"\u0915\u093f", // Devanagari
L"\u5203\u5204", // CJK Unified Ideograph L"\u5203\u5204", // CJK Unified Ideograph
}; };
} // namespace } // namespace
TEST(FontFallbackAndroidTest, EmptyStringFallback) { TEST(FontFallbackSkiaTest, EmptyStringFallback) {
Font base_font; Font base_font;
Font fallback_font; Font fallback_font;
bool result = bool result =
...@@ -28,7 +28,7 @@ TEST(FontFallbackAndroidTest, EmptyStringFallback) { ...@@ -28,7 +28,7 @@ TEST(FontFallbackAndroidTest, EmptyStringFallback) {
EXPECT_FALSE(result); EXPECT_FALSE(result);
} }
TEST(FontFallbackAndroidTest, FontFallback) { TEST(FontFallbackSkiaTest, FontFallback) {
for (const auto* test : kFallbackFontTests) { for (const auto* test : kFallbackFontTests) {
Font base_font; Font base_font;
Font fallback_font; Font fallback_font;
......
...@@ -22,7 +22,7 @@ Note that we have to support the full range from JellyBean to the latest ...@@ -22,7 +22,7 @@ Note that we have to support the full range from JellyBean to the latest
dessert. dessert.
*/ */
#if defined(OS_LINUX) #if defined(OS_LINUX) || defined(OS_FUCHSIA)
const char kTestFontName[] = "Arimo"; const char kTestFontName[] = "Arimo";
#elif defined(OS_ANDROID) #elif defined(OS_ANDROID)
const char kTestFontName[] = "sans-serif"; const char kTestFontName[] = "sans-serif";
...@@ -30,7 +30,7 @@ const char kTestFontName[] = "sans-serif"; ...@@ -30,7 +30,7 @@ const char kTestFontName[] = "sans-serif";
const char kTestFontName[] = "Arial"; const char kTestFontName[] = "Arial";
#endif #endif
#if defined(OS_LINUX) #if defined(OS_LINUX) || defined(OS_FUCHSIA)
const char kSymbolFontName[] = "DejaVu Sans"; const char kSymbolFontName[] = "DejaVu Sans";
#elif defined(OS_ANDROID) #elif defined(OS_ANDROID)
const char kSymbolFontName[] = "monospace"; const char kSymbolFontName[] = "monospace";
...@@ -40,7 +40,7 @@ const char kSymbolFontName[] = "Segoe UI Symbol"; ...@@ -40,7 +40,7 @@ const char kSymbolFontName[] = "Segoe UI Symbol";
const char kSymbolFontName[] = "Symbol"; const char kSymbolFontName[] = "Symbol";
#endif #endif
#if defined(OS_LINUX) #if defined(OS_LINUX) || defined(OS_FUCHSIA)
const char kCJKFontName[] = "Noto Sans CJK JP"; const char kCJKFontName[] = "Noto Sans CJK JP";
#elif defined(OS_ANDROID) #elif defined(OS_ANDROID)
const char kCJKFontName[] = "serif"; const char kCJKFontName[] = "serif";
......
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/gfx/font_render_params.h"
#include "base/logging.h"
#include "base/macros.h"
#include "base/no_destructor.h"
namespace gfx {
namespace {
// Returns the system's default settings.
FontRenderParams LoadDefaults() {
FontRenderParams params;
params.antialiasing = true;
params.autohinter = true;
params.use_bitmaps = true;
params.subpixel_rendering = FontRenderParams::SUBPIXEL_RENDERING_NONE;
params.subpixel_positioning = true;
params.hinting = FontRenderParams::HINTING_SLIGHT;
return params;
}
} // namespace
FontRenderParams GetFontRenderParams(const FontRenderParamsQuery& query,
std::string* family_out) {
if (family_out)
NOTIMPLEMENTED();
// Customized font rendering settings are not supported, only defaults.
static const base::NoDestructor<gfx::FontRenderParams> params(LoadDefaults());
return *params;
}
float GetFontRenderParamsDeviceScaleFactor() {
return 1.0;
}
} // namespace gfx
...@@ -1799,7 +1799,8 @@ void RenderTextHarfBuzz::ShapeRuns( ...@@ -1799,7 +1799,8 @@ void RenderTextHarfBuzz::ShapeRuns(
std::string preferred_fallback_family; std::string preferred_fallback_family;
#if defined(OS_ANDROID) || defined(OS_WIN) || defined(OS_MACOSX) #if defined(OS_ANDROID) || defined(OS_WIN) || defined(OS_MACOSX) || \
defined(OS_FUCHSIA)
Font fallback_font(primary_font); Font fallback_font(primary_font);
bool fallback_found; bool fallback_found;
{ {
...@@ -1820,7 +1821,7 @@ void RenderTextHarfBuzz::ShapeRuns( ...@@ -1820,7 +1821,7 @@ void RenderTextHarfBuzz::ShapeRuns(
if (runs.empty()) if (runs.empty())
return; return;
} }
#endif // OS_ANDROID || OS_WIN || OS_MACOSX #endif // OS_ANDROID || OS_WIN || OS_MACOSX || OS_FUCHSIA
std::vector<Font> fallback_font_list; std::vector<Font> fallback_font_list;
{ {
......
...@@ -2668,6 +2668,12 @@ TEST_F(RenderTextTest, StringSizeBoldWidth) { ...@@ -2668,6 +2668,12 @@ TEST_F(RenderTextTest, StringSizeBoldWidth) {
// TODO(mboc): Add some unittests for other weights (currently not // TODO(mboc): Add some unittests for other weights (currently not
// implemented because of test system font configuration). // implemented because of test system font configuration).
RenderText* render_text = GetRenderText(); RenderText* render_text = GetRenderText();
#if defined(OS_FUCHSIA)
// Increase font size to ensure that bold and regular styles differ in width.
render_text->SetFontList(FontList("Arial, 20px"));
#endif // defined(OS_FUCHSIA)
render_text->SetText(UTF8ToUTF16("Hello World")); render_text->SetText(UTF8ToUTF16("Hello World"));
const int plain_width = render_text->GetStringSize().width(); const int plain_width = render_text->GetStringSize().width();
...@@ -4306,8 +4312,6 @@ TEST_F(RenderTextTest, HarfBuzz_UnicodeFallback) { ...@@ -4306,8 +4312,6 @@ TEST_F(RenderTextTest, HarfBuzz_UnicodeFallback) {
// Ensure that the fallback fonts offered by GetFallbackFont() support glyphs // Ensure that the fallback fonts offered by GetFallbackFont() support glyphs
// for different languages. // for different languages.
// TODO(https://crbug.com/743296): Implements Fallback fonts on Fuchsia.
#if !defined(OS_FUCHSIA)
TEST_F(RenderTextTest, HarfBuzz_FallbackFontsSupportGlyphs) { TEST_F(RenderTextTest, HarfBuzz_FallbackFontsSupportGlyphs) {
// The word 'test' in different languages. // The word 'test' in different languages.
static const wchar_t* kLanguageTests[] = { static const wchar_t* kLanguageTests[] = {
...@@ -4328,13 +4332,9 @@ TEST_F(RenderTextTest, HarfBuzz_FallbackFontsSupportGlyphs) { ...@@ -4328,13 +4332,9 @@ TEST_F(RenderTextTest, HarfBuzz_FallbackFontsSupportGlyphs) {
} }
} }
} }
#endif // !defined(OS_FUCHSIA)
// Ensure that the fallback fonts offered by GetFallbackFont() support glyphs // Ensure that the fallback fonts offered by GetFallbackFont() support glyphs
// for different languages. // for different languages.
// TODO(https://crbug.com/743296): Implements Fallback fonts on Fuchsia.
#if !defined(OS_FUCHSIA)
TEST_F(RenderTextTest, HarfBuzz_MultiRunsSupportGlyphs) { TEST_F(RenderTextTest, HarfBuzz_MultiRunsSupportGlyphs) {
static const wchar_t* kLanguageTests[] = { static const wchar_t* kLanguageTests[] = {
L"www.اختبار.com", L"www.اختبار.com",
...@@ -4358,7 +4358,6 @@ TEST_F(RenderTextTest, HarfBuzz_MultiRunsSupportGlyphs) { ...@@ -4358,7 +4358,6 @@ TEST_F(RenderTextTest, HarfBuzz_MultiRunsSupportGlyphs) {
} }
} }
} }
#endif // !defined(OS_FUCHSIA)
// Ensure that the width reported by RenderText is sufficient for drawing. Draws // Ensure that the width reported by RenderText is sufficient for drawing. Draws
// to a canvas and checks if any pixel beyond the bounding rectangle is colored. // to a canvas and checks if any pixel beyond the bounding rectangle is colored.
...@@ -4419,39 +4418,23 @@ TEST_F(RenderTextTest, TextDoesntClip) { ...@@ -4419,39 +4418,23 @@ TEST_F(RenderTextTest, TextDoesntClip) {
} }
{ {
SCOPED_TRACE("TextDoesntClip Left Side"); SCOPED_TRACE("TextDoesntClip Left Side");
#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || \ // TODO(dschuyler): Smoothing draws to the left of text. This appears to
defined(OS_ANDROID) || defined(ARCH_CPU_MIPS_FAMILY) // be a preexisting issue that wasn't revealed by the prior unit tests.
// TODO(dschuyler): On Windows, Chrome OS, Linux, Android, and Mac // RenderText currently only uses origins and advances and ignores
// smoothing draws to the left of text. This appears to be a preexisting // bounding boxes so cannot account for under- and over-hang.
// issue that wasn't revealed by the prior unit tests. RenderText
// currently only uses origins and advances and ignores bounding boxes so
// cannot account for under- and over-hang.
rect_buffer.EnsureSolidRect(SK_ColorWHITE, 0, kTestSize, kTestSize - 1, rect_buffer.EnsureSolidRect(SK_ColorWHITE, 0, kTestSize, kTestSize - 1,
string_size.height()); string_size.height());
#else
rect_buffer.EnsureSolidRect(SK_ColorWHITE, 0, kTestSize, kTestSize,
string_size.height());
#endif
} }
{ {
SCOPED_TRACE("TextDoesntClip Right Side"); SCOPED_TRACE("TextDoesntClip Right Side");
#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || \ // TODO(dschuyler): Smoothing draws to the right of text. This appears to
defined(OS_ANDROID) || defined(ARCH_CPU_MIPS_FAMILY) // be a preexisting issue that wasn't revealed by the prior unit tests.
// TODO(dschuyler): On Windows, Chrome OS, Linux, Android, and Mac // RenderText currently only uses origins and advances and ignores
// smoothing draws to the right of text. This appears to be a preexisting // bounding boxes so cannot account for under- and over-hang.
// issue that wasn't revealed by the prior unit tests. RenderText
// currently only uses origins and advances and ignores bounding boxes so
// cannot account for under- and over-hang.
rect_buffer.EnsureSolidRect(SK_ColorWHITE, rect_buffer.EnsureSolidRect(SK_ColorWHITE,
kTestSize + string_size.width() + 1, kTestSize + string_size.width() + 1,
kTestSize, kTestSize - 1, kTestSize, kTestSize - 1,
string_size.height()); string_size.height());
#else
rect_buffer.EnsureSolidRect(SK_ColorWHITE,
kTestSize + string_size.width(),
kTestSize, kTestSize,
string_size.height());
#endif
} }
} }
} }
...@@ -4572,7 +4555,7 @@ TEST_F(RenderTextTest, SubpixelRenderingSuppressed) { ...@@ -4572,7 +4555,7 @@ TEST_F(RenderTextTest, SubpixelRenderingSuppressed) {
render_text->SetText(UTF8ToUTF16("x")); render_text->SetText(UTF8ToUTF16("x"));
DrawVisualText(); DrawVisualText();
#if defined(OS_LINUX) || defined(OS_ANDROID) #if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FUCHSIA)
// On Linux, whether subpixel AA is supported is determined by the platform // On Linux, whether subpixel AA is supported is determined by the platform
// FontConfig. Force it into a particular style after computing runs. Other // FontConfig. Force it into a particular style after computing runs. Other
// platforms use a known default FontRenderParams from a static local. // platforms use a known default FontRenderParams from a static local.
...@@ -4586,7 +4569,7 @@ TEST_F(RenderTextTest, SubpixelRenderingSuppressed) { ...@@ -4586,7 +4569,7 @@ TEST_F(RenderTextTest, SubpixelRenderingSuppressed) {
render_text->set_subpixel_rendering_suppressed(true); render_text->set_subpixel_rendering_suppressed(true);
DrawVisualText(); DrawVisualText();
#if defined(OS_LINUX) || defined(OS_ANDROID) #if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FUCHSIA)
// For Linux, runs shouldn't be re-calculated, and the suppression of the // For Linux, runs shouldn't be re-calculated, and the suppression of the
// SUBPIXEL_RENDERING_RGB set above should now take effect. But, after // SUBPIXEL_RENDERING_RGB set above should now take effect. But, after
// checking, apply the override anyway to be explicit that it is suppressed. // checking, apply the override anyway to be explicit that it is suppressed.
......
...@@ -26,6 +26,10 @@ ...@@ -26,6 +26,10 @@
#include "mojo/core/embedder/embedder.h" // nogncheck #include "mojo/core/embedder/embedder.h" // nogncheck
#endif #endif
#if defined(OS_FUCHSIA)
#include "skia/ext/test_fonts.h" // nogncheck
#endif
namespace { namespace {
class GfxTestSuite : public base::TestSuite { class GfxTestSuite : public base::TestSuite {
...@@ -50,6 +54,10 @@ class GfxTestSuite : public base::TestSuite { ...@@ -50,6 +54,10 @@ class GfxTestSuite : public base::TestSuite {
#if defined(OS_WIN) #if defined(OS_WIN)
gfx::win::InitializeDirectWrite(); gfx::win::InitializeDirectWrite();
#endif #endif
#if defined(OS_FUCHSIA)
skia::ConfigureTestFont();
#endif
} }
void Shutdown() override { void Shutdown() override {
......
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