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 "DMSrcSink.h" | 8 #include "DMSrcSink.h" |
9 #include "Resources.h" | 9 #include "Resources.h" |
10 #include "SkAndroidCodec.h" | 10 #include "SkAndroidCodec.h" |
(...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1049 | 1049 |
1050 return ""; | 1050 return ""; |
1051 } | 1051 } |
1052 | 1052 |
1053 SkISize SVGSrc::size() const { | 1053 SkISize SVGSrc::size() const { |
1054 return kSVGSize.toRound(); | 1054 return kSVGSize.toRound(); |
1055 } | 1055 } |
1056 | 1056 |
1057 Name SVGSrc::name() const { return SkOSPath::Basename(fPath.c_str()); } | 1057 Name SVGSrc::name() const { return SkOSPath::Basename(fPath.c_str()); } |
1058 | 1058 |
| 1059 bool SVGSrc::veto(SinkFlags flags) const { |
| 1060 // No need to test to non-(raster||gpu) or indirect backends. |
| 1061 bool type_ok = flags.type == SinkFlags::kRaster |
| 1062 || flags.type == SinkFlags::kGPU; |
| 1063 |
| 1064 return !type_ok || flags.approach != SinkFlags::kDirect; |
| 1065 } |
| 1066 |
1059 #endif // defined(SK_XML) | 1067 #endif // defined(SK_XML) |
1060 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~*/ | 1068 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~*/ |
1061 | 1069 |
1062 MSKPSrc::MSKPSrc(Path path) : fPath(path) { | 1070 MSKPSrc::MSKPSrc(Path path) : fPath(path) { |
1063 std::unique_ptr<SkStreamAsset> stream(SkStream::NewFromFile(fPath.c_str())); | 1071 std::unique_ptr<SkStreamAsset> stream(SkStream::NewFromFile(fPath.c_str())); |
1064 (void)fReader.init(stream.get()); | 1072 (void)fReader.init(stream.get()); |
1065 } | 1073 } |
1066 | 1074 |
1067 int MSKPSrc::pageCount() const { return fReader.pageCount(); } | 1075 int MSKPSrc::pageCount() const { return fReader.pageCount(); } |
1068 | 1076 |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1625 Error err = src.draw(&rec); | 1633 Error err = src.draw(&rec); |
1626 if (!err.isEmpty()) { | 1634 if (!err.isEmpty()) { |
1627 return err; | 1635 return err; |
1628 } | 1636 } |
1629 dl->draw(canvas); | 1637 dl->draw(canvas); |
1630 return check_against_reference(bitmap, src, fSink); | 1638 return check_against_reference(bitmap, src, fSink); |
1631 }); | 1639 }); |
1632 } | 1640 } |
1633 | 1641 |
1634 } // namespace DM | 1642 } // namespace DM |
OLD | NEW |