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

Go to the source code of this file.

Functions

 REG_FIDDLE (Paint_setShader, 256, 64, false, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Paint_setShader  ,
256  ,
64  ,
false  ,
 
)

Definition at line 4 of file Paint_setShader.cpp.

4 {
5void draw(SkCanvas* canvas) {
7 paint.setColor(SK_ColorBLUE);
9 canvas->drawRect(SkRect::MakeWH(40, 40), paint);
10 paint.setShader(nullptr);
11 canvas->translate(50, 0);
12 canvas->drawRect(SkRect::MakeWH(40, 40), paint);
13}
14} // 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 drawRect(const SkRect &rect, const SkPaint &paint)
Definition: SkCanvas.cpp:1673
void translate(SkScalar dx, SkScalar dy)
Definition: SkCanvas.cpp:1278
const Paint & paint
Definition: color_source.cc:38
SK_API sk_sp< SkShader > Color(SkColor)
static constexpr SkRect MakeWH(float w, float h)
Definition: SkRect.h:609