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

Unified Diff: bench/nanobench.cpp

Issue 2035793002: Add color correction benchmark - with comparison to qcms (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « bench/ColorCodecBench.cpp ('k') | include/codec/SkCodec.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/nanobench.cpp
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index 55ef34e79de41ed3910efd10f1e89e6a830958c5..a7e9ebb855a4d8d8558ecbacc3650b3c01001a44 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -14,6 +14,7 @@
#include "BitmapRegionDecoderBench.h"
#include "CodecBench.h"
#include "CodecBenchPriv.h"
+#include "ColorCodecBench.h"
#include "CrashHandler.h"
#include "GMBench.h"
#include "ProcStats.h"
@@ -558,6 +559,7 @@ public:
, fCurrentCodec(0)
, fCurrentAndroidCodec(0)
, fCurrentBRDImage(0)
+ , fCurrentColorImage(0)
, fCurrentColorType(0)
, fCurrentAlphaType(0)
, fCurrentSubsetType(0)
@@ -602,6 +604,9 @@ public:
if (!CollectImages(FLAGS_images, &fImages)) {
exit(1);
}
+ if (!CollectImages(FLAGS_colorImages, &fColorImages)) {
+ exit(1);
+ }
// Choose the candidate color types for image decoding
const SkColorType colorTypes[] =
@@ -917,6 +922,20 @@ public:
fCurrentColorType = 0;
}
+ while (fCurrentColorImage < fColorImages.count()) {
+ fSourceType = "colorimage";
+ fBenchType = "skcolorcodec";
+ const SkString& path = fColorImages[fCurrentColorImage];
+ fCurrentColorImage++;
+ sk_sp<SkData> encoded = SkData::MakeFromFileName(path.c_str());
+ if (encoded) {
+ return new ColorCodecBench(SkOSPath::Basename(path.c_str()).c_str(),
+ std::move(encoded));
+ } else {
+ SkDebugf("Could not read file %s.\n", path.c_str());
+ }
+ }
+
return nullptr;
}
@@ -960,6 +979,7 @@ private:
SkTArray<SkString> fSKPs;
SkTArray<bool> fUseMPDs;
SkTArray<SkString> fImages;
+ SkTArray<SkString> fColorImages;
SkTArray<SkColorType, true> fColorTypes;
SkScalar fZoomMax;
double fZoomPeriodMs;
@@ -975,6 +995,7 @@ private:
int fCurrentCodec;
int fCurrentAndroidCodec;
int fCurrentBRDImage;
+ int fCurrentColorImage;
int fCurrentColorType;
int fCurrentAlphaType;
int fCurrentSubsetType;
« no previous file with comments | « bench/ColorCodecBench.cpp ('k') | include/codec/SkCodec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698