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

Go to the source code of this file.

Functions

 REG_FIDDLE (Color_Constants_b, 256, 256, false, 3)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Color_Constants_b  ,
256  ,
256  ,
false  ,
 
)

Definition at line 4 of file Color_Constants_b.cpp.

4 {
5void draw(SkCanvas* canvas) {
6 std::vector<uint32_t> srcPixels;
7 constexpr int width = 256;
8 constexpr int height = 256;
9 srcPixels.resize(width * height);
11 SkPixmap pixmap(imageInfo, &srcPixels.front(), imageInfo.minRowBytes());
12 pixmap.erase(SK_ColorTRANSPARENT);
13 pixmap.erase(SK_ColorRED, { 24, 24, 192, 192 } );
14 pixmap.erase(SK_ColorTRANSPARENT, { 48, 48, 168, 168 } );
16 bitmap.installPixels(pixmap);
17 canvas->drawImage(bitmap.asImage(), 0, 0);
18 canvas->drawImage(bitmap.asImage(), 48, 48);
19}
20} // END FIDDLE
constexpr SkColor SK_ColorTRANSPARENT
Definition: SkColor.h:99
constexpr SkColor SK_ColorRED
Definition: SkColor.h:126
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
Definition: SkCanvas.h:1528
Definition: bitmap.py:1
int32_t height
int32_t width
static SkImageInfo MakeN32Premul(int width, int height)
size_t minRowBytes() const
Definition: SkImageInfo.h:517