1cb93a386Sopenharmony_ci// Copyright 2019 Google LLC. 2cb93a386Sopenharmony_ci// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. 3cb93a386Sopenharmony_ci#include "tools/fiddle/examples.h" 4cb93a386Sopenharmony_ci// HASH=56ede4b7d45c15d5936f81ac3d74f070 5cb93a386Sopenharmony_ciREG_FIDDLE(Bitmap_shiftPerPixel, 256, 256, true, 0) { 6cb93a386Sopenharmony_civoid draw(SkCanvas* canvas) { 7cb93a386Sopenharmony_ci const char* colors[] = {"Unknown", "Alpha_8", "RGB_565", "ARGB_4444", "RGBA_8888", "RGB_888x", 8cb93a386Sopenharmony_ci "BGRA_8888", "RGBA_1010102", "RGB_101010x", "Gray_8", "RGBA_F16Norm", 9cb93a386Sopenharmony_ci "RGBA_F16"}; 10cb93a386Sopenharmony_ci SkImageInfo info = SkImageInfo::MakeA8(1, 1); 11cb93a386Sopenharmony_ci SkBitmap bitmap; 12cb93a386Sopenharmony_ci for (SkColorType colorType : { 13cb93a386Sopenharmony_ci kUnknown_SkColorType, kAlpha_8_SkColorType, kRGB_565_SkColorType, 14cb93a386Sopenharmony_ci kARGB_4444_SkColorType, kRGBA_8888_SkColorType, kRGB_888x_SkColorType, 15cb93a386Sopenharmony_ci kBGRA_8888_SkColorType, kRGBA_1010102_SkColorType, kRGB_101010x_SkColorType, 16cb93a386Sopenharmony_ci kGray_8_SkColorType, kRGBA_F16_SkColorType 17cb93a386Sopenharmony_ci } ) { 18cb93a386Sopenharmony_ci bitmap.setInfo(info.makeColorType(colorType)); 19cb93a386Sopenharmony_ci SkDebugf("color: k" "%s" "_SkColorType" "%*s" "shiftPerPixel: %d\n", 20cb93a386Sopenharmony_ci colors[colorType], (int)(14 - strlen(colors[colorType])), " ", 21cb93a386Sopenharmony_ci bitmap.shiftPerPixel()); 22cb93a386Sopenharmony_ci } 23cb93a386Sopenharmony_ci} 24cb93a386Sopenharmony_ci} // END FIDDLE 25