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

Unified Diff: components/font_service/public/cpp/font_service_thread.cc

Issue 1877673002: Move legacyCreateTypeface to SkFontStyle. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove DEPS change now that Skia change has landed. Created 4 years, 8 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
Index: components/font_service/public/cpp/font_service_thread.cc
diff --git a/components/font_service/public/cpp/font_service_thread.cc b/components/font_service/public/cpp/font_service_thread.cc
index d5c361895bf51e3acde72ec80c73374ab4165501..496d41510e433844e6f36a3d37c18c8290fe0981 100644
--- a/components/font_service/public/cpp/font_service_thread.cc
+++ b/components/font_service/public/cpp/font_service_thread.cc
@@ -31,10 +31,10 @@ FontServiceThread::FontServiceThread(FontServicePtr font_service)
bool FontServiceThread::MatchFamilyName(
const char family_name[],
- SkTypeface::Style requested_style,
+ SkFontStyle requested_style,
SkFontConfigInterface::FontIdentity* out_font_identity,
SkString* out_family_name,
- SkTypeface::Style* out_style) {
+ SkFontStyle* out_style) {
DCHECK_NE(GetThreadId(), base::PlatformThread::CurrentId());
bool out_valid = false;
@@ -85,15 +85,20 @@ FontServiceThread::~FontServiceThread() {
void FontServiceThread::MatchFamilyNameImpl(
base::WaitableEvent* done_event,
const char family_name[],
- SkTypeface::Style requested_style,
+ SkFontStyle requested_style,
bool* out_valid,
SkFontConfigInterface::FontIdentity* out_font_identity,
SkString* out_family_name,
- SkTypeface::Style* out_style) {
+ SkFontStyle* out_style) {
DCHECK_EQ(GetThreadId(), base::PlatformThread::CurrentId());
+ TypefaceStylePtr style(TypefaceStyle::New());
+ style->weight = requested_style.weight();
+ style->width = requested_style.width();
+ style->slant = static_cast<TypefaceSlant>(requested_style.slant());
+
font_service_->MatchFamilyName(
- mojo::String(family_name), static_cast<TypefaceStyle>(requested_style),
+ mojo::String(family_name), std::move(style),
base::Bind(&FontServiceThread::OnMatchFamilyNameComplete, this,
done_event, out_valid, out_font_identity, out_family_name,
out_style));
@@ -104,10 +109,10 @@ void FontServiceThread::OnMatchFamilyNameComplete(
bool* out_valid,
SkFontConfigInterface::FontIdentity* out_font_identity,
SkString* out_family_name,
- SkTypeface::Style* out_style,
+ SkFontStyle* out_style,
FontIdentityPtr font_identity,
mojo::String family_name,
- TypefaceStyle style) {
+ TypefaceStylePtr style) {
DCHECK_EQ(GetThreadId(), base::PlatformThread::CurrentId());
*out_valid = font_identity;
@@ -119,7 +124,9 @@ void FontServiceThread::OnMatchFamilyNameComplete(
// behaviour of the current Linux IPC version.
*out_family_name = family_name.data();
- *out_style = static_cast<SkTypeface::Style>(style);
+ *out_style = SkFontStyle(style->weight,
+ style->width,
+ static_cast<SkFontStyle::Slant>(style->slant));
}
done_event->Signal();
« no previous file with comments | « components/font_service/public/cpp/font_service_thread.h ('k') | components/font_service/public/interfaces/font_service.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698