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

Side by Side Diff: dm/DM.cpp

Issue 1933753002: Add ColorCodecSrc for testing/comparison on color corrected decodes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Response to comments Created 4 years, 7 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 | « bench/nanobench.cpp ('k') | dm/DMSrcSink.h » ('j') | 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 2013 Google Inc. 2 * Copyright 2013 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 "CrashHandler.h" 8 #include "CrashHandler.h"
9 #include "DMJsonWriter.h" 9 #include "DMJsonWriter.h"
10 #include "DMSrcSink.h" 10 #include "DMSrcSink.h"
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 SkOSFile::Iter it(path, "skp"); 772 SkOSFile::Iter it(path, "skp");
773 for (SkString file; it.next(&file); ) { 773 for (SkString file; it.next(&file); ) {
774 push_src("skp", "", new SKPSrc(SkOSPath::Join(path, file.c_str() ))); 774 push_src("skp", "", new SKPSrc(SkOSPath::Join(path, file.c_str() )));
775 } 775 }
776 } else { 776 } else {
777 push_src("skp", "", new SKPSrc(path)); 777 push_src("skp", "", new SKPSrc(path));
778 } 778 }
779 } 779 }
780 780
781 SkTArray<SkString> images; 781 SkTArray<SkString> images;
782 if (!CollectImages(&images)) { 782 if (!CollectImages(FLAGS_images, &images)) {
783 return false; 783 return false;
784 } 784 }
785 785
786 for (auto image : images) { 786 for (auto image : images) {
787 push_codec_srcs(image); 787 push_codec_srcs(image);
788 if (FLAGS_simpleCodec) { 788 if (FLAGS_simpleCodec) {
789 continue; 789 continue;
790 } 790 }
791 791
792 const char* ext = strrchr(image.c_str(), '.'); 792 const char* ext = strrchr(image.c_str(), '.');
793 if (ext && brd_supported(ext+1)) { 793 if (ext && brd_supported(ext+1)) {
794 push_brd_srcs(image); 794 push_brd_srcs(image);
795 } 795 }
796 } 796 }
797 797
798 SkTArray<SkString> colorImages;
799 if (!CollectImages(FLAGS_colorImages, &colorImages)) {
800 return false;
801 }
802
803 for (auto colorImage : colorImages) {
804 ColorCodecSrc* src = new ColorCodecSrc(colorImage, ColorCodecSrc::kBasel ine_Mode);
805 push_src("image", "color_codec_baseline", src);
806 }
807
798 return true; 808 return true;
799 } 809 }
800 810
801 static void push_sink(const SkCommandLineConfig& config, Sink* s) { 811 static void push_sink(const SkCommandLineConfig& config, Sink* s) {
802 SkAutoTDelete<Sink> sink(s); 812 SkAutoTDelete<Sink> sink(s);
803 813
804 // Try a simple Src as a canary. If it fails, skip this sink. 814 // Try a simple Src as a canary. If it fails, skip this sink.
805 struct : public Src { 815 struct : public Src {
806 Error draw(SkCanvas* c) const override { 816 Error draw(SkCanvas* c) const override {
807 c->drawRect(SkRect::MakeWH(1,1), SkPaint()); 817 c->drawRect(SkRect::MakeWH(1,1), SkPaint());
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
1433 #endif 1443 #endif
1434 } 1444 }
1435 } // namespace skiatest 1445 } // namespace skiatest
1436 1446
1437 #if !defined(SK_BUILD_FOR_IOS) 1447 #if !defined(SK_BUILD_FOR_IOS)
1438 int main(int argc, char** argv) { 1448 int main(int argc, char** argv) {
1439 SkCommandLineFlags::Parse(argc, argv); 1449 SkCommandLineFlags::Parse(argc, argv);
1440 return dm_main(); 1450 return dm_main();
1441 } 1451 }
1442 #endif 1452 #endif
OLDNEW
« no previous file with comments | « bench/nanobench.cpp ('k') | dm/DMSrcSink.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698