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

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: gpu 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 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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