Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
gm
crbug_1167277.cpp
Go to the documentation of this file.
1
/*
2
* Copyright 2021 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/SkMatrix.h
"
11
#include "
include/core/SkRect.h
"
12
#include "
src/base/SkFloatBits.h
"
13
14
// This quad would, depending on which aa flags are used, would degenerate when inset. We'd replace
15
// and duplicate some of the inset points to make a triangle. However, one of the triangle points
16
// would be far outside the original quad.
17
DEF_SIMPLE_GM
(crbug_1167277, canvas, 230, 320) {
18
canvas->translate(-1250, -900);
19
// Matrix, clip, and quad values taken from Chrome repro scenario.
20
SkMatrix
ctm =
SkMatrix::MakeAll
(
21
SkBits2Float
(0xbf8fcfae),
SkBits2Float
(0xbeae25ee),
SkBits2Float
(0x449ca6db),
22
SkBits2Float
(0x3c9dc40f),
SkBits2Float
(0xbf950e35),
SkBits2Float
(0x4487da43),
23
SkBits2Float
(0xb8d4d6bc),
SkBits2Float
(0xb92fbb29),
SkBits2Float
(0x3f6f605c));
24
SkRect
rect = {
SkBits2Float
(0x00000000),
SkBits2Float
(0x00000000),
25
SkBits2Float
(0x41880000),
SkBits2Float
(0x43440000)};
26
SkPoint
clip
[4] = {{
SkBits2Float
(0x3ef434a2),
SkBits2Float
(0x43440004)},
27
{
SkBits2Float
(0x00000000),
SkBits2Float
(0x43440009)},
28
{
SkBits2Float
(0x38ef605d),
SkBits2Float
(0x38ef605d)},
29
{
SkBits2Float
(0x3ef436e3),
SkBits2Float
(0x396f5d30)}};
30
SkColor
color
=
SK_ColorGREEN
;
31
for
(
int
flags
= 0; flags < static_cast<int>(
SkCanvas::kAll_QuadAAFlags
); ++
flags
) {
32
SkCanvas::QuadAAFlags
aaFlags =
static_cast<
SkCanvas::QuadAAFlags
>
(
flags
);
33
canvas->save();
34
canvas->concat(ctm);
35
canvas->experimental_DrawEdgeAAQuad(rect,
clip
, aaFlags,
color
,
SkBlendMode::kSrcOver
);
36
canvas->restore();
37
canvas->translate(5, 0);
38
SkColor
rgb =
color
& 0x00FFFFFF;
39
color
= 0xFF000000 | (rgb << 4) | (rgb >> 20);
40
}
41
}
42
color
SkColor4f color
Definition
ImageShaderTest.cpp:28
SkBlendMode::kSrcOver
@ kSrcOver
r = s + (1-sa)*d
SkCanvas.h
SkColor
uint32_t SkColor
Definition
SkColor.h:37
SK_ColorGREEN
constexpr SkColor SK_ColorGREEN
Definition
SkColor.h:131
SkFloatBits.h
SkBits2Float
static float SkBits2Float(uint32_t bits)
Definition
SkFloatBits.h:48
SkMatrix.h
clip
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
Definition
SkPath.cpp:3824
SkRect.h
SkCanvas::QuadAAFlags
QuadAAFlags
Definition
SkCanvas.h:1658
SkCanvas::kAll_QuadAAFlags
@ kAll_QuadAAFlags
Definition
SkCanvas.h:1665
SkMatrix
Definition
SkMatrix.h:54
SkMatrix::MakeAll
static SkMatrix MakeAll(SkScalar scaleX, SkScalar skewX, SkScalar transX, SkScalar skewY, SkScalar scaleY, SkScalar transY, SkScalar pers0, SkScalar pers1, SkScalar pers2)
Definition
SkMatrix.h:179
flags
FlutterSemanticsFlag flags
Definition
fl_accessible_node.cc:105
gm.h
DEF_SIMPLE_GM
#define DEF_SIMPLE_GM(NAME, CANVAS, W, H)
Definition
gm.h:50
SkPoint
Definition
SkPoint_impl.h:163
SkRect
Definition
extension.cpp:13
Generated on Fri Apr 26 2024 06:16:01 for Flutter Engine by
1.9.8