Flutter Engine
The Flutter Engine
inlinepixmapconstructor.cpp
Go to the documentation of this file.
1// Copyright 2020 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(inlinepixmapconstructor, 256, 256, true, 3) {
5void draw(SkCanvas* canvas) {
6 SkDebugf("image alpha only = %s\n", image->isAlphaOnly() ? "true" : "false");
7 SkPMColor pmColors = 0;
9 SkImages::RasterFromPixmapCopy({SkImageInfo::MakeA8(1, 1), (uint8_t*)&pmColors, 1});
10 SkDebugf("copy alpha only = %s\n", copy->isAlphaOnly() ? "true" : "false");
11}
12} // 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
REG_FIDDLE(inlinepixmapconstructor, 256, 256, true, 3)
SK_API sk_sp< SkImage > RasterFromPixmapCopy(const SkPixmap &pixmap)
sk_sp< const SkImage > image
Definition: SkRecords.h:269
Definition: copy.py:1
static SkImageInfo MakeA8(int width, int height)