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

Unified Diff: dm/DM.cpp

Issue 1845283003: Gamma-correctness pushed into Skia, top-down. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 4 years, 8 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/DMGpuSupport.h » ('j') | src/effects/SkImageSource.cpp » ('J')
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 00cb279e8116d6567365b81c48696f85daa0634e..54e1851eab11656820ecbd84572c80f1d7042e8d 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -821,8 +821,8 @@ static Sink* create_sink(const SkCommandLineConfig* config) {
contextOptions = static_cast<GrContextFactory::ContextOptions>(
contextOptions | GrContextFactory::kEnableNVPR_ContextOptions);
}
- if (kSRGB_SkColorProfileType == gpuConfig->getProfileType() ||
- kRGBA_F16_SkColorType == gpuConfig->getColorType()) {
+ if (SkColorAndProfileAreGammaCorrect(gpuConfig->getColorType(),
+ gpuConfig->getProfileType())) {
contextOptions = static_cast<GrContextFactory::ContextOptions>(
contextOptions | GrContextFactory::kRequireSRGBSupport_ContextOptions);
}
@@ -1168,8 +1168,7 @@ struct Task {
const SkBitmap* bitmap) {
bool gammaCorrect = false;
if (bitmap) {
- gammaCorrect = bitmap->profileType() == kSRGB_SkColorProfileType
- || bitmap-> colorType() == kRGBA_F16_SkColorType;
+ gammaCorrect = SkImageInfoIsGammaCorrect(bitmap->info());
}
JsonWriter::BitmapResult result;
« no previous file with comments | « no previous file | dm/DMGpuSupport.h » ('j') | src/effects/SkImageSource.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698