Flutter Engine
The Flutter Engine
Functions
bug5252.cpp File Reference
#include "gm/gm.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPathBuilder.h"
#include "include/core/SkRect.h"
#include "include/core/SkScalar.h"

Go to the source code of this file.

Functions

 DEF_SIMPLE_GM (bug5252, canvas, 500, 500)
 

Function Documentation

◆ DEF_SIMPLE_GM()

DEF_SIMPLE_GM ( bug5252  ,
canvas  ,
500  ,
500   
)

Definition at line 15 of file bug5252.cpp.

15 {
16 canvas->translate(SkIntToScalar(10), SkIntToScalar(20));
17
18 canvas->clipPath(SkPath::Oval(SkRect::MakeWH(225, 200))); // bug
19
20 //canvas->clipPath(SkPath::Oval(SkRect::MakeWH(220, 200))); // ok
21
22 SkPaint pa;
24 pa.setAntiAlias(true);
25 pa.setStrokeWidth(1.0f);
26 for (int i = 0; i < 15; i++)
27 {
28 for (int j = 0; j < 10; j++)
29 {
30 SkAutoCanvasRestore acs(canvas, true);
31
32 canvas->translate(i * 15.f, j * 20.f);
33 canvas->drawRect(SkRect::MakeXYWH(5, 5, 10, 15),pa);
34 canvas->drawPath(SkPathBuilder().moveTo(6, 6)
35 .cubicTo(14, 10, 13, 12, 10, 12)
36 .cubicTo(7, 15, 8, 17, 14, 18)
37 .detach(), pa);
38 }
39 }
40}
#define SkIntToScalar(x)
Definition: SkScalar.h:57
void setStyle(Style style)
Definition: SkPaint.cpp:105
void setAntiAlias(bool aa)
Definition: SkPaint.h:170
@ kStroke_Style
set to stroke geometry
Definition: SkPaint.h:194
void setStrokeWidth(SkScalar width)
Definition: SkPaint.cpp:159
static SkPath Oval(const SkRect &, SkPathDirection=SkPathDirection::kCW)
Definition: SkPath.cpp:3590
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
Definition: SkRect.h:659
static constexpr SkRect MakeWH(float w, float h)
Definition: SkRect.h:609