Flutter Engine
The Flutter Engine
Image_isOpaque.cpp
Go to the documentation of this file.
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.
4REG_FIDDLE(Image_isOpaque, 256, 256, true, 0) {
5void draw(SkCanvas* canvas) {
6 auto check_isopaque = [](const SkImageInfo& imageInfo) -> void {
7 auto surface(SkSurfaces::Raster(imageInfo));
8 auto image(surface->makeImageSnapshot());
9 SkDebugf("isOpaque = %s\n", image->isOpaque() ? "true" : "false");
10 };
13}
14} // END FIDDLE
static void check_isopaque(skiatest::Reporter *reporter, const sk_sp< SkSurface > &surface, bool expectedOpaque)
REG_FIDDLE(Image_isOpaque, 256, 256, true, 0)
@ kOpaque_SkAlphaType
pixel is opaque
Definition: SkAlphaType.h:28
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
bool isOpaque() const
Definition: SkImage.h:375
VkSurfaceKHR surface
Definition: main.cc:49
sk_sp< const SkImage > image
Definition: SkRecords.h:269
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
static SkImageInfo MakeN32Premul(int width, int height)
static SkImageInfo MakeN32(int width, int height, SkAlphaType at)