Flutter Engine
The Flutter Engine
Functions
crbug_1041204.cpp File Reference
#include "gm/gm.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkMatrix.h"

Go to the source code of this file.

Functions

 DEF_SIMPLE_GM (crbug_10141204, canvas, 512, 512)
 

Function Documentation

◆ DEF_SIMPLE_GM()

DEF_SIMPLE_GM ( crbug_10141204  ,
canvas  ,
512  ,
512   
)

Definition at line 13 of file crbug_1041204.cpp.

13 {
14 // While the coordinates are giant and the transform is not axis-aligned, this should
15 // fill the screen left side with solid blue. This has an extra zoom factor compared to the
16 // canvas JS in order to more visibly highlight the numerical issues that caused the bug.
17 // (The original transform would have completely filled the screen with solid blue, so the bug
18 // manifested as an improper discard on occasion. With the new scale factor, the bug manifests
19 // as either an improper fullscreen clear or an improper discard, instead).
20 SkScalar extraZoom = exp(-2.3f);
21 canvas->scale(extraZoom, extraZoom);
22 canvas->scale(2.f, 2.f);
23 canvas->concat(SkMatrix::MakeAll(
24 -0.0005550860255665798f, -0.0030798374421905717f, -0.014111959825129805f,
25 -0.07569627776417084f, 232.00000000000017f, 39.999999999999936f,
26 0.f, 0.f, 1.f));
27 canvas->translate(-3040103.0493857153f, 337502.1103282161f);
28 canvas->scale(9783.93962050256f, -9783.93962050256f);
29
31 paint.setColor(SK_ColorBLUE);
32 paint.setAntiAlias(true);
33 canvas->drawRect(SkRect::MakeWH(512, 512), paint);
34}
constexpr SkColor SK_ColorBLUE
Definition: SkColor.h:135
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
const Paint & paint
Definition: color_source.cc:38
float SkScalar
Definition: extension.cpp:12
static constexpr SkRect MakeWH(float w, float h)
Definition: SkRect.h:609