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

Unified Diff: src/ports/SkFontMgr_android.cpp

Issue 869763002: SkTypeface to use SkStreamAsset. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « src/ports/SkFontHost_win.cpp ('k') | src/ports/SkFontMgr_fontconfig.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkFontMgr_android.cpp
diff --git a/src/ports/SkFontMgr_android.cpp b/src/ports/SkFontMgr_android.cpp
index ce931941cd1d91949b8cca018c9294e141345e94..523deca0e3a0bd932c2be98e40600ee83fca7c3d 100644
--- a/src/ports/SkFontMgr_android.cpp
+++ b/src/ports/SkFontMgr_android.cpp
@@ -84,7 +84,7 @@ public:
desc->setFontIndex(fIndex);
*serialize = false;
}
- SkStream* onOpenStream(int* ttcIndex) const SK_OVERRIDE {
+ SkStreamAsset* onOpenStream(int* ttcIndex) const SK_OVERRIDE {
*ttcIndex = fIndex;
return SkStream::NewFromFile(fPathName.c_str());
}
@@ -98,7 +98,7 @@ public:
class SkTypeface_AndroidStream : public SkTypeface_Android {
public:
- SkTypeface_AndroidStream(SkStream* stream,
+ SkTypeface_AndroidStream(SkStreamAsset* stream,
int index,
const SkFontStyle& style,
bool isFixedPitch,
@@ -115,13 +115,13 @@ public:
*serialize = true;
}
- SkStream* onOpenStream(int* ttcIndex) const SK_OVERRIDE {
+ SkStreamAsset* onOpenStream(int* ttcIndex) const SK_OVERRIDE {
*ttcIndex = fIndex;
return fStream->duplicate();
}
private:
- SkAutoTDelete<SkStream> fStream;
+ SkAutoTDelete<SkStreamAsset> fStream;
typedef SkTypeface_Android INHERITED;
};
@@ -413,19 +413,19 @@ protected:
}
SkTypeface* onCreateFromFile(const char path[], int ttcIndex) const SK_OVERRIDE {
- SkAutoTDelete<SkStream> stream(SkStream::NewFromFile(path));
+ SkAutoTDelete<SkStreamAsset> stream(SkStream::NewFromFile(path));
return stream.get() ? this->createFromStream(stream.detach(), ttcIndex) : NULL;
}
- SkTypeface* onCreateFromStream(SkStream* stream, int ttcIndex) const SK_OVERRIDE {
- SkAutoTDelete<SkStream> streamDeleter(stream);
+ SkTypeface* onCreateFromStream(SkStreamAsset* bareStream, int ttcIndex) const SK_OVERRIDE {
+ SkAutoTDelete<SkStreamAsset> stream(bareStream);
bool isFixedPitch;
SkFontStyle style;
SkString name;
if (!fScanner.scanFont(stream, ttcIndex, &name, &style, &isFixedPitch)) {
return NULL;
}
- return SkNEW_ARGS(SkTypeface_AndroidStream, (streamDeleter.detach(), ttcIndex,
+ return SkNEW_ARGS(SkTypeface_AndroidStream, (stream.detach(), ttcIndex,
style, isFixedPitch, name));
}
« no previous file with comments | « src/ports/SkFontHost_win.cpp ('k') | src/ports/SkFontMgr_fontconfig.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698