Flutter Engine
The Flutter Engine
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"
11#include "include/core/SkRect.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.
17DEF_SIMPLE_GM(crbug_1167277, canvas, 230, 320) {
18 canvas->translate(-1250, -900);
19 // Matrix, clip, and quad values taken from Chrome repro scenario.
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)}};
31 for (int flags = 0; flags < static_cast<int>(SkCanvas::kAll_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
@ kSrcOver
r = s + (1-sa)*d
uint32_t SkColor
Definition: SkColor.h:37
constexpr SkColor SK_ColorGREEN
Definition: SkColor.h:131
static float SkBits2Float(uint32_t bits)
Definition: SkFloatBits.h:48
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
Definition: SkPath.cpp:3892
@ kAll_QuadAAFlags
Definition: SkCanvas.h:1665
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
DEF_SIMPLE_GM(crbug_1167277, canvas, 230, 320)
DlColor color
FlutterSemanticsFlag flags
sk_sp< SkBlender > blender SkRect rect
Definition: SkRecords.h:350