Revert of More removal of SkColorProfileType... (patchset #2 id:20001 of https://codereview.chromium.org/2071393002/ )

Reason for revert:
This was still used in chrome

Original issue's description:
> More removal of SkColorProfileType...
>
> Scrub GMs. Remove the gDefaultProfile thing (it's unused now), along with
> the command line flag that was setting it in DM and nanobench.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2071393002
>
> Committed: https://skia.googlesource.com/skia/+/944876f2745a62a839e49275daf93a0329372e67

TBR=msarett@google.com,reed@google.com,bsalomon@google.com,brianosman@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/2074103004
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index cb28231..94402cc 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -1025,6 +1025,8 @@
     intentionallyLeaked->start();
 }
 
+extern bool gDefaultProfileIsSRGB;
+
 int nanobench_main();
 int nanobench_main() {
     SetupCrashHandler();
@@ -1036,6 +1038,10 @@
     gGrFactory.reset(new GrContextFactory(grContextOpts));
 #endif
 
+    if (FLAGS_forceSRGB) {
+        gDefaultProfileIsSRGB = true;
+    }
+
     if (FLAGS_veryVerbose) {
         FLAGS_verbose = true;
     }
diff --git a/dm/DM.cpp b/dm/DM.cpp
index 0eb679a..6904408 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -1248,6 +1248,8 @@
 
 extern sk_sp<SkTypeface> (*gCreateTypefaceDelegate)(const char [], SkFontStyle );
 
+extern bool gDefaultProfileIsSRGB;
+
 int dm_main();
 int dm_main() {
     setbuf(stdout, nullptr);
@@ -1260,6 +1262,10 @@
         gVLog = freopen(SkOSPath::Join(FLAGS_writePath[0], "verbose.log").c_str(), "w", stderr);
     }
 
+    if (FLAGS_forceSRGB) {
+        gDefaultProfileIsSRGB = true;
+    }
+
     JsonWriter::DumpJson();  // It's handy for the bots to assume this is ~never missing.
     SkAutoGraphics ag;
     SkTaskGroup::Enabler enabled(FLAGS_threads);
diff --git a/gm/SkLinearBitmapPipelineGM.cpp b/gm/SkLinearBitmapPipelineGM.cpp
index c78bc74..777f825 100644
--- a/gm/SkLinearBitmapPipelineGM.cpp
+++ b/gm/SkLinearBitmapPipelineGM.cpp
@@ -55,7 +55,7 @@
     SkPixmap pmdst;
     bmdst.peekPixels(&pmdst);
 
-    SkImageInfo info = SkImageInfo::MakeN32Premul(ir.width(), ir.height());
+    SkImageInfo info = SkImageInfo::MakeN32Premul(ir.width(), ir.height(), kLinear_SkColorProfileType);
 
     sk_sp<SkImage> image(SkImage::MakeRasterCopy(SkPixmap(info, pmsrc.addr32(), pmsrc.rowBytes())));
     SkPaint paint;
@@ -113,6 +113,9 @@
     }
 
     uint32_t flags = 0;
+    //if (kSRGB_SkColorProfileType == profile) {
+        //flags |= SkXfermode::kDstIsSRGB_PM4fFlag;
+    //}
     auto procN = SkXfermode::GetD32Proc(nullptr, flags);
 
     SkLinearBitmapPipeline pipeline{
diff --git a/gm/all_bitmap_configs.cpp b/gm/all_bitmap_configs.cpp
index b657f4f..7ea1746 100644
--- a/gm/all_bitmap_configs.cpp
+++ b/gm/all_bitmap_configs.cpp
@@ -246,13 +246,13 @@
 static void make_color_test_bitmap_variant(
     SkColorType colorType,
     SkAlphaType alphaType,
-    sk_sp<SkColorSpace> colorSpace,
+    SkColorProfileType profile,
     SkBitmap* bm)
 {
     SkASSERT(colorType == kRGBA_8888_SkColorType || colorType == kBGRA_8888_SkColorType);
     SkASSERT(alphaType == kPremul_SkAlphaType || alphaType == kUnpremul_SkAlphaType);
     bm->allocPixels(
-        SkImageInfo::Make(SCALE, SCALE, colorType, alphaType, colorSpace));
+        SkImageInfo::Make(SCALE, SCALE, colorType, alphaType, profile));
     SkPixmap pm;
     bm->peekPixels(&pm);
     for (int y = 0; y < bm->height(); y++) {
@@ -265,17 +265,13 @@
 DEF_SIMPLE_GM(all_variants_8888, canvas, 4 * SCALE + 30, 2 * SCALE + 10) {
     sk_tool_utils::draw_checkerboard(canvas, SK_ColorLTGRAY, SK_ColorWHITE, 8);
 
-    sk_sp<SkColorSpace> colorSpaces[] {
-        nullptr,
-        SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named)
-    };
-    for (auto colorSpace : colorSpaces) {
+    for (auto profile : {kSRGB_SkColorProfileType, kLinear_SkColorProfileType}) {
         canvas->save();
         for (auto alphaType : {kPremul_SkAlphaType, kUnpremul_SkAlphaType}) {
             canvas->save();
             for (auto colorType : {kRGBA_8888_SkColorType, kBGRA_8888_SkColorType}) {
                 SkBitmap bm;
-                make_color_test_bitmap_variant(colorType, alphaType, colorSpace, &bm);
+                make_color_test_bitmap_variant(colorType, alphaType, profile, &bm);
                 canvas->drawBitmap(bm, 0.0f, 0.0f);
                 canvas->translate(SCALE + 10, 0.0f);
             }
diff --git a/gm/color4f.cpp b/gm/color4f.cpp
index 5a516a5..33d8377 100644
--- a/gm/color4f.cpp
+++ b/gm/color4f.cpp
@@ -73,13 +73,10 @@
     // even if it holds sRGB values.
     bg.setColor(0xFFFFFFFF);
 
-    sk_sp<SkColorSpace> colorSpaces[]{
-        nullptr,
-        SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named)
-    };
-    for (auto colorSpace : colorSpaces) {
+    SkColorProfileType const profiles[] { kLinear_SkColorProfileType, kSRGB_SkColorProfileType };
+    for (auto profile : profiles) {
         const SkImageInfo info = SkImageInfo::Make(1024, 100, kN32_SkColorType, kPremul_SkAlphaType,
-                                                   colorSpace);
+                                                   profile);
         auto surface(SkSurface::MakeRaster(info));
         surface->getCanvas()->drawPaint(bg);
         draw_into_canvas(surface->getCanvas());
diff --git a/gm/dftext.cpp b/gm/dftext.cpp
index 42d650e..05aef4c 100644
--- a/gm/dftext.cpp
+++ b/gm/dftext.cpp
@@ -48,9 +48,8 @@
         // set up offscreen rendering with distance field text
 #if SK_SUPPORT_GPU
         GrContext* ctx = inputCanvas->getGrContext();
-        SkISize size = onISize();
-        SkImageInfo info = SkImageInfo::MakeN32(size.width(), size.height(), kPremul_SkAlphaType,
-                                                sk_ref_sp(inputCanvas->imageInfo().colorSpace()));
+        SkImageInfo info = SkImageInfo::MakeN32Premul(onISize(),
+                                                      inputCanvas->imageInfo().profileType());
         SkSurfaceProps canvasProps(SkSurfaceProps::kLegacyFontHost_InitType);
         uint32_t gammaCorrect = inputCanvas->getProps(&canvasProps)
             ? canvasProps.flags() & SkSurfaceProps::kGammaCorrect_Flag : 0;
diff --git a/gm/gamma.cpp b/gm/gamma.cpp
index eb4c760..c9fa28b 100644
--- a/gm/gamma.cpp
+++ b/gm/gamma.cpp
@@ -18,7 +18,6 @@
     const SkScalar tx = sz + 5.0f;
     const SkRect r = SkRect::MakeXYWH(0, 0, sz, sz);
     SkShader::TileMode rpt = SkShader::kRepeat_TileMode;
-    auto srgbColorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
 
     SkBitmap ditherBmp;
     ditherBmp.allocN32Pixels(2, 2);
@@ -27,20 +26,21 @@
     pixels[1] = pixels[2] = SkPackARGB32(0xFF, 0, 0, 0);
 
     SkBitmap linearGreyBmp;
-    SkImageInfo linearGreyInfo = SkImageInfo::MakeN32(szInt, szInt, kOpaque_SkAlphaType, nullptr);
+    SkImageInfo linearGreyInfo = SkImageInfo::MakeN32(szInt, szInt, kOpaque_SkAlphaType,
+                                                      kLinear_SkColorProfileType);
     linearGreyBmp.allocPixels(linearGreyInfo);
     linearGreyBmp.eraseARGB(0xFF, 0x7F, 0x7F, 0x7F);
 
     SkBitmap srgbGreyBmp;
     SkImageInfo srgbGreyInfo = SkImageInfo::MakeN32(szInt, szInt, kOpaque_SkAlphaType,
-                                                    srgbColorSpace);
+                                                    kSRGB_SkColorProfileType);
     srgbGreyBmp.allocPixels(srgbGreyInfo);
     // 0xBC = 255 * linear_to_srgb(0.5f)
     srgbGreyBmp.eraseARGB(0xFF, 0xBC, 0xBC, 0xBC);
 
     SkBitmap mipmapBmp;
     SkImageInfo mipmapInfo = SkImageInfo::Make(2, 2, kN32_SkColorType, kOpaque_SkAlphaType,
-                                               srgbColorSpace);
+                                               SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named));
     mipmapBmp.allocPixels(mipmapInfo);
     SkPMColor* mipmapPixels = reinterpret_cast<SkPMColor*>(mipmapBmp.getPixels());
     unsigned s25 = 0x89;    // 255 * linear_to_srgb(0.25f)
diff --git a/gm/surface.cpp b/gm/surface.cpp
index bae77c5..15d362e 100644
--- a/gm/surface.cpp
+++ b/gm/surface.cpp
@@ -78,7 +78,7 @@
 
         // must be opaque to have a hope of testing LCD text
         const SkImageInfo info = SkImageInfo::MakeN32(W, H, kOpaque_SkAlphaType,
-                                                      sk_ref_sp(canvas->imageInfo().colorSpace()));
+                                                      canvas->imageInfo().profileType());
         SkSurfaceProps canvasProps(SkSurfaceProps::kLegacyFontHost_InitType);
         bool gammaCorrect = canvas->getProps(&canvasProps) && canvasProps.isGammaCorrect();
 
diff --git a/gm/textblobgeometrychange.cpp b/gm/textblobgeometrychange.cpp
index a241c5c..87c432f 100644
--- a/gm/textblobgeometrychange.cpp
+++ b/gm/textblobgeometrychange.cpp
@@ -42,8 +42,7 @@
 
         SkAutoTUnref<const SkTextBlob> blob(builder.build());
 
-        SkImageInfo info = SkImageInfo::MakeN32(200, 200, kPremul_SkAlphaType,
-                                                sk_ref_sp(canvas->imageInfo().colorSpace()));
+        SkImageInfo info = SkImageInfo::MakeN32Premul(200, 200, canvas->imageInfo().profileType());
         SkSurfaceProps canvasProps(SkSurfaceProps::kLegacyFontHost_InitType);
         uint32_t gammaCorrect = canvas->getProps(&canvasProps)
             ? canvasProps.flags() & SkSurfaceProps::kGammaCorrect_Flag : 0;
diff --git a/gm/textblobmixedsizes.cpp b/gm/textblobmixedsizes.cpp
index 8fdf558..8f5dc85 100644
--- a/gm/textblobmixedsizes.cpp
+++ b/gm/textblobmixedsizes.cpp
@@ -102,10 +102,8 @@
 #if SK_SUPPORT_GPU
             // Create a new Canvas to enable DFT
             GrContext* ctx = inputCanvas->getGrContext();
-            SkISize size = onISize();
-            sk_sp<SkColorSpace> colorSpace = sk_ref_sp(inputCanvas->imageInfo().colorSpace());
-            SkImageInfo info = SkImageInfo::MakeN32(size.width(), size.height(),
-                                                    kPremul_SkAlphaType, colorSpace);
+            SkImageInfo info = SkImageInfo::MakeN32Premul(onISize(),
+                                                          inputCanvas->imageInfo().profileType());
             SkSurfaceProps canvasProps(SkSurfaceProps::kLegacyFontHost_InitType);
             uint32_t gammaCorrect = inputCanvas->getProps(&canvasProps)
                 ? canvasProps.flags() & SkSurfaceProps::kGammaCorrect_Flag : 0;
diff --git a/gm/textblobrandomfont.cpp b/gm/textblobrandomfont.cpp
index 58f0dc6..2a6fc8e 100644
--- a/gm/textblobrandomfont.cpp
+++ b/gm/textblobrandomfont.cpp
@@ -97,8 +97,8 @@
 
         canvas->drawColor(sk_tool_utils::color_to_565(SK_ColorWHITE));
 
-        SkImageInfo info = SkImageInfo::MakeN32(kWidth, kHeight, kPremul_SkAlphaType,
-                                                sk_ref_sp(canvas->imageInfo().colorSpace()));
+        SkImageInfo info = SkImageInfo::MakeN32Premul(kWidth, kHeight,
+                                                      canvas->imageInfo().profileType());
         SkSurfaceProps canvasProps(SkSurfaceProps::kLegacyFontHost_InitType);
         uint32_t gammaCorrect = canvas->getProps(&canvasProps)
             ? canvasProps.flags() & SkSurfaceProps::kGammaCorrect_Flag : 0;
diff --git a/gm/xfermodes3.cpp b/gm/xfermodes3.cpp
index 642175e..2b554b6 100644
--- a/gm/xfermodes3.cpp
+++ b/gm/xfermodes3.cpp
@@ -126,7 +126,7 @@
         GrContext* context = baseCanvas->getGrContext();
         SkImageInfo baseInfo = baseCanvas->imageInfo();
         SkImageInfo info = SkImageInfo::Make(w, h, baseInfo.colorType(), baseInfo.alphaType(),
-                                             sk_ref_sp(baseInfo.colorSpace()));
+                                             baseInfo.profileType());
         SkSurfaceProps canvasProps(SkSurfaceProps::kLegacyFontHost_InitType);
         baseCanvas->getProps(&canvasProps);
         return SkSurface::MakeRenderTarget(context, SkBudgeted::kNo, info, 0, &canvasProps);
diff --git a/gyp/core.gypi b/gyp/core.gypi
index 516faf3..d3102e4 100644
--- a/gyp/core.gypi
+++ b/gyp/core.gypi
@@ -421,6 +421,7 @@
         '<(skia_include_path)/private/SkFloatBits.h',
         '<(skia_include_path)/private/SkFloatingPoint.h',
         '<(skia_include_path)/private/SkGpuFenceSync.h',
+        '<(skia_include_path)/private/SkImageInfoPriv.h',
         '<(skia_include_path)/private/SkMiniRecorder.h',
         '<(skia_include_path)/private/SkMutex.h',
         '<(skia_include_path)/private/SkOnce.h',
diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h
index 5406f94..8b49909 100644
--- a/include/core/SkBitmap.h
+++ b/include/core/SkBitmap.h
@@ -86,6 +86,9 @@
     SkColorType colorType() const { return fInfo.colorType(); }
     SkAlphaType alphaType() const { return fInfo.alphaType(); }
     SkColorSpace* colorSpace() const { return fInfo.colorSpace(); }
+#ifdef SK_SUPPORT_LEGACY_COLORPROFILETYPE
+    SkColorProfileType profileType() const { return fInfo.profileType(); }
+#endif
 
     /**
      *  Return the number of bytes per pixel based on the colortype. If the colortype is
diff --git a/include/private/SkImageInfoPriv.h b/include/private/SkImageInfoPriv.h
new file mode 100644
index 0000000..89e6e20
--- /dev/null
+++ b/include/private/SkImageInfoPriv.h
@@ -0,0 +1,14 @@
+/*
+ * Copyright 2016 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+#ifndef SkImageInfoPriv_DEFINED
+#define SkImageInfoPriv_DEFINED
+
+#include "SkImageInfo.h"
+
+SK_API SkColorProfileType SkDefaultColorProfile();
+
+#endif  // SkImageInfoPriv_DEFINED
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 1a5c4c4..4150a9a 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1177,7 +1177,6 @@
                                    const SkPaint* paint) {
     // need to force L32 for now if we have an image filter. Once filters support other colortypes
     // e.g. sRGB or F16, we can remove this check
-    // SRGBTODO: Can we remove this check now?
     const bool hasImageFilter = paint && paint->getImageFilter();
 
     SkAlphaType alphaType = isOpaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType;
@@ -1186,7 +1185,7 @@
         return SkImageInfo::MakeN32(w, h, alphaType);
     } else {
         // keep the same characteristics as the prev
-        return SkImageInfo::Make(w, h, prev.colorType(), alphaType, sk_ref_sp(prev.colorSpace()));
+        return SkImageInfo::Make(w, h, prev.colorType(), alphaType, prev.profileType());
     }
 }
 
diff --git a/src/core/SkImageInfo.cpp b/src/core/SkImageInfo.cpp
index ee16923..9485754 100644
--- a/src/core/SkImageInfo.cpp
+++ b/src/core/SkImageInfo.cpp
@@ -6,6 +6,7 @@
  */
 
 #include "SkImageInfo.h"
+#include "SkImageInfoPriv.h"
 #include "SkReadBuffer.h"
 #include "SkWriteBuffer.h"
 
@@ -60,6 +61,14 @@
 }
 #endif
 
