Flutter Engine
The Flutter Engine
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"
12#include "include/core/SkRect.h"
13
14DEF_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.
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
DEF_SIMPLE_GM(b_119394958, canvas, 100, 100)
Definition: b_119394958.cpp:14
@ 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