Flutter Engine
The Flutter Engine
Functions
b_119394958.cpp File Reference
#include "gm/gm.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkPaint.h"
#include "include/core/SkRect.h"

Go to the source code of this file.

Functions

 DEF_SIMPLE_GM (b_119394958, canvas, 100, 100)
 

Function Documentation

◆ DEF_SIMPLE_GM()

DEF_SIMPLE_GM ( b_119394958  ,
canvas  ,
100  ,
100   
)

Definition at line 14 of file b_119394958.cpp.

14 {
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.
21 paint.setColor(SK_ColorBLUE);
22 paint.setAntiAlias(true);
23 canvas->drawCircle(50, 50, 45, paint);
24 paint.setColor(SK_ColorGREEN);
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}
constexpr SkColor SK_ColorBLUE
Definition: SkColor.h:135
constexpr SkColor SK_ColorRED
Definition: SkColor.h:126
constexpr SkColor SK_ColorGREEN
Definition: SkColor.h:131
@ kRound_Cap
adds circle
Definition: SkPaint.h:335
@ kStroke_Style
set to stroke geometry
Definition: SkPaint.h:194
const Paint & paint
Definition: color_source.cc:38
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)
Definition: SkRect.h:646