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

Unified Diff: gm/gamma.cpp

Issue 2071393002: More removal of SkColorProfileType... (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Restore API used in Chrome Created 4 years, 6 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 | « gm/dftext.cpp ('k') | gm/surface.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/gamma.cpp
diff --git a/gm/gamma.cpp b/gm/gamma.cpp
index c9fa28be104f87e1cf72c4710b03296893440101..eb4c7607feb1e4b9d9d3a2a488595dd9c215e84c 100644
--- a/gm/gamma.cpp
+++ b/gm/gamma.cpp
@@ -18,6 +18,7 @@ DEF_SIMPLE_GM(gamma, canvas, 560, 200) {
const SkScalar tx = sz + 5.0f;
const SkRect r = SkRect::MakeXYWH(0, 0, sz, sz);
SkShader::TileMode rpt = SkShader::kRepeat_TileMode;
+ auto srgbColorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
SkBitmap ditherBmp;
ditherBmp.allocN32Pixels(2, 2);
@@ -26,21 +27,20 @@ DEF_SIMPLE_GM(gamma, canvas, 560, 200) {
pixels[1] = pixels[2] = SkPackARGB32(0xFF, 0, 0, 0);
SkBitmap linearGreyBmp;
- SkImageInfo linearGreyInfo = SkImageInfo::MakeN32(szInt, szInt, kOpaque_SkAlphaType,
- kLinear_SkColorProfileType);
+ SkImageInfo linearGreyInfo = SkImageInfo::MakeN32(szInt, szInt, kOpaque_SkAlphaType, nullptr);
linearGreyBmp.allocPixels(linearGreyInfo);
linearGreyBmp.eraseARGB(0xFF, 0x7F, 0x7F, 0x7F);
SkBitmap srgbGreyBmp;
SkImageInfo srgbGreyInfo = SkImageInfo::MakeN32(szInt, szInt, kOpaque_SkAlphaType,
- kSRGB_SkColorProfileType);
+ srgbColorSpace);
srgbGreyBmp.allocPixels(srgbGreyInfo);
// 0xBC = 255 * linear_to_srgb(0.5f)
srgbGreyBmp.eraseARGB(0xFF, 0xBC, 0xBC, 0xBC);
SkBitmap mipmapBmp;
SkImageInfo mipmapInfo = SkImageInfo::Make(2, 2, kN32_SkColorType, kOpaque_SkAlphaType,
- SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named));
+ srgbColorSpace);
mipmapBmp.allocPixels(mipmapInfo);
SkPMColor* mipmapPixels = reinterpret_cast<SkPMColor*>(mipmapBmp.getPixels());
unsigned s25 = 0x89; // 255 * linear_to_srgb(0.25f)
« no previous file with comments | « gm/dftext.cpp ('k') | gm/surface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698