| OLD | NEW |
| 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 Loading... |
| 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 sk_sp<const SkTypeface> tface(paint.getTypeface() ? | 537 SkAutoTUnref<const SkTypeface> tface(paint.getTypeface() ? |
| 538 sk_ref_sp(paint.getTypeface()) : SkTypeface::MakeDefault()); | 538 SkRef(paint.getTypeface()) : SkTypeface::RefDefault()); |
| 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 Loading... |
| 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 } |
| OLD | NEW |