Flutter Engine
The Flutter Engine
Functions
Canvas_accessTopLayerPixels_a.cpp File Reference
#include "tools/fiddle/examples.h"

Go to the source code of this file.

Functions

 REG_FIDDLE (Canvas_accessTopLayerPixels_a, 256, 256, false, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Canvas_accessTopLayerPixels_a  ,
256  ,
256  ,
false  ,
 
)

Definition at line 4 of file Canvas_accessTopLayerPixels_a.cpp.

4 {
5void draw(SkCanvas* canvas) {
6 if (canvas->accessTopLayerPixels(nullptr, nullptr)) {
7 canvas->clear(SK_ColorRED);
8 } else {
9 canvas->clear(SK_ColorBLUE);
10 }
11}
12} // 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)
Definition: SkCanvas.cpp:1245