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

Side by Side Diff: src/ports/SkFontMgr_android.cpp

Issue 2333713002: change SkStreams to work with sk_sp<SkData> instead of SkData* (Closed)
Patch Set: fix xpsdevice Created 4 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/ports/SkFontHost_win.cpp ('k') | src/ports/SkFontMgr_custom.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 2014 Google Inc. 2 * Copyright 2014 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 "SkTypes.h" 8 #include "SkTypes.h"
9 9
10 #include "SkData.h" 10 #include "SkData.h"
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 style, SkToBool(elegant), 399 style, SkToBool(elegant),
400 SkString(), character); 400 SkString(), character);
401 if (matchingTypeface) { 401 if (matchingTypeface) {
402 return matchingTypeface.release(); 402 return matchingTypeface.release();
403 } 403 }
404 } 404 }
405 return nullptr; 405 return nullptr;
406 } 406 }
407 407
408 SkTypeface* onCreateFromData(SkData* data, int ttcIndex) const override { 408 SkTypeface* onCreateFromData(SkData* data, int ttcIndex) const override {
409 return this->createFromStream(new SkMemoryStream(data), ttcIndex); 409 return this->createFromStream(new SkMemoryStream(sk_ref_sp(data)), ttcIn dex);
410 } 410 }
411 411
412 SkTypeface* onCreateFromFile(const char path[], int ttcIndex) const override { 412 SkTypeface* onCreateFromFile(const char path[], int ttcIndex) const override {
413 SkAutoTDelete<SkStreamAsset> stream(SkStream::NewFromFile(path)); 413 SkAutoTDelete<SkStreamAsset> stream(SkStream::NewFromFile(path));
414 return stream.get() ? this->createFromStream(stream.release(), ttcIndex) : nullptr; 414 return stream.get() ? this->createFromStream(stream.release(), ttcIndex) : nullptr;
415 } 415 }
416 416
417 SkTypeface* onCreateFromStream(SkStreamAsset* bareStream, int ttcIndex) cons t override { 417 SkTypeface* onCreateFromStream(SkStreamAsset* bareStream, int ttcIndex) cons t override {
418 SkAutoTDelete<SkStreamAsset> stream(bareStream); 418 SkAutoTDelete<SkStreamAsset> stream(bareStream);
419 bool isFixedPitch; 419 bool isFixedPitch;
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 SkASSERT(custom->fSystemFontUse < SK_ARRAY_COUNT(gSystemFontUseStrings)) ; 539 SkASSERT(custom->fSystemFontUse < SK_ARRAY_COUNT(gSystemFontUseStrings)) ;
540 SkDEBUGF(("SystemFontUse: %s BasePath: %s Fonts: %s FallbackFonts: %s\n" , 540 SkDEBUGF(("SystemFontUse: %s BasePath: %s Fonts: %s FallbackFonts: %s\n" ,
541 gSystemFontUseStrings[custom->fSystemFontUse], 541 gSystemFontUseStrings[custom->fSystemFontUse],
542 custom->fBasePath, 542 custom->fBasePath,
543 custom->fFontsXml, 543 custom->fFontsXml,
544 custom->fFallbackFontsXml)); 544 custom->fFallbackFontsXml));
545 } 545 }
546 546
547 return new SkFontMgr_Android(custom); 547 return new SkFontMgr_Android(custom);
548 } 548 }
OLDNEW
« no previous file with comments | « src/ports/SkFontHost_win.cpp ('k') | src/ports/SkFontMgr_custom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698