Flutter Engine
The Flutter Engine
Functions
Image_isOpaque.cpp File Reference
#include "tools/fiddle/examples.h"

Go to the source code of this file.

Functions

 REG_FIDDLE (Image_isOpaque, 256, 256, true, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Image_isOpaque  ,
256  ,
256  ,
true  ,
 
)

Definition at line 4 of file Image_isOpaque.cpp.

4 {
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)
@ 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)