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

Unified Diff: gm/gamut.cpp

Issue 2380313002: Revert of Fix gamut GM to work w/serialization configs. Remove it from blacklist. (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 | infra/bots/recipes/swarm_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/gamut.cpp
diff --git a/gm/gamut.cpp b/gm/gamut.cpp
index 53b035de1c32ed9da9f4b44cde71b45ca0e4d3fe..26231c5e8fe954ecb067195b35d7b906d0502237 100644
--- a/gm/gamut.cpp
+++ b/gm/gamut.cpp
@@ -125,15 +125,11 @@
wideGamutRGB_toXYZD50.set3x3RowMajorf(gWideGamutRGB_toXYZD50);
// Use the original canvas' color type, but account for gamma requirements
- SkColorType colorType = canvas->imageInfo().colorType();
- if (kUnknown_SkColorType == colorType) {
- // This can happen when recording (in which case we'll just use 8888 offscreen surfaces)
- colorType = kN32_SkColorType;
- }
+ SkImageInfo origInfo = canvas->imageInfo();
auto srgbCS = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
auto wideCS = SkColorSpace::NewRGB(SkColorSpace::kSRGB_RenderTargetGamma,
wideGamutRGB_toXYZD50);
- switch (colorType) {
+ switch (origInfo.colorType()) {
case kRGBA_8888_SkColorType:
case kBGRA_8888_SkColorType:
break;
@@ -146,19 +142,16 @@
}
// Make our two working surfaces (one sRGB, one Adobe)
- SkImageInfo srgbGamutInfo = SkImageInfo::Make(gRectSize, gRectSize, colorType,
+ SkImageInfo srgbGamutInfo = SkImageInfo::Make(gRectSize, gRectSize, origInfo.colorType(),
kPremul_SkAlphaType, srgbCS);
- SkImageInfo wideGamutInfo = SkImageInfo::Make(gRectSize, gRectSize, colorType,
+ SkImageInfo wideGamutInfo = SkImageInfo::Make(gRectSize, gRectSize, origInfo.colorType(),
kPremul_SkAlphaType, wideCS);
// readPixels doesn't do color conversion (yet), so we can use it to see the raw (wide) data
SkImageInfo dstInfo = srgbGamutInfo.makeColorSpace(nullptr);
sk_sp<SkSurface> srgbGamutSurface = canvas->makeSurface(srgbGamutInfo);
- if (!srgbGamutSurface) {
- srgbGamutSurface = SkSurface::MakeRaster(srgbGamutInfo);
- }
sk_sp<SkSurface> wideGamutSurface = canvas->makeSurface(wideGamutInfo);
- if (!wideGamutSurface) {
- wideGamutSurface = SkSurface::MakeRaster(wideGamutInfo);
+ if (!srgbGamutSurface || !wideGamutSurface) {
+ return;
}
SkCanvas* srgbGamutCanvas = srgbGamutSurface->getCanvas();
SkCanvas* wideGamutCanvas = wideGamutSurface->getCanvas();
« no previous file with comments | « no previous file | infra/bots/recipes/swarm_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698