Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
gm
b_119394958.cpp
Go to the documentation of this file.
1
/*
2
* Copyright 2018 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/SkColor.h
"
11
#include "
include/core/SkPaint.h
"
12
#include "
include/core/SkRect.h
"
13
14
DEF_SIMPLE_GM
(b_119394958, canvas, 100, 100) {
15
// The root cause of this bug was that a stroked arc with round caps was batched with a filled
16
// circle. The circle op code would choose a GeometryProcessor configuration that expected round
17
// cap centers as vertex attributes. However, the tessellation code for the filled circle would
18
// not put in zero-width round cap centers and then didn't advance the pointer into which
19
// vertex data was being written by the expected vertex stride.
20
SkPaint
paint
;
21
paint
.setColor(
SK_ColorBLUE
);
22
paint
.setAntiAlias(
true
);
23
canvas->drawCircle(50, 50, 45,
paint
);
24
paint
.setColor(
SK_ColorGREEN
);
25
paint
.setStyle(
SkPaint::kStroke_Style
);
26
paint
.setStrokeWidth(5);
27
canvas->drawCircle(50, 50, 35,
paint
);
28
paint
.setColor(
SK_ColorRED
);
29
paint
.setStrokeCap(
SkPaint::kRound_Cap
);
30
canvas->drawArc(
SkRect::MakeLTRB
(30, 30, 70, 70), 0, 110,
false
,
paint
);
31
}
SkCanvas.h
SkColor.h
SK_ColorBLUE
constexpr SkColor SK_ColorBLUE
Definition
SkColor.h:135
SK_ColorRED
constexpr SkColor SK_ColorRED
Definition
SkColor.h:126
SK_ColorGREEN
constexpr SkColor SK_ColorGREEN
Definition
SkColor.h:131
SkPaint.h
SkRect.h
SkPaint
Definition
SkPaint.h:44
SkPaint::kRound_Cap
@ kRound_Cap
adds circle
Definition
SkPaint.h:335
SkPaint::kStroke_Style
@ kStroke_Style
set to stroke geometry
Definition
SkPaint.h:194
paint
const Paint & paint
Definition
color_source.cc:38
gm.h
DEF_SIMPLE_GM
#define DEF_SIMPLE_GM(NAME, CANVAS, W, H)
Definition
gm.h:50
SkRect::MakeLTRB
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)
Definition
SkRect.h:646
Generated on Fri Apr 26 2024 06:16:00 for Flutter Engine by
1.9.8