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

Unified Diff: content/common/fontmgr_proxy.cc

Issue 132113015: IPC interface for font management. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Checkpoint Created 6 years, 9 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: content/common/fontmgr_proxy.cc
===================================================================
--- content/common/fontmgr_proxy.cc (revision 0)
+++ content/common/fontmgr_proxy.cc (working copy)
@@ -0,0 +1,78 @@
+// Copyright (c) 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 "base/values.h"
+#include "content/common/fontmgr_messages.h"
+#include "content/common/fontmgr_proxy.h"
+#include "content/renderer/render_thread_impl.h"
+#include "third_party/skia/include/core/SkDataTable.h"
+#include "third_party/skia/include/core/SkStream.h"
+#include "third_party/skia/include/ports/SkFontMgr_indirect.h"
+
+namespace content {
+
+SkDataTable* FontMgrProxy::getFamilyNames() const {
+ skia::RefPtr<SkDataTable> familyNames;
+ content::RenderThreadImpl::current()->Send(
+ new FontMsg_GetFamilyNames(FontMsgStart, &familyNames));
+ return SkSafeRef(familyNames.get());
+}
+
+SkRemotableFontIdentitySet* FontMgrProxy::getIndexIdentities(
+ int familyIndex) const
+{
+ skia::RefPtr<SkRemotableFontIdentitySet> identities;
+ content::RenderThreadImpl::current()->Send(
+ new FontMsg_GetIndexIdentities(FontMsgStart, familyIndex, &identities));
+ return SkSafeRef(identities.get());
+}
+
+SkFontIdentity FontMgrProxy::matchIndexStyle(
+ int familyIndex, const SkFontStyle& style) const
+{
+ SkFontIdentity identity;
+ content::RenderThreadImpl::current()->Send(
+ new FontMsg_MatchIndexStyle(FontMsgStart, familyIndex, style, &identity));
+ return identity;
+}
+
+SkRemotableFontIdentitySet* FontMgrProxy::matchName(
+ const char familyName[]) const
+{
+ skia::RefPtr<SkRemotableFontIdentitySet> identities;
+ content::RenderThreadImpl::current()->Send(
+ new FontMsg_MatchName(FontMsgStart, SkString(familyName), &identities));
+ return SkSafeRef(identities.get());
+}
+
+SkFontIdentity FontMgrProxy::matchNameStyle(
+ const char familyName[], const SkFontStyle& style) const
+{
+ SkFontIdentity identity;
+ content::RenderThreadImpl::current()->Send(
+ new FontMsg_MatchNameStyle(FontMsgStart, SkString(familyName), style,
+ &identity));
+ return identity;
+}
+
+SkFontIdentity FontMgrProxy::matchNameStyleCharacter(
+ const char familyName[], const SkFontStyle& style,
+ const char bpc47[], uint32_t character) const
+{
+ SkFontIdentity identity;
+ content::RenderThreadImpl::current()->Send(
+ new FontMsg_MatchNameStyleCharacter(FontMsgStart, SkString(familyName),
+ style, SkString(bpc47), character,
+ &identity));
+ return identity;
+}
+
+SkStream* FontMgrProxy::getData(int dataId) const {
+ skia::RefPtr<SkStream> stream;
+ content::RenderThreadImpl::current()->Send(
+ new FontMsg_GetData(FontMsgStart, dataId, &stream));
+ return SkSafeRef(stream.get());
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698