Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions
inverseclip.cpp File Reference
#include "gm/gm.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkPathBuilder.h"

Go to the source code of this file.

Functions

 DEF_SIMPLE_GM (inverseclip, canvas, 400, 400)
 

Function Documentation

◆ DEF_SIMPLE_GM()

DEF_SIMPLE_GM ( inverseclip  ,
canvas  ,
400  ,
400   
)

Definition at line 13 of file inverseclip.cpp.

13 {
16 clip.moveTo(195.448f, 31);
17 clip.cubicTo(97.9925f, 31, 18.99f, 105.23f, 18.99f, 196.797f);
18 clip.cubicTo(18.99f, 288.365f, 97.9925f, 362.595f, 195.448f, 362.595f);
19 clip.cubicTo(292.905f, 362.595f, 371.905f, 288.365f, 371.905f, 196.797f);
20 clip.cubicTo(371.905f, 105.23f, 292.905f, 31, 195.448f, 31);
21 clip.close();
22 canvas->clipPath(clip.detach(), true);
23
25 paint.setColor(SK_ColorBLUE);
26 canvas->drawRect(SkRect::MakeWH(400, 400), paint);
27}
constexpr SkColor SK_ColorBLUE
Definition SkColor.h:135
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
Definition SkPath.cpp:3824
SkPath & moveTo(SkScalar x, SkScalar y)
Definition SkPath.cpp:678
void setFillType(SkPathFillType ft)
Definition SkPath.h:235
SkPath detach()
Definition SkPath.h:147
SkPath & cubicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar x3, SkScalar y3)
Definition SkPath.cpp:789
SkPath & close()
Definition SkPath.cpp:813
const Paint & paint
static constexpr SkRect MakeWH(float w, float h)
Definition SkRect.h:609