Flutter Engine
The Flutter Engine
Canvas_readPixels_b.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(Canvas_readPixels_b, 256, 256, true, 0) {
5void draw(SkCanvas* canvas) {
6 canvas->clear(0x8055aaff);
8 uint32_t pixel = 0;
10 if (canvas->readPixels(info, &pixel, 4, 0, 0)) {
11 SkDebugf("pixel = %08x\n", pixel);
12 }
13 }
14}
15} // END FIDDLE
REG_FIDDLE(Canvas_readPixels_b, 256, 256, true, 0)
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
kUnpremul_SkAlphaType
SkAlphaType
Definition: SkAlphaType.h:26
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
Definition: SkAlphaType.h:29
@ kBGRA_8888_SkColorType
pixel with 8 bits for blue, green, red, alpha; in 32-bit word
Definition: SkColorType.h:26
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
void clear(SkColor color)
Definition: SkCanvas.h:1199
bool readPixels(const SkImageInfo &dstInfo, void *dstPixels, size_t dstRowBytes, int srcX, int srcY)
Definition: SkCanvas.cpp:382
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)