Adding support for controlling the global sRGB SkColor switch.
Frontend change: https://codereview.chromium.org/1900233002/
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1902143002
Review URL: https://codereview.chromium.org/1902143002
diff --git a/tools/skiaserve/Request.cpp b/tools/skiaserve/Request.cpp
index 58aca84..7cbc9ef 100644
--- a/tools/skiaserve/Request.cpp
+++ b/tools/skiaserve/Request.cpp
@@ -9,6 +9,7 @@
#include "SkPictureRecorder.h"
#include "SkPixelSerializer.h"
+#include "SkPM4fPriv.h"
#include "picture_utils.h"
using namespace sk_gpu_test;
@@ -186,6 +187,11 @@
return enableGPU(fGPUEnabled);
}
+bool Request::setSRGBMode(bool enable) {
+ gTreatSkColorAsSRGB = enable;
+ return true;
+}
+
bool Request::enableGPU(bool enable) {
if (enable) {
SkSurface* surface = this->createGPUSurface();
@@ -238,6 +244,7 @@
root["mode"] = Json::Value(fGPUEnabled ? "gpu" : "cpu");
root["drawGpuBatchBounds"] = Json::Value(fDebugCanvas->getDrawGpuBatchBounds());
root["colorMode"] = Json::Value(fColorMode);
+ root["srgbMode"] = Json::Value(gTreatSkColorAsSRGB);
SkDynamicMemoryWStream stream;
stream.writeText(Json::FastWriter().write(root).c_str());