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

Side by Side Diff: src/ports/SkFontConfigTypeface.h

Issue 15111004: Move the FontConfigTypeface class into private header. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/ports/SkFontHost_fontconfig.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2013 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "SkFontConfigInterface.h"
9 #include "SkFontHost_FreeType_common.h"
10 #include "SkTypefaceCache.h"
11
12 class SkFontDescriptor;
13 class SkStream;
14
15 class FontConfigTypeface : public SkTypeface_FreeType {
16 SkFontConfigInterface::FontIdentity fIdentity;
17 SkString fFamilyName;
18 SkStream* fLocalStream;
19
20 public:
21 FontConfigTypeface(Style style,
22 const SkFontConfigInterface::FontIdentity& fi,
23 const SkString& familyName)
24 : INHERITED(style, SkTypefaceCache::NewFontID(), false)
25 , fIdentity(fi)
26 , fFamilyName(familyName)
27 , fLocalStream(NULL) {}
28
29 FontConfigTypeface(Style style, SkStream* localStream)
30 : INHERITED(style, SkTypefaceCache::NewFontID(), false) {
31 // we default to empty fFamilyName and fIdentity
32 fLocalStream = localStream;
33 SkSafeRef(localStream);
34 }
35
36 virtual ~FontConfigTypeface() {
37 SkSafeUnref(fLocalStream);
38 }
39
40 const SkFontConfigInterface::FontIdentity& getIdentity() const {
41 return fIdentity;
42 }
43
44 const char* getFamilyName() const { return fFamilyName.c_str(); }
45 SkStream* getLocalStream() const { return fLocalStream; }
46
47 bool isFamilyName(const char* name) const {
48 return fFamilyName.equals(name);
49 }
50
51 protected:
52 friend class SkFontHost; // hack until we can make public versions
53
54 virtual int onGetTableTags(SkFontTableTag tags[]) const SK_OVERRIDE;
55 virtual size_t onGetTableData(SkFontTableTag, size_t offset,
56 size_t length, void* data) const SK_OVERRIDE;
57 virtual void onGetFontDescriptor(SkFontDescriptor*, bool*) const SK_OVERRIDE ;
58 virtual SkStream* onOpenStream(int* ttcIndex) const SK_OVERRIDE;
59
60 private:
61 typedef SkTypeface_FreeType INHERITED;
62 };
63
OLDNEW
« no previous file with comments | « no previous file | src/ports/SkFontHost_fontconfig.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698