Hal Canary | 8751512 | 2019-03-15 14:22:51 -0400 | [diff] [blame] | 1 | #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 Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 4 | #include "tools/fiddle/examples.h" |
Hal Canary | 8751512 | 2019-03-15 14:22:51 -0400 | [diff] [blame] | 5 | // HASH=59b2078ebfbda8736a57c0486ae33332 |
Hal Canary | a7181e7c | 2019-03-18 16:06:34 -0400 | [diff] [blame] | 6 | REG_FIDDLE(Image_refColorSpace, 256, 256, false, 3) { |
Hal Canary | 8751512 | 2019-03-15 14:22:51 -0400 | [diff] [blame] | 7 | void 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. |