Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Pixmap_const_SkImageInfo_const_star.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=9a00774be57d7308313b3a9073e6e696
5REG_FIDDLE(Pixmap_const_SkImageInfo_const_star, 256, 256, true, 3) {
6void draw(SkCanvas* canvas) {
7 SkDebugf("image alpha only = %s\n", image->isAlphaOnly() ? "true" : "false");
8 SkPMColor pmColors = 0;
10 SkImages::RasterFromPixmapCopy({SkImageInfo::MakeA8(1, 1), (uint8_t*)&pmColors, 1});
11 SkDebugf("copy alpha only = %s\n", copy->isAlphaOnly() ? "true" : "false");
12}
13} // END FIDDLE
uint32_t SkPMColor
Definition SkColor.h:205
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 isAlphaOnly() const
Definition SkImage.cpp:239
sk_sp< SkImage > image
Definition examples.cpp:29
#define REG_FIDDLE(NAME, W, H, TEXT, I)
Definition examples.h:60
SK_API sk_sp< SkImage > RasterFromPixmapCopy(const SkPixmap &pixmap)
Definition copy.py:1
static SkImageInfo MakeA8(int width, int height)