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 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1047 | 1047 |
1048 return ""; | 1048 return ""; |
1049 } | 1049 } |
1050 | 1050 |
1051 SkISize SVGSrc::size() const { | 1051 SkISize SVGSrc::size() const { |
1052 return kSVGSize.toRound(); | 1052 return kSVGSize.toRound(); |
1053 } | 1053 } |
1054 | 1054 |
1055 Name SVGSrc::name() const { return SkOSPath::Basename(fPath.c_str()); } | 1055 Name SVGSrc::name() const { return SkOSPath::Basename(fPath.c_str()); } |
1056 | 1056 |
1057 bool SVGSrc::veto(SinkFlags flags) const { | |
1058 // No need to test to non-(raster||gpu) or indirect backends. | |
1059 return (flags.type != SinkFlags::kRaster && flags.type != SinkFlags::kGPU) | |
mtklein
2016/08/15 20:35:37
maybe
bool type_ok = flags.type == SinkFlags::kRa
f(malita)
2016/08/16 20:59:00
Done.
| |
1060 || flags.approach != SinkFlags::kDirect; | |
1061 } | |
1062 | |
1057 #endif // defined(SK_XML) | 1063 #endif // defined(SK_XML) |
1058 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~*/ | 1064 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~*/ |
1059 | 1065 |
1060 MSKPSrc::MSKPSrc(Path path) : fPath(path) { | 1066 MSKPSrc::MSKPSrc(Path path) : fPath(path) { |
1061 std::unique_ptr<SkStreamAsset> stream(SkStream::NewFromFile(fPath.c_str())); | 1067 std::unique_ptr<SkStreamAsset> stream(SkStream::NewFromFile(fPath.c_str())); |
1062 (void)fReader.init(stream.get()); | 1068 (void)fReader.init(stream.get()); |
1063 } | 1069 } |
1064 | 1070 |
1065 int MSKPSrc::pageCount() const { return fReader.pageCount(); } | 1071 int MSKPSrc::pageCount() const { return fReader.pageCount(); } |
1066 | 1072 |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1620 if (!err.isEmpty()) { | 1626 if (!err.isEmpty()) { |
1621 return err; | 1627 return err; |
1622 } | 1628 } |
1623 sk_sp<SkDrawable> dl = recorder.finishRecordingAsDrawable(); | 1629 sk_sp<SkDrawable> dl = recorder.finishRecordingAsDrawable(); |
1624 canvas->drawDrawable(dl.get()); | 1630 canvas->drawDrawable(dl.get()); |
1625 return check_against_reference(bitmap, src, fSink); | 1631 return check_against_reference(bitmap, src, fSink); |
1626 }); | 1632 }); |
1627 } | 1633 } |
1628 | 1634 |
1629 } // namespace DM | 1635 } // namespace DM |
OLD | NEW |