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

Go to the source code of this file.

Functions

 REG_FIDDLE (skpaint_line_2d_path_effect, 256, 256, false, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( skpaint_line_2d_path_effect  ,
256  ,
256  ,
false  ,
 
)

Definition at line 4 of file skpaint_line_2d_path_effect.cpp.

4 {
5void draw(SkCanvas* canvas) {
7 SkMatrix lattice;
8 lattice.setScale(8.0f, 8.0f);
9 lattice.preRotate(30.0f);
10 paint.setPathEffect(SkLine2DPathEffect::Make(0.0f, lattice));
11 paint.setAntiAlias(true);
12 SkRect bounds = SkRect::MakeWH(256, 256);
13 bounds.outset(8.0f, 8.0f);
14 canvas->clear(SK_ColorWHITE);
15 canvas->drawRect(bounds, paint);
16}
17} // END FIDDLE
constexpr SkColor SK_ColorWHITE
Definition: SkColor.h:122
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 clear(SkColor color)
Definition: SkCanvas.h:1199
static sk_sp< SkPathEffect > Make(SkScalar width, const SkMatrix &matrix)
SkMatrix & setScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py)
Definition: SkMatrix.cpp:296
SkMatrix & preRotate(SkScalar degrees, SkScalar px, SkScalar py)
Definition: SkMatrix.cpp:462
const Paint & paint
Definition: color_source.cc:38
Optional< SkRect > bounds
Definition: SkRecords.h:189
static constexpr SkRect MakeWH(float w, float h)
Definition: SkRect.h:609