blob: 7b224e87e581726a5a09c7f51f20c4d9542f79b5 [file] [log] [blame]
Hal Canary83c2f702019-03-07 14:53:03 -05001#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.
4#include "fiddle/examples.h"
5// HASH=59b2078ebfbda8736a57c0486ae33332
6REG_FIDDLE(Image_020, 256, 256, false, 3) {
7void 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->refColorSpace()->makeColorSpin();
21 x += 512;
22 }
23 y += 512;
24 }
25}
26} // END FIDDLE
27#endif // Disabled until updated to use current API.