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

Go to the source code of this file.

Functions

 REG_FIDDLE (Shader_Methods_b, 256, 256, false, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Shader_Methods_b  ,
256  ,
256  ,
false  ,
 
)

Definition at line 4 of file Shader_Methods_b.cpp.

4 {
5void draw(SkCanvas* canvas) {
8 bitmap.setInfo(SkImageInfo::MakeA8(5, 1), 5); // bitmap only contains alpha
9 uint8_t pixels[5] = { 0x22, 0x55, 0x88, 0xBB, 0xFF };
10 bitmap.setPixels(pixels);
14 paint.setColor(c); // all components in color affect shader
15 canvas->drawCircle(50, 50, 50, paint);
16 canvas->translate(70, 70);
17 }
18}
19} // END FIDDLE
uint32_t SkColor
Definition: SkColor.h:37
constexpr SkColor SK_ColorBLUE
Definition: SkColor.h:135
constexpr SkColor SK_ColorRED
Definition: SkColor.h:126
constexpr SkColor SK_ColorGREEN
Definition: SkColor.h:131
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
void translate(SkScalar dx, SkScalar dy)
Definition: SkCanvas.cpp:1278
void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint &paint)
Definition: SkCanvas.cpp:2707
const Paint & paint
Definition: color_source.cc:38
Definition: bitmap.py:1
static SkImageInfo MakeA8(int width, int height)