Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
gm
bug5252.cpp
Go to the documentation of this file.
1
/*
2
* Copyright 2016 Google Inc.
3
*
4
* Use of this source code is governed by a BSD-style license that can be
5
* found in the LICENSE file.
6
*/
7
8
#include "
gm/gm.h
"
9
#include "
include/core/SkCanvas.h
"
10
#include "
include/core/SkPaint.h
"
11
#include "
include/core/SkPathBuilder.h
"
12
#include "
include/core/SkRect.h
"
13
#include "
include/core/SkScalar.h
"
14
15
DEF_SIMPLE_GM
(bug5252, canvas, 500, 500) {
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;
23
pa.
setStyle
(
SkPaint::kStroke_Style
);
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
}
SkCanvas.h
SkPaint.h
SkPathBuilder.h
SkRect.h
SkScalar.h
SkIntToScalar
#define SkIntToScalar(x)
Definition
SkScalar.h:57
SkAutoCanvasRestore
Definition
SkCanvas.h:2645
SkPaint
Definition
SkPaint.h:44
SkPaint::setStyle
void setStyle(Style style)
Definition
SkPaint.cpp:105
SkPaint::setAntiAlias
void setAntiAlias(bool aa)
Definition
SkPaint.h:170
SkPaint::kStroke_Style
@ kStroke_Style
set to stroke geometry
Definition
SkPaint.h:194
SkPaint::setStrokeWidth
void setStrokeWidth(SkScalar width)
Definition
SkPaint.cpp:159
SkPathBuilder
Definition
SkPathBuilder.h:25
SkPath::Oval
static SkPath Oval(const SkRect &, SkPathDirection=SkPathDirection::kCW)
Definition
SkPath.cpp:3522
gm.h
DEF_SIMPLE_GM
#define DEF_SIMPLE_GM(NAME, CANVAS, W, H)
Definition
gm.h:50
SkRect::MakeXYWH
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
Definition
SkRect.h:659
SkRect::MakeWH
static constexpr SkRect MakeWH(float w, float h)
Definition
SkRect.h:609
Generated on Fri Apr 26 2024 06:16:00 for Flutter Engine by
1.9.8