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

Side by Side Diff: src/svg/SkSVGDevice.cpp

Issue 1933393002: Move SkTypeface to sk_sp. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Restore deleted Android code. Created 4 years, 7 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/SkFontMgr_android.cpp ('k') | src/utils/SkLua.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 2015 Google Inc. 2 * Copyright 2015 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 "SkSVGDevice.h" 8 #include "SkSVGDevice.h"
9 9
10 #include "SkBase64.h" 10 #include "SkBase64.h"
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 527
528 void SkSVGDevice::AutoElement::addTextAttributes(const SkPaint& paint) { 528 void SkSVGDevice::AutoElement::addTextAttributes(const SkPaint& paint) {
529 this->addAttribute("font-size", paint.getTextSize()); 529 this->addAttribute("font-size", paint.getTextSize());
530 530
531 if (const char* textAlign = svg_text_align(paint.getTextAlign())) { 531 if (const char* textAlign = svg_text_align(paint.getTextAlign())) {
532 this->addAttribute("text-anchor", textAlign); 532 this->addAttribute("text-anchor", textAlign);
533 } 533 }
534 534
535 SkString familyName; 535 SkString familyName;
536 SkTHashSet<SkString> familySet; 536 SkTHashSet<SkString> familySet;
537 SkAutoTUnref<const SkTypeface> tface(paint.getTypeface() ? 537 sk_sp<const SkTypeface> tface(paint.getTypeface() ?
538 SkRef(paint.getTypeface()) : SkTypeface::RefDefault()); 538 sk_ref_sp(paint.getTypeface()) : SkTypeface::MakeDefault());
539 539
540 SkASSERT(tface); 540 SkASSERT(tface);
541 SkTypeface::Style style = tface->style(); 541 SkTypeface::Style style = tface->style();
542 if (style & SkTypeface::kItalic) { 542 if (style & SkTypeface::kItalic) {
543 this->addAttribute("font-style", "italic"); 543 this->addAttribute("font-style", "italic");
544 } 544 }
545 if (style & SkTypeface::kBold) { 545 if (style & SkTypeface::kBold) {
546 this->addAttribute("font-weight", "bold"); 546 this->addAttribute("font-weight", "bold");
547 } 547 }
548 548
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 const SkPaint& paint) { 809 const SkPaint& paint) {
810 // todo 810 // todo
811 SkDebugf("unsupported operation: drawVertices()\n"); 811 SkDebugf("unsupported operation: drawVertices()\n");
812 } 812 }
813 813
814 void SkSVGDevice::drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, 814 void SkSVGDevice::drawDevice(const SkDraw&, SkBaseDevice*, int x, int y,
815 const SkPaint&) { 815 const SkPaint&) {
816 // todo 816 // todo
817 SkDebugf("unsupported operation: drawDevice()\n"); 817 SkDebugf("unsupported operation: drawDevice()\n");
818 } 818 }
OLDNEW
« no previous file with comments | « src/ports/SkFontMgr_android.cpp ('k') | src/utils/SkLua.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698