+// Indicate how images and gradients should interpret colors by default.
+bool gDefaultProfileIsSRGB;
+
+SkColorProfileType SkDefaultColorProfile() {
+    return gDefaultProfileIsSRGB ? kSRGB_SkColorProfileType
+                                 : kLinear_SkColorProfileType;
+}
+
 static bool alpha_type_is_valid(SkAlphaType alphaType) {
     return (alphaType >= 0) && (alphaType <= kLastEnum_SkAlphaType);
 }
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 970f75c..a9c6089 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -244,7 +244,7 @@
 bool sw_convert_to_premul(GrPixelConfig srcConfig, int width, int height, size_t inRowBytes,
                           const void* inPixels, size_t outRowBytes, void* outPixels) {
     SkSrcPixelInfo srcPI;
-    if (!GrPixelConfigToColorAndColorSpace(srcConfig, &srcPI.fColorType, nullptr)) {
+    if (!GrPixelConfig2ColorAndProfileType(srcConfig, &srcPI.fColorType, nullptr)) {
         return false;
     }
     srcPI.fAlphaType = kUnpremul_SkAlphaType;
@@ -511,7 +511,7 @@
     // Perform umpremul conversion if we weren't able to perform it as a draw.
     if (unpremul) {
         SkDstPixelInfo dstPI;
-        if (!GrPixelConfigToColorAndColorSpace(dstConfig, &dstPI.fColorType, nullptr)) {
+        if (!GrPixelConfig2ColorAndProfileType(dstConfig, &dstPI.fColorType, nullptr)) {
             return false;
         }
         dstPI.fAlphaType = kUnpremul_SkAlphaType;
diff --git a/src/gpu/GrSurface.cpp b/src/gpu/GrSurface.cpp
index 47fa394..886945c 100644
--- a/src/gpu/GrSurface.cpp
+++ b/src/gpu/GrSurface.cpp
@@ -118,11 +118,12 @@
 
 SkImageInfo GrSurface::info(SkAlphaType alphaType) const {
     SkColorType colorType;
-    sk_sp<SkColorSpace> colorSpace;
-    if (!GrPixelConfigToColorAndColorSpace(this->config(), &colorType, &colorSpace)) {
+    SkColorProfileType profileType;
+    if (!GrPixelConfig2ColorAndProfileType(this->config(), &colorType, &profileType)) {
         sk_throw();
     }
-    return SkImageInfo::Make(this->width(), this->height(), colorType, alphaType, colorSpace);
+    return SkImageInfo::Make(this->width(), this->height(), colorType, alphaType,
+                             profileType);
 }
 
 // TODO: This should probably be a non-member helper function. It might only be needed in
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index f937b16..60fcdd5 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -453,10 +453,10 @@
     return kUnknown_GrPixelConfig;
 }
 
-bool GrPixelConfigToColorAndColorSpace(GrPixelConfig config, SkColorType* ctOut,
-                                       sk_sp<SkColorSpace>* csOut) {
+bool GrPixelConfig2ColorAndProfileType(GrPixelConfig config, SkColorType* ctOut,
+                                       SkColorProfileType* ptOut) {
     SkColorType ct;
-    sk_sp<SkColorSpace> cs = nullptr;
+    SkColorProfileType pt = kLinear_SkColorProfileType;
     switch (config) {
         case kAlpha_8_GrPixelConfig:
             ct = kAlpha_8_SkColorType;
@@ -478,11 +478,11 @@
             break;
         case kSRGBA_8888_GrPixelConfig:
             ct = kRGBA_8888_SkColorType;
-            cs = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
+            pt = kSRGB_SkColorProfileType;
             break;
         case kSBGRA_8888_GrPixelConfig:
             ct = kBGRA_8888_SkColorType;
-            cs = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
+            pt = kSRGB_SkColorProfileType;
             break;
         case kRGBA_half_GrPixelConfig:
             ct = kRGBA_F16_SkColorType;
@@ -493,8 +493,8 @@
     if (ctOut) {
         *ctOut = ct;
     }
-    if (csOut) {
-        *csOut = cs;
+    if (ptOut) {
+        *ptOut = pt;
     }
     return true;
 }
@@ -724,9 +724,9 @@
     SkASSERT(h <= desc.fHeight);
 #endif
     const GrPixelConfig config = tex->config();
-    SkColorType ct = kUnknown_SkColorType;
+    SkColorType ct;
     SkAlphaType at = isOpaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType;
-    if (!GrPixelConfigToColorAndColorSpace(config, &ct, nullptr)) {
+    if (!GrPixelConfig2ColorAndProfileType(config, &ct, nullptr)) {
         ct = kUnknown_SkColorType;
     }
     return SkImageInfo::Make(w, h, ct, at);
diff --git a/src/gpu/SkGrPriv.h b/src/gpu/SkGrPriv.h
index ab77dc1..266cfff 100644
--- a/src/gpu/SkGrPriv.h
+++ b/src/gpu/SkGrPriv.h
@@ -102,7 +102,7 @@
 
 GrSurfaceDesc GrImageInfoToSurfaceDesc(const SkImageInfo&, const GrCaps&);
 
-bool GrPixelConfigToColorAndColorSpace(GrPixelConfig, SkColorType*, sk_sp<SkColorSpace>*);
+bool GrPixelConfig2ColorAndProfileType(GrPixelConfig, SkColorType*, SkColorProfileType*);
 
 /**
  *  If the compressed data in the SkData is supported (as a texture format, this returns
diff --git a/tools/flags/SkCommonFlags.cpp b/tools/flags/SkCommonFlags.cpp
index 1caffd5..3da5efe 100644
--- a/tools/flags/SkCommonFlags.cpp
+++ b/tools/flags/SkCommonFlags.cpp
@@ -13,6 +13,8 @@
 DEFINE_bool(dryRun, false,
             "just print the tests that would be run, without actually running them.");
 
+DEFINE_bool(forceSRGB, false, "Force SRGB for imageinfos");
+
 DEFINE_bool(gpu, true, "master switch for running GPU-bound work.");
 
 DEFINE_string(images, "", "List of images and/or directories to decode. A directory with no images"
diff --git a/tools/flags/SkCommonFlags.h b/tools/flags/SkCommonFlags.h
index ddd0fc8..b7eaca4 100644
--- a/tools/flags/SkCommonFlags.h
+++ b/tools/flags/SkCommonFlags.h
@@ -14,6 +14,7 @@
 
 DECLARE_bool(cpu);
 DECLARE_bool(dryRun);
+DECLARE_bool(forceSRGB);
 DECLARE_bool(gpu);
 DECLARE_string(images);
 DECLARE_string(colorImages);