Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Canvas_accessTopLayerPixels_a.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=38d0d6ca9bea146d31bcbec197856359
5REG_FIDDLE(Canvas_accessTopLayerPixels_a, 256, 256, false, 0) {
6void draw(SkCanvas* canvas) {
7 if (canvas->accessTopLayerPixels(nullptr, nullptr)) {
8 canvas->clear(SK_ColorRED);
9 } else {
10 canvas->clear(SK_ColorBLUE);
11 }
12}
13} // END FIDDLE
constexpr SkColor SK_ColorBLUE
Definition SkColor.h:135
constexpr SkColor SK_ColorRED
Definition SkColor.h:126
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition aaclip.cpp:27
void clear(SkColor color)
Definition SkCanvas.h:1199
void * accessTopLayerPixels(SkImageInfo *info, size_t *rowBytes, SkIPoint *origin=nullptr)
#define REG_FIDDLE(NAME, W, H, TEXT, I)
Definition examples.h:60