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

Side by Side Diff: components/font_service/public/cpp/font_loader.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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/font_service/public/cpp/font_loader.h" 5 #include "components/font_service/public/cpp/font_loader.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
11 #include "components/font_service/public/cpp/font_service_thread.h" 11 #include "components/font_service/public/cpp/font_service_thread.h"
12 #include "mojo/shell/public/cpp/connector.h" 12 #include "mojo/shell/public/cpp/connector.h"
13 13
14 namespace font_service { 14 namespace font_service {
15 15
16 FontLoader::FontLoader(mojo::Connector* connector) { 16 FontLoader::FontLoader(mojo::Connector* connector) {
17 FontServicePtr font_service; 17 FontServicePtr font_service;
18 connector->ConnectToInterface("mojo:font_service", &font_service); 18 connector->ConnectToInterface("mojo:font_service", &font_service);
19 thread_ = new internal::FontServiceThread(std::move(font_service)); 19 thread_ = new internal::FontServiceThread(std::move(font_service));
20 } 20 }
21 21
22 FontLoader::~FontLoader() {} 22 FontLoader::~FontLoader() {}
23 23
24 void FontLoader::Shutdown() { 24 void FontLoader::Shutdown() {
25 thread_->Stop(); 25 thread_->Stop();
26 thread_ = nullptr; 26 thread_ = nullptr;
27 } 27 }
28 28
29 bool FontLoader::matchFamilyName(const char family_name[], 29 bool FontLoader::matchFamilyName(const char family_name[],
30 SkTypeface::Style requested, 30 SkFontStyle requested,
31 FontIdentity* out_font_identifier, 31 FontIdentity* out_font_identifier,
32 SkString* out_family_name, 32 SkString* out_family_name,
33 SkTypeface::Style* out_style) { 33 SkFontStyle* out_style) {
34 TRACE_EVENT1("font_service", "FontServiceThread::MatchFamilyName", 34 TRACE_EVENT1("font_service", "FontServiceThread::MatchFamilyName",
35 "family_name", family_name); 35 "family_name", family_name);
36 return thread_->MatchFamilyName(family_name, requested, out_font_identifier, 36 return thread_->MatchFamilyName(family_name, requested, out_font_identifier,
37 out_family_name, out_style); 37 out_family_name, out_style);
38 } 38 }
39 39
40 SkStreamAsset* FontLoader::openStream(const FontIdentity& identity) { 40 SkStreamAsset* FontLoader::openStream(const FontIdentity& identity) {
41 TRACE_EVENT2("font_loader", "FontLoader::openStream", 41 TRACE_EVENT2("font_loader", "FontLoader::openStream",
42 "identity", identity.fID, 42 "identity", identity.fID,
43 "name", identity.fString.c_str()); 43 "name", identity.fString.c_str());
(...skipping 23 matching lines...) Expand all
67 } 67 }
68 68
69 void FontLoader::OnMappedFontFileDestroyed(internal::MappedFontFile* f) { 69 void FontLoader::OnMappedFontFileDestroyed(internal::MappedFontFile* f) {
70 TRACE_EVENT1("font_loader", "FontLoader::OnMappedFontFileDestroyed", 70 TRACE_EVENT1("font_loader", "FontLoader::OnMappedFontFileDestroyed",
71 "identity", f->font_id()); 71 "identity", f->font_id());
72 base::AutoLock lock(lock_); 72 base::AutoLock lock(lock_);
73 mapped_font_files_.erase(f->font_id()); 73 mapped_font_files_.erase(f->font_id());
74 } 74 }
75 75
76 } // namespace font_service 76 } // namespace font_service
OLDNEW
« no previous file with comments | « components/font_service/public/cpp/font_loader.h ('k') | components/font_service/public/cpp/font_service_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698