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=817f95879fadba44baf87ea60e9b595a
5 REG_FIDDLE(Bitmap_colorSpace, 256, 256, true, 0) {
draw(SkCanvas * canvas)6 void draw(SkCanvas* canvas) {
7 SkBitmap bitmap;
8 bitmap.setInfo(SkImageInfo::MakeN32(16, 32, kPremul_SkAlphaType,
9 SkColorSpace::MakeSRGBLinear()));
10 SkColorSpace* colorSpace = bitmap.colorSpace();
11 SkDebugf("gammaCloseToSRGB: %s gammaIsLinear: %s isSRGB: %s\n",
12 colorSpace->gammaCloseToSRGB() ? "true" : "false",
13 colorSpace->gammaIsLinear() ? "true" : "false",
14 colorSpace->isSRGB() ? "true" : "false");
15 }
16 } // END FIDDLE
17