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

Unified Diff: src/ports/SkFontConfigInterfaceDirect.h

Issue 1471033002: Fix Google3 fonts. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Fix BUILD.public, remove virtual from private method. Created 5 years, 1 month 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: src/ports/SkFontConfigInterfaceDirect.h
diff --git a/src/ports/SkFontConfigInterfaceDirect.h b/src/ports/SkFontConfigInterfaceDirect.h
new file mode 100644
index 0000000000000000000000000000000000000000..450a3f0c318cd0dfe5427bc6320a8a7cbaea1599
--- /dev/null
+++ b/src/ports/SkFontConfigInterfaceDirect.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2009-2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+/* migrated from chrome/src/skia/ext/SkFontHost_fontconfig_direct.cpp */
+
+#include "SkFontConfigInterface.h"
+#include "SkMutex.h"
+
+#include <fontconfig/fontconfig.h>
bungeman-skia 2015/11/30 17:54:40 Can this just be forward declarations, like struc
dogben 2015/11/30 18:20:21 FcPattern is a typedef. Is there a way to forward-
bungeman-skia 2015/11/30 18:25:39 Ah, yes, ick. Ok, we can leave this alone then.
+
+class SkFontConfigInterfaceDirect : public SkFontConfigInterface {
+public:
+ SkFontConfigInterfaceDirect();
+ ~SkFontConfigInterfaceDirect() override;
+
+ bool matchFamilyName(const char familyName[],
+ SkTypeface::Style requested,
+ FontIdentity* outFontIdentifier,
+ SkString* outFamilyName,
+ SkTypeface::Style* outStyle) override;
+ SkStreamAsset* openStream(const FontIdentity&) override;
+
+ // new APIs
+ SkDataTable* getFamilyNames() override;
+ bool matchFamilySet(const char inFamilyName[],
+ SkString* outFamilyName,
+ SkTArray<FontIdentity>*) override;
+
+protected:
+ virtual bool isAccessible(const char* filename);
bungeman-skia 2015/11/30 17:54:40 As documentation, isAccessible should be private.
dogben 2015/11/30 18:20:21 I called it in src/ports/SkFontConfigInterface_dir
bungeman-skia 2015/11/30 18:25:40 Ah, I see. The code before just defined out the 'a
+
+private:
+ SkMutex mutex_;
+
+ bool isValidPattern(FcPattern* pattern);
+ FcPattern* MatchFont(FcFontSet* font_set, const char* post_config_family,
+ const SkString& family);
+ typedef SkFontConfigInterface INHERITED;
+};

Powered by Google App Engine
This is Rietveld 408576698