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

Unified Diff: third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp

Issue 2316123002: Switch Canvas2DLayerBridge to new SkColorSpace gamma APIs (Closed)
Patch Set: Created 4 years, 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
index 9c3efd43eb358154978d766ff9ac5bae348ba151..2f76b3b0b98b5aa04c79a43eb49fea1286886678 100644
--- a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
+++ b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
@@ -773,14 +773,11 @@ static gfx::ColorSpace SkColorSpaceToColorSpace(const SkColorSpace* skColorSpace
return gfx::ColorSpace();
gfx::ColorSpace::TransferID transferID = gfx::ColorSpace::TransferID::UNSPECIFIED;
- switch (skColorSpace->gammaNamed()) {
- case SkColorSpace::kSRGB_GammaNamed:
+ if (skColorSpace->gammaCloseToSRGB()) {
transferID = gfx::ColorSpace::TransferID::IEC61966_2_1;
- break;
- case SkColorSpace::kLinear_GammaNamed:
+ } else if (skColorSpace->gammaIsLinear()) {
transferID = gfx::ColorSpace::TransferID::LINEAR;
- break;
- default:
+ } else {
// TODO(crbug.com/634102): Not all curve type are supported
DCHECK(false);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698