Add GM for crbug:10141204

Bug: skia:9779, chromium:10141204
Change-Id: If075e04373a141343ce368c1b28a494047a396f9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265876
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
This commit is contained in:
Michael Ludwig 2020-01-22 14:39:35 -05:00 committed by Skia Commit-Bot
parent e4ddb8a7cd
commit 87211cd0ba
2 changed files with 35 additions and 0 deletions

34
gm/crbug_1041204.cpp Normal file
View File

@ -0,0 +1,34 @@
/*
* Copyright 2020 Google LLC
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "gm/gm.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkMatrix.h"
DEF_SIMPLE_GM(crbug_10141204, canvas, 512, 512) {
// While the coordinates are giant and the transform is not axis-aligned, this should
// fill the screen left side with solid blue. This has an extra zoom factor compared to the
// canvas JS in order to more visibly highlight the numerical issues that caused the bug.
// (The original transform would have completely filled the screen with solid blue, so the bug
// manifested as an improper discard on occasion. With the new scale factor, the bug manifests
// as either an improper fullscreen clear or an improper discard, instead).
SkScalar extraZoom = exp(-2.3f);
canvas->scale(extraZoom, extraZoom);
canvas->scale(2.f, 2.f);
canvas->concat(SkMatrix::MakeAll(
-0.0005550860255665798f, -0.0030798374421905717f, -0.014111959825129805f,
-0.07569627776417084f, 232.00000000000017f, 39.999999999999936f,
0.f, 0.f, 1.f));
canvas->translate(-3040103.0493857153f, 337502.1103282161f);
canvas->scale(9783.93962050256f, -9783.93962050256f);
SkPaint paint;
paint.setColor(SK_ColorBLUE);
paint.setAntiAlias(true);
canvas->drawRect(SkRect::MakeWH(512, 512), paint);
}

View File

@ -120,6 +120,7 @@ gm_sources = [
"$_gm/crbug_946965.cpp", "$_gm/crbug_946965.cpp",
"$_gm/crbug_947055.cpp", "$_gm/crbug_947055.cpp",
"$_gm/crbug_996140.cpp", "$_gm/crbug_996140.cpp",
"$_gm/crbug_1041204.cpp",
"$_gm/croppedrects.cpp", "$_gm/croppedrects.cpp",
"$_gm/crosscontextimage.cpp", "$_gm/crosscontextimage.cpp",
"$_gm/cubicpaths.cpp", "$_gm/cubicpaths.cpp",