1cb93a386Sopenharmony_ci// Copyright 2020 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_ciREG_FIDDLE(inlinepixmapconstructor, 256, 256, true, 3) { 5cb93a386Sopenharmony_civoid draw(SkCanvas* canvas) { 6cb93a386Sopenharmony_ci SkDebugf("image alpha only = %s\n", image->isAlphaOnly() ? "true" : "false"); 7cb93a386Sopenharmony_ci SkPMColor pmColors = 0; 8cb93a386Sopenharmony_ci sk_sp<SkImage> copy = 9cb93a386Sopenharmony_ci SkImage::MakeRasterCopy({SkImageInfo::MakeA8(1, 1), (uint8_t*)&pmColors, 1}); 10cb93a386Sopenharmony_ci SkDebugf("copy alpha only = %s\n", copy->isAlphaOnly() ? "true" : "false"); 11cb93a386Sopenharmony_ci} 12cb93a386Sopenharmony_ci} // END FIDDLE 13