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

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

Issue 1809733002: detach -> release (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: (C) Created 4 years, 9 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/SkTextBlob.cpp ('k') | src/effects/SkBlurMask.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 2011 The Android Open Source Project 2 * Copyright 2011 The Android Open Source Project
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 "SkAdvancedTypefaceMetrics.h" 8 #include "SkAdvancedTypefaceMetrics.h"
9 #include "SkEndian.h" 9 #include "SkEndian.h"
10 #include "SkFontDescriptor.h" 10 #include "SkFontDescriptor.h"
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 } 225 }
226 226
227 SkFontData* SkTypeface::createFontData() const { 227 SkFontData* SkTypeface::createFontData() const {
228 return this->onCreateFontData(); 228 return this->onCreateFontData();
229 } 229 }
230 230
231 // This implementation is temporary until this method can be made pure virtual. 231 // This implementation is temporary until this method can be made pure virtual.
232 SkFontData* SkTypeface::onCreateFontData() const { 232 SkFontData* SkTypeface::onCreateFontData() const {
233 int index; 233 int index;
234 SkAutoTDelete<SkStreamAsset> stream(this->onOpenStream(&index)); 234 SkAutoTDelete<SkStreamAsset> stream(this->onOpenStream(&index));
235 return new SkFontData(stream.detach(), index, nullptr, 0); 235 return new SkFontData(stream.release(), index, nullptr, 0);
236 }; 236 };
237 237
238 int SkTypeface::charsToGlyphs(const void* chars, Encoding encoding, 238 int SkTypeface::charsToGlyphs(const void* chars, Encoding encoding,
239 uint16_t glyphs[], int glyphCount) const { 239 uint16_t glyphs[], int glyphCount) const {
240 if (glyphCount <= 0) { 240 if (glyphCount <= 0) {
241 return 0; 241 return 0;
242 } 242 }
243 if (nullptr == chars || (unsigned)encoding > kUTF32_Encoding) { 243 if (nullptr == chars || (unsigned)encoding > kUTF32_Encoding) {
244 if (glyphs) { 244 if (glyphs) {
245 sk_bzero(glyphs, glyphCount * sizeof(glyphs[0])); 245 sk_bzero(glyphs, glyphCount * sizeof(glyphs[0]));
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 if (ctx.get()) { 352 if (ctx.get()) {
353 SkPaint::FontMetrics fm; 353 SkPaint::FontMetrics fm;
354 ctx->getFontMetrics(&fm); 354 ctx->getFontMetrics(&fm);
355 bounds->set(fm.fXMin * invTextSize, fm.fTop * invTextSize, 355 bounds->set(fm.fXMin * invTextSize, fm.fTop * invTextSize,
356 fm.fXMax * invTextSize, fm.fBottom * invTextSize); 356 fm.fXMax * invTextSize, fm.fBottom * invTextSize);
357 return true; 357 return true;
358 } 358 }
359 return false; 359 return false;
360 } 360 }
361 361
OLDNEW
« no previous file with comments | « src/core/SkTextBlob.cpp ('k') | src/effects/SkBlurMask.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698