blob: c250c18da2394d8df98dfc96d1f550ed561d91dd [file] [log] [blame]
Hal Canary87515122019-03-15 14:22:51 -04001#if 0 // Disabled until updated to use current API.
2// Copyright 2019 Google LLC.
3// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
Mike Kleinc0bd9f92019-04-23 12:05:21 -05004#include "tools/fiddle/examples.h"
Hal Canary87515122019-03-15 14:22:51 -04005// HASH=4468d573f42af6f5e234be10a5453bb2
Hal Canarya7181e7c2019-03-18 16:06:34 -04006REG_FIDDLE(Image_colorSpace, 256, 256, false, 3) {
Hal Canary87515122019-03-15 14:22:51 -04007void draw(SkCanvas* canvas) {
8 SkPixmap pixmap;
9 source.peekPixels(&pixmap);
10 canvas->scale(.25f, .25f);
11 int y = 0;
12 for (auto gamma : { SkColorSpace::kLinear_RenderTargetGamma,
13 SkColorSpace::kSRGB_RenderTargetGamma } ) {
14 int x = 0;
15 sk_sp<SkColorSpace> colorSpace = SkColorSpace::MakeRGB(gamma, SkColorSpace::kSRGB_Gamut);
16 for (int index = 0; index < 2; ++index) {
17 pixmap.setColorSpace(colorSpace);
18 sk_sp<SkImage> image = SkImage::MakeRasterCopy(pixmap);
19 canvas->drawImage(image, x, y);
20 colorSpace = image->colorSpace()->makeColorSpin();
21 x += 512;
22 }
23 y += 512;
24 }
25}
26} // END FIDDLE
27#endif // Disabled until updated to use current API.