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

Unified Diff: dm/DM.cpp

Issue 1741973002: Add gamma_correct option field to dm.json (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 4 years, 10 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 | « no previous file | dm/DMJsonWriter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DM.cpp
diff --git a/dm/DM.cpp b/dm/DM.cpp
index 59c7def4d67d0dbee83fd9d3db10686f5a490a6b..d50c8966e51f00e4fd5dc3d0a4fc27ccf8022e8a 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -1017,12 +1017,19 @@ struct Task {
const char* ext,
SkStream* data, size_t len,
const SkBitmap* bitmap) {
+ bool gammaCorrect = false;
+ if (bitmap) {
+ gammaCorrect = bitmap->profileType() == kSRGB_SkColorProfileType
+ || bitmap-> colorType() == kRGBA_F16_SkColorType;
+ }
+
JsonWriter::BitmapResult result;
result.name = task.src->name();
result.config = task.sink.tag;
result.sourceType = task.src.tag;
result.sourceOptions = task.src.options;
result.ext = ext;
+ result.gammaCorrect = gammaCorrect;
result.md5 = md5;
JsonWriter::AddBitmapResult(result);
« no previous file with comments | « no previous file | dm/DMJsonWriter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698