add --forceSRGB option to nanobench, to get all src images to be SRGB
authorreed <reed@google.com>
Thu, 26 May 2016 21:06:43 +0000 (14:06 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 26 May 2016 21:06:43 +0000 (14:06 -0700)
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2008333002

Review-Url: https://codereview.chromium.org/2008333002

bench/nanobench.cpp

index 4fb1ed223abdb481f2546c0e7e0083ab65747773..6af54d830faf813c864b86d05dee9f86fe340b1f 100644 (file)
@@ -123,6 +123,8 @@ DEFINE_string(sourceType, "",
 DEFINE_string(benchType,  "",
         "Apply usual --match rules to bench type: micro, recording, playback, skcodec, etc.");
 
+DEFINE_bool(forceSRGB, false, "Force SRGB for imageinfos");
+
 static double now_ms() { return SkTime::GetNSecs() * 1e-6; }
 
 static SkString humanize(double ms) {
@@ -1002,6 +1004,8 @@ static void start_keepalive() {
     intentionallyLeaked->start();
 }
 
+extern bool gDefaultProfileIsSRGB;
+
 int nanobench_main();
 int nanobench_main() {
     SetupCrashHandler();
@@ -1013,6 +1017,10 @@ int nanobench_main() {
     gGrFactory.reset(new GrContextFactory(grContextOpts));
 #endif
 
+    if (FLAGS_forceSRGB) {
+        gDefaultProfileIsSRGB = true;
+    }
+
     if (FLAGS_veryVerbose) {
         FLAGS_verbose = true;
     }