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 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 path.addRRect(rr); | 645 path.addRRect(rr); |
646 | 646 |
647 AutoElement elem("path", fWriter, fResourceBucket, draw, paint); | 647 AutoElement elem("path", fWriter, fResourceBucket, draw, paint); |
648 elem.addPathAttributes(path); | 648 elem.addPathAttributes(path); |
649 } | 649 } |
650 | 650 |
651 void SkSVGDevice::drawPath(const SkDraw& draw, const SkPath& path, const SkPaint
& paint, | 651 void SkSVGDevice::drawPath(const SkDraw& draw, const SkPath& path, const SkPaint
& paint, |
652 const SkMatrix* prePathMatrix, bool pathIsMutable) { | 652 const SkMatrix* prePathMatrix, bool pathIsMutable) { |
653 AutoElement elem("path", fWriter, fResourceBucket, draw, paint); | 653 AutoElement elem("path", fWriter, fResourceBucket, draw, paint); |
654 elem.addPathAttributes(path); | 654 elem.addPathAttributes(path); |
| 655 |
| 656 // TODO: inverse fill types? |
| 657 if (path.getFillType() == SkPath::kEvenOdd_FillType) { |
| 658 elem.addAttribute("fill-rule", "evenodd"); |
| 659 } |
655 } | 660 } |
656 | 661 |
657 void SkSVGDevice::drawBitmapCommon(const SkDraw& draw, const SkBitmap& bm, | 662 void SkSVGDevice::drawBitmapCommon(const SkDraw& draw, const SkBitmap& bm, |
658 const SkPaint& paint) { | 663 const SkPaint& paint) { |
659 SkAutoTUnref<const SkData> pngData( | 664 SkAutoTUnref<const SkData> pngData( |
660 SkImageEncoder::EncodeData(bm, SkImageEncoder::kPNG_Type, SkImageEncoder
::kDefaultQuality)); | 665 SkImageEncoder::EncodeData(bm, SkImageEncoder::kPNG_Type, SkImageEncoder
::kDefaultQuality)); |
661 if (!pngData) { | 666 if (!pngData) { |
662 return; | 667 return; |
663 } | 668 } |
664 | 669 |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 const SkPaint& paint) { | 806 const SkPaint& paint) { |
802 // todo | 807 // todo |
803 SkDebugf("unsupported operation: drawVertices()\n"); | 808 SkDebugf("unsupported operation: drawVertices()\n"); |
804 } | 809 } |
805 | 810 |
806 void SkSVGDevice::drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, | 811 void SkSVGDevice::drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, |
807 const SkPaint&) { | 812 const SkPaint&) { |
808 // todo | 813 // todo |
809 SkDebugf("unsupported operation: drawDevice()\n"); | 814 SkDebugf("unsupported operation: drawDevice()\n"); |
810 } | 815 } |
OLD | NEW |