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

Unified Diff: src/ports/SkFontHost_linux.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_fontconfig.cpp ('k') | src/ports/SkFontHost_mac.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkFontHost_linux.cpp
diff --git a/src/ports/SkFontHost_linux.cpp b/src/ports/SkFontHost_linux.cpp
index 86d431dd419d5db99aff958b4293897ab1af06f6..c6f932fe6aaf00b7beeb89122ced9e1cac22a388 100644
--- a/src/ports/SkFontHost_linux.cpp
+++ b/src/ports/SkFontHost_linux.cpp
@@ -73,7 +73,7 @@ public:
const char* getUniqueString() const SK_OVERRIDE { return NULL; }
protected:
- SkStream* onOpenStream(int*) const SK_OVERRIDE { return NULL; }
+ SkStreamAsset* onOpenStream(int*) const SK_OVERRIDE { return NULL; }
private:
typedef SkTypeface_Custom INHERITED;
@@ -83,7 +83,7 @@ private:
class SkTypeface_Stream : public SkTypeface_Custom {
public:
SkTypeface_Stream(const SkFontStyle& style, bool isFixedPitch, bool sysFont,
- const SkString familyName, SkStream* stream, int index)
+ const SkString familyName, SkStreamAsset* stream, int index)
: INHERITED(style, isFixedPitch, sysFont, familyName, index)
, fStream(stream)
{ }
@@ -91,13 +91,13 @@ public:
const char* getUniqueString() const SK_OVERRIDE { return NULL; }
protected:
- SkStream* onOpenStream(int* ttcIndex) const SK_OVERRIDE {
+ SkStreamAsset* onOpenStream(int* ttcIndex) const SK_OVERRIDE {
*ttcIndex = this->getIndex();
return fStream->duplicate();
}
private:
- const SkAutoTDelete<const SkStream> fStream;
+ const SkAutoTDelete<const SkStreamAsset> fStream;
typedef SkTypeface_Custom INHERITED;
};
@@ -128,7 +128,7 @@ public:
}
protected:
- SkStream* onOpenStream(int* ttcIndex) const SK_OVERRIDE {
+ SkStreamAsset* onOpenStream(int* ttcIndex) const SK_OVERRIDE {
*ttcIndex = this->getIndex();
if (fStream.get()) {
return fStream->duplicate();
@@ -286,8 +286,8 @@ protected:
return this->createFromStream(new SkMemoryStream(data), ttcIndex);
}
- 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);
if (NULL == stream || stream->getLength() <= 0) {
return NULL;
}
@@ -297,14 +297,14 @@ protected:
SkString name;
if (fScanner.scanFont(stream, ttcIndex, &name, &style, &isFixedPitch)) {
return SkNEW_ARGS(SkTypeface_Stream, (style, isFixedPitch, false, name,
- streamDeleter.detach(), ttcIndex));
+ stream.detach(), ttcIndex));
} else {
return NULL;
}
}
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;
}
« no previous file with comments | « src/ports/SkFontHost_fontconfig.cpp ('k') | src/ports/SkFontHost_mac.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698