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=e3340460003b74ee286d625e68589d65 5cb93a386Sopenharmony_ciREG_FIDDLE(Image_isOpaque, 256, 256, true, 0) { 6cb93a386Sopenharmony_civoid draw(SkCanvas* canvas) { 7cb93a386Sopenharmony_ci auto check_isopaque = [](const SkImageInfo& imageInfo) -> void { 8cb93a386Sopenharmony_ci auto surface(SkSurface::MakeRaster(imageInfo)); 9cb93a386Sopenharmony_ci auto image(surface->makeImageSnapshot()); 10cb93a386Sopenharmony_ci SkDebugf("isOpaque = %s\n", image->isOpaque() ? "true" : "false"); 11cb93a386Sopenharmony_ci }; 12cb93a386Sopenharmony_ci check_isopaque(SkImageInfo::MakeN32Premul(5, 5)); 13cb93a386Sopenharmony_ci check_isopaque(SkImageInfo::MakeN32(5, 5, kOpaque_SkAlphaType)); 14cb93a386Sopenharmony_ci} 15cb93a386Sopenharmony_ci} // END FIDDLE 16