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. 4 #include "tools/fiddle/examples.h" 5 // HASH=59b2078ebfbda8736a57c0486ae33332 6 REG_FIDDLE(Image_refColorSpace, 256, 256, false, 3) { 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. 28