Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
gm
crbug_1139750.cpp
Go to the documentation of this file.
1
/*
2
* Copyright 2020 Google LLC
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/SkPaint.h
"
11
#include "
include/core/SkRRect.h
"
12
13
DEF_SIMPLE_GM_BG
(crbug_1139750, canvas, 50, 50,
SK_ColorWHITE
) {
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
}
SkCanvas.h
SK_ColorWHITE
constexpr SkColor SK_ColorWHITE
Definition
SkColor.h:122
SkPaint.h
SkRRect.h
SkPaint
Definition
SkPaint.h:44
SkPaint::kStroke_Style
@ kStroke_Style
set to stroke geometry
Definition
SkPaint.h:194
SkRRect
Definition
SkRRect.h:35
SkRRect::MakeRectXY
static SkRRect MakeRectXY(const SkRect &rect, SkScalar xRad, SkScalar yRad)
Definition
SkRRect.h:180
gm.h
DEF_SIMPLE_GM_BG
#define DEF_SIMPLE_GM_BG(NAME, CANVAS, W, H, BGCOLOR)
Definition
gm.h:52
SkRect
Definition
extension.cpp:13
SkRect::MakeXYWH
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
Definition
SkRect.h:659
Generated on Fri Apr 26 2024 06:16:01 for Flutter Engine by
1.9.8