diff options
author | 2014-09-18 10:55:32 -0700 | |
---|---|---|
committer | 2014-09-18 10:55:32 -0700 | |
commit | d71b75757335393d9643a5b7a0f2769b6ba52fb6 (patch) | |
tree | 24896b8f1ee45232d610d73fad13ed21ff9c6e4d /include/core | |
parent | 65b427cff9cd34a06ff060d65d00cc3615d8fd94 (diff) |
Serialize the font index.
BUG=skia:1186
R=reed@google.com
Author: bungeman@google.com
Review URL: https://codereview.chromium.org/567013002
Diffstat (limited to 'include/core')
-rw-r--r-- | include/core/SkRefCnt.h | 2 | ||||
-rw-r--r-- | include/core/SkTypeface.h | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/include/core/SkRefCnt.h b/include/core/SkRefCnt.h index f092e778f3..459ad251a8 100644 --- a/include/core/SkRefCnt.h +++ b/include/core/SkRefCnt.h @@ -234,7 +234,7 @@ public: BlockRefType *operator->() const { return static_cast<BlockRefType*>(fObj); } - operator T*() { return fObj; } + operator T*() const { return fObj; } private: T* fObj; diff --git a/include/core/SkTypeface.h b/include/core/SkTypeface.h index 1df467a0e5..cb87a6a6fc 100644 --- a/include/core/SkTypeface.h +++ b/include/core/SkTypeface.h @@ -114,13 +114,13 @@ public: /** Return a new typeface given a file. If the file does not exist, or is not a valid font file, returns null. */ - static SkTypeface* CreateFromFile(const char path[]); + static SkTypeface* CreateFromFile(const char path[], int index = 0); /** Return a new typeface given a stream. If the stream is not a valid font file, returns null. Ownership of the stream is transferred, so the caller must not reference it again. */ - static SkTypeface* CreateFromStream(SkStream* stream); + static SkTypeface* CreateFromStream(SkStream* stream, int index = 0); /** Write a unique signature to a stream, sufficient to reconstruct a typeface referencing the same font when Deserialize is called. |