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

Side by Side Diff: src/core/SkFontDescriptor.cpp

Issue 1316123003: Style Change: SkNEW->new; SkDELETE->delete (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-26 (Wednesday) 15:59:00 EDT Created 5 years, 3 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
« no previous file with comments | « src/core/SkFont.cpp ('k') | src/core/SkFontMgr.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkFontDescriptor.h" 8 #include "SkFontDescriptor.h"
9 #include "SkStream.h" 9 #include "SkStream.h"
10 #include "SkData.h" 10 #include "SkData.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 default: 91 default:
92 SkDEBUGFAIL("Unknown id used by a font descriptor"); 92 SkDEBUGFAIL("Unknown id used by a font descriptor");
93 return; 93 return;
94 } 94 }
95 } 95 }
96 96
97 size_t length = stream->readPackedUInt(); 97 size_t length = stream->readPackedUInt();
98 if (length > 0) { 98 if (length > 0) {
99 SkAutoTUnref<SkData> data(SkData::NewUninitialized(length)); 99 SkAutoTUnref<SkData> data(SkData::NewUninitialized(length));
100 if (stream->read(data->writable_data(), length) == length) { 100 if (stream->read(data->writable_data(), length) == length) {
101 fFontData.reset(new SkFontData(SkNEW_ARGS(SkMemoryStream, (data)), i ndex, 101 fFontData.reset(new SkFontData(new SkMemoryStream(data), index, axis , axisCount));
102 axis, axisCount));
103 } 102 }
104 } 103 }
105 } 104 }
106 105
107 void SkFontDescriptor::serialize(SkWStream* stream) { 106 void SkFontDescriptor::serialize(SkWStream* stream) {
108 stream->writePackedUInt(fStyle); 107 stream->writePackedUInt(fStyle);
109 108
110 write_string(stream, fFamilyName, kFontFamilyName); 109 write_string(stream, fFamilyName, kFontFamilyName);
111 write_string(stream, fFullName, kFullName); 110 write_string(stream, fFullName, kFullName);
112 write_string(stream, fPostscriptName, kPostscriptName); 111 write_string(stream, fPostscriptName, kPostscriptName);
(...skipping 13 matching lines...) Expand all
126 125
127 if (fFontData.get() && fFontData->hasStream()) { 126 if (fFontData.get() && fFontData->hasStream()) {
128 SkAutoTDelete<SkStreamAsset> fontData(fFontData->detachStream()); 127 SkAutoTDelete<SkStreamAsset> fontData(fFontData->detachStream());
129 size_t length = fontData->getLength(); 128 size_t length = fontData->getLength();
130 stream->writePackedUInt(length); 129 stream->writePackedUInt(length);
131 stream->writeStream(fontData, length); 130 stream->writeStream(fontData, length);
132 } else { 131 } else {
133 stream->writePackedUInt(0); 132 stream->writePackedUInt(0);
134 } 133 }
135 } 134 }
OLDNEW
« no previous file with comments | « src/core/SkFont.cpp ('k') | src/core/SkFontMgr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698