Flutter Engine
The Flutter Engine
Canvas_readPixels_3.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_3, 256, 256, true, 0) {
5void draw(SkCanvas* canvas) {
6 canvas->clear(0x8055aaff);
8 bitmap.allocPixels(SkImageInfo::MakeN32Premul(1, 1));
9 canvas->readPixels(bitmap, 0, 0);
10 SkDebugf("pixel = %08x\n", bitmap.getAddr32(0, 0)[0]);
11}
12} // END FIDDLE
REG_FIDDLE(Canvas_readPixels_3, 256, 256, true, 0)
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
Definition: bitmap.py:1
static SkImageInfo MakeN32Premul(int width, int height)