1 // Copyright 2019 Google LLC.
2 // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
3 #include "tools/fiddle/examples.h"
4 // HASH=cb028b7931da85b949ad0953b9711f9f
5 REG_FIDDLE(Bitmap_refColorSpace, 256, 256, true, 0) {
6 void draw(SkCanvas* canvas) {
7 SkBitmap bitmap1, bitmap2;
8 bitmap1.setInfo(SkImageInfo::MakeN32(16, 32, kPremul_SkAlphaType,
9 SkColorSpace::MakeSRGBLinear()));
10 bitmap2.setInfo(SkImageInfo::MakeN32(16, 32, kPremul_SkAlphaType,
11 bitmap1.refColorSpace()));
12 SkColorSpace* colorSpace = bitmap2.colorSpace();
13 SkDebugf("gammaCloseToSRGB: %s gammaIsLinear: %s isSRGB: %s\n",
14 colorSpace->gammaCloseToSRGB() ? "true" : "false",
15 colorSpace->gammaIsLinear() ? "true" : "false",
16 colorSpace->isSRGB() ? "true" : "false");