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

Unified Diff: src/core/SkTypeface.cpp

Issue 849103004: Make SkStream *not* ref counted. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase, just in case. 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/core/SkStream.cpp ('k') | src/device/xps/SkXPSDevice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkTypeface.cpp
diff --git a/src/core/SkTypeface.cpp b/src/core/SkTypeface.cpp
index 75ff58eea87e44bb25cdf2e7595d956d3d25da5b..b86cfa7cafe223978300a00a1213e77195101a57 100644
--- a/src/core/SkTypeface.cpp
+++ b/src/core/SkTypeface.cpp
@@ -156,7 +156,7 @@ void SkTypeface::serialize(SkWStream* wstream) const {
this->onGetFontDescriptor(&desc, &isLocal);
// Embed font data if it's a local font.
- if (isLocal && NULL == desc.getFontData()) {
+ if (isLocal && !desc.hasFontData()) {
int ttcIndex;
desc.setFontData(this->onOpenStream(&ttcIndex));
desc.setFontIndex(ttcIndex);
@@ -170,7 +170,7 @@ void SkTypeface::serializeForcingEmbedding(SkWStream* wstream) const {
this->onGetFontDescriptor(&desc, &ignoredIsLocal);
// Always embed font data.
- if (NULL == desc.getFontData()) {
+ if (!desc.hasFontData()) {
int ttcIndex;
desc.setFontData(this->onOpenStream(&ttcIndex));
desc.setFontIndex(ttcIndex);
@@ -180,7 +180,7 @@ void SkTypeface::serializeForcingEmbedding(SkWStream* wstream) const {
SkTypeface* SkTypeface::Deserialize(SkStream* stream) {
SkFontDescriptor desc(stream);
- SkStream* data = desc.getFontData();
+ SkStream* data = desc.transferFontData();
if (data) {
SkTypeface* typeface = SkTypeface::CreateFromStream(data, desc.getFontIndex());
if (typeface) {
« no previous file with comments | « src/core/SkStream.cpp ('k') | src/device/xps/SkXPSDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698