Large circle clipping gm.

Seeing if this reproduces a reported problem on PowerVR devices.

Bug: b/123437630

Change-Id: I161cd04034cb7d217ff519a4b26e521bf36ed4b5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212727
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This commit is contained in:
Brian Salomon 2019-05-09 09:20:28 -04:00 committed by Skia Commit-Bot
parent 693bc2bae5
commit 360dc593c0
2 changed files with 36 additions and 0 deletions

35
gm/largecircleclip.cpp Normal file
View File

@ -0,0 +1,35 @@
/*
* Copyright 2019 Google LLC
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "gm.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkPaint.h"
#include "include/core/SkRRect.h"
#include "include/utils/SkRandom.h"
// Tests clipping against circles with large coordinates, both aa and non-aa.
DEF_SIMPLE_GM(large_circle_clip, canvas, 2048, 2048) {
SkRandom random;
auto circle = SkRRect::MakeOval(SkRect::MakeWH(2048, 2048));
bool aa = true;
do {
SkColor4f color;
color.fR = random.nextRangeF(0, 1);
color.fG = random.nextRangeF(0, 1);
color.fB = random.nextRangeF(0, 1);
color.fA = 1.f;
SkPaint paint;
paint.setColor4f(color, nullptr);
canvas->save();
canvas->clipRRect(circle, aa);
canvas->drawPaint(paint);
canvas->restore();
circle.setOval(circle.getBounds().makeOffset(20, 20).makeInset(25.f, 25.f));
aa = !aa;
} while (circle.getBounds().width() > 25.f);
}

View File

@ -212,6 +212,7 @@ gm_sources = [
"$_gm/internal_links.cpp",
"$_gm/inversepaths.cpp",
"$_gm/jpg_color_cube.cpp",
"$_gm/largecircleclip.cpp",
"$_gm/largeglyphblur.cpp",
"$_gm/lattice.cpp",
"$_gm/lcdblendmodes.cpp",