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

Unified Diff: src/effects/gradients/SkGradientShader.cpp

Issue 2377763002: Added kSRGBLinear_Named color space, along with tests (Closed)
Patch Set: Update assert. Better comment. 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 | « src/core/SkColorSpace.cpp ('k') | tests/ColorSpaceTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/gradients/SkGradientShader.cpp
diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp
index 31ff9ab8779cbaad20e0f2db94357ee5b66647a8..0faf006d73b9de01f7d363be6114a3b48876c33b 100644
--- a/src/effects/gradients/SkGradientShader.cpp
+++ b/src/effects/gradients/SkGradientShader.cpp
@@ -141,7 +141,7 @@ SkGradientShaderBase::SkGradientShaderBase(const Descriptor& desc, const SkMatri
}
// Color space refers to fColors4f, so it's always linear gamma
- fColorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named)->makeLinearGamma();
+ fColorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGBLinear_Named);
} else {
SkASSERT(desc.fColors4f && desc.fColorSpace && desc.fColorSpace->gammaIsLinear());
@@ -683,10 +683,9 @@ void SkGradientShaderBase::getGradientTableBitmap(SkBitmap* bitmap,
SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named));
break;
case GradientBitmapType::kHalfFloat:
- info = SkImageInfo::Make(kCache32Count, 1, kRGBA_F16_SkColorType,
- kPremul_SkAlphaType,
- SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named)
- ->makeLinearGamma());
+ info = SkImageInfo::Make(
+ kCache32Count, 1, kRGBA_F16_SkColorType, kPremul_SkAlphaType,
+ SkColorSpace::NewNamed(SkColorSpace::kSRGBLinear_Named));
break;
default:
SkFAIL("Unexpected bitmap type");
« no previous file with comments | « src/core/SkColorSpace.cpp ('k') | tests/ColorSpaceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698