Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions
crbug_1139750.cpp File Reference
#include "gm/gm.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkPaint.h"
#include "include/core/SkRRect.h"

Go to the source code of this file.

Functions

 DEF_SIMPLE_GM_BG (crbug_1139750, canvas, 50, 50, SK_ColorWHITE)
 

Function Documentation

◆ DEF_SIMPLE_GM_BG()

DEF_SIMPLE_GM_BG ( crbug_1139750  ,
canvas  ,
50  ,
50  ,
SK_ColorWHITE   
)

Definition at line 13 of file crbug_1139750.cpp.

13 {
14 // Draw a round-rect with a (slightly) non-square scale. This forces the GPU backend to use
15 // the elliptical round-rect op. We set the stroke width to exactly double the radii, which
16 // makes the inner radii exactly zero. The shader uses the inverse inner radii to compute the
17 // coverage ramp, so this would end up producing infinity, and the geometry would disappear.
18 SkPaint p;
19 p.setAntiAlias(true);
20 p.setStyle(SkPaint::kStroke_Style);
21 p.setStrokeWidth(2);
22
23 SkRect r = SkRect::MakeXYWH(1, 1, 19, 19);
24 SkRRect rr = SkRRect::MakeRectXY(r, 1, 1);
25
26 canvas->translate(10, 10);
27 canvas->scale(1.47619f, 1.52381f);
28 canvas->drawRRect(rr, p);
29}
@ kStroke_Style
set to stroke geometry
Definition SkPaint.h:194
static SkRRect MakeRectXY(const SkRect &rect, SkScalar xRad, SkScalar yRad)
Definition SkRRect.h:180
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
Definition SkRect.h:659