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

Side by Side Diff: dm/DMSrcSink.cpp

Issue 2252443002: Only test SVG DM sources against direct raster/gpu sinks. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: review Created 4 years, 4 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 | « dm/DMSrcSink.h ('k') | no next file » | 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 "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
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
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
OLDNEW
« no previous file with comments | « dm/DMSrcSink.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698