Brian Salomon | 5ceda55 | 2018-12-14 16:03:38 -0500 | [diff] [blame] | 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.h" |
| 9 | |
| 10 | DEF_SIMPLE_GM(b_119394958, canvas, 100, 100) { |
| 11 | // The root cause of this bug was that a stroked arc with round caps was batched with a filled |
| 12 | // circle. The circle op code would choose a GeometryProcessor configuration that expected round |
| 13 | // cap centers as vertex attributes. However, the tessellation code for the filled circle would |
| 14 | // not put in dummy round cap centers and then didn't advance the pointer into which vertex data |
| 15 | // was being written by the expected vertex stride. |
| 16 | SkPaint paint; |
| 17 | paint.setColor(SK_ColorBLUE); |
| 18 | paint.setAntiAlias(true); |
| 19 | canvas->drawCircle(50, 50, 45, paint); |
| 20 | paint.setColor(SK_ColorGREEN); |
| 21 | paint.setStyle(SkPaint::kStroke_Style); |
| 22 | paint.setStrokeWidth(5); |
| 23 | canvas->drawCircle(50, 50, 35, paint); |
| 24 | paint.setColor(SK_ColorRED); |
| 25 | paint.setStrokeCap(SkPaint::kRound_Cap); |
| 26 | canvas->drawArc(SkRect::MakeLTRB(30, 30, 70, 70), 0, 110, false, paint); |
| 27 | } |