Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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.
4// HASH=e3340460003b74ee286d625e68589d65
5REG_FIDDLE(Image_isOpaque, 256, 256, true, 0) {
6void draw(SkCanvas* canvas) {
7 auto check_isopaque = [](const SkImageInfo& imageInfo) -> void {
8 auto surface(SkSurfaces::Raster(imageInfo));
9 auto image(surface->makeImageSnapshot());
10 SkDebugf("isOpaque = %s\n", image->isOpaque() ? "true" : "false");
11 };
14}
15} // END FIDDLE
static void check_isopaque(skiatest::Reporter *reporter, const sk_sp< SkSurface > &surface, bool expectedOpaque)
@ 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< SkImage > image
Definition examples.cpp:29
#define REG_FIDDLE(NAME, W, H, TEXT, I)
Definition examples.h:60
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)