Commit db6633b3 authored by Wei-Yin Chen (陳威尹)'s avatar Wei-Yin Chen (陳威尹) Committed by Commit Bot

Use Linux fonts impl on Android

Right now Android build uses platform_font_linux if the VR
support is enabled. VR support is enabled on all Android ARM
builds (see |enable_gvr_services| and crbug/733935).

We'd like to use RenderText in compositor UI, so this CL
makes all Android builds use platform_font_linux, regardless
of whether VR is enabled.

This only affects non-ARM Android builds.

Bug: 853281, 642010
Change-Id: I843c53964f1af932ad9f00b67ac690c5b43916ab
Reviewed-on: https://chromium-review.googlesource.com/1142484
Commit-Queue: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
Reviewed-by: default avatarAlexei Svitkine <asvitkine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577324}
parent 51ad9a0f
......@@ -68,6 +68,7 @@ jumbo_component("gfx") {
"font.cc",
"font.h",
"font_fallback.h",
"font_fallback_android.cc",
"font_fallback_linux.cc",
"font_fallback_linux.h",
"font_fallback_mac.mm",
......@@ -139,7 +140,6 @@ jumbo_component("gfx") {
"path_x11.cc",
"path_x11.h",
"platform_font.h",
"platform_font_android.cc",
"platform_font_ios.h",
"platform_font_ios.mm",
"platform_font_linux.cc",
......@@ -170,7 +170,6 @@ jumbo_component("gfx") {
"text_elider.h",
"text_utils.cc",
"text_utils.h",
"text_utils_android.cc",
"text_utils_ios.mm",
"ui_gfx_exports.cc",
"utf16_indexing.cc",
......@@ -203,7 +202,6 @@ jumbo_component("gfx") {
"blit.h",
"canvas.cc",
"canvas.h",
"canvas_notimplemented.cc",
"canvas_paint_mac.h",
"canvas_paint_mac.mm",
"canvas_skia.cc",
......@@ -261,7 +259,7 @@ jumbo_component("gfx") {
]
# Text rendering conditions (complicated so separated out).
if (use_aura || is_mac || (is_android && enable_vr) || is_fuchsia) {
if (use_aura || is_mac || is_android || is_fuchsia) {
# Mac doesn't use RenderTextHarfBuzz by default yet.
sources += [
"harfbuzz_font_skia.cc",
......@@ -283,11 +281,7 @@ jumbo_component("gfx") {
# We don't support RenderText on these platforms.
}
if (is_android && enable_vr) {
sources -= [
"platform_font_android.cc",
"text_utils_android.cc",
]
if (is_android) {
set_sources_assignment_filter([])
sources += [
"platform_font_linux.cc",
......@@ -308,17 +302,6 @@ jumbo_component("gfx") {
# Android.
if (is_android) {
if (enable_vr) {
sources -= [ "canvas_notimplemented.cc" ]
sources += [ "font_fallback_android.cc" ]
} else {
sources -= [
"canvas_skia.cc",
"path.cc",
"selection_model.cc",
]
}
if (!is_debug) {
configs -= [ "//build/config/compiler:default_optimization" ]
configs += [ "//build/config/compiler:optimize_max" ]
......@@ -329,8 +312,6 @@ jumbo_component("gfx") {
"android",
"jnigraphics",
]
} else if (!is_ios) {
sources -= [ "canvas_notimplemented.cc" ]
}
if (!is_ios) {
......
// Copyright 2014 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/canvas.h"
#include "base/logging.h"
namespace gfx {
// static
void Canvas::SizeStringFloat(const base::string16& text,
const FontList& font_list,
float* width,
float* height,
int line_height,
int flags,
Typesetter Typesetter) {
NOTIMPLEMENTED();
}
void Canvas::DrawStringRectWithFlags(const base::string16& text,
const FontList& font_list,
SkColor color,
const Rect& text_bounds,
int flags) {
NOTIMPLEMENTED();
}
void Canvas::DrawFadedString(const base::string16& text,
const FontList& font_list,
SkColor color,
const Rect& display_rect,
int flags) {
NOTIMPLEMENTED();
}
} // namespace gfx
......@@ -117,7 +117,7 @@ GFX_EXPORT FontRenderParams GetFontRenderParams(
GFX_EXPORT void ClearFontRenderParamsCacheForTest();
#endif
#if defined(OS_LINUX) || (defined(OS_ANDROID) && BUILDFLAG(ENABLE_VR))
#if defined(OS_LINUX) || defined(OS_ANDROID)
// Gets the device scale factor to query the FontRenderParams.
GFX_EXPORT float GetFontRenderParamsDeviceScaleFactor();
......
// Copyright (c) 2012 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/platform_font.h"
#include "base/logging.h"
namespace gfx {
// static
PlatformFont* PlatformFont::CreateDefault() {
NOTIMPLEMENTED();
return NULL;
}
// static
PlatformFont* PlatformFont::CreateFromNameAndSize(const std::string& font_name,
int font_size) {
// If you implement this, enable FontTest.DeriveFont on Android,
// https://crbug.com/642010
NOTIMPLEMENTED();
return NULL;
}
} // namespace gfx
// Copyright 2013 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/text_utils.h"
#include "base/logging.h"
namespace gfx {
int GetStringWidth(const base::string16& text,
const FontList& font_list,
Typesetter typesetter) {
NOTIMPLEMENTED();
return 0;
}
float GetStringWidthF(const base::string16& text,
const FontList& font_list,
Typesetter typesetter) {
NOTIMPLEMENTED();
return 0;
}
} // namespace gfx
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