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

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: Undo odd change to GrBlurUtils - no longer needed 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') | include/core/SkCanvas.h » ('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 97b6eb8f6ab8d3d9f9a69cf75d9f5c3e0211ede6..47fd679f070a668e27f73a382e1fe0d067d4535e 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -821,8 +821,8 @@ static Sink* create_sink(const SkCommandLineConfig* config) {
contextOptions = static_cast<GrContextFactory::GLContextOptions>(
contextOptions | GrContextFactory::kEnableNVPR_GLContextOptions);
}
- if (kSRGB_SkColorProfileType == gpuConfig->getProfileType() ||
- kRGBA_F16_SkColorType == gpuConfig->getColorType()) {
+ if (SkColorAndProfileAreGammaCorrect(gpuConfig->getColorType(),
+ gpuConfig->getProfileType())) {
contextOptions = static_cast<GrContextFactory::GLContextOptions>(
contextOptions | GrContextFactory::kRequireSRGBSupport_GLContextOptions);
}
@@ -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') | include/core/SkCanvas.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698