2019-09-24 02:16:03 +00:00
|
|
|
/*
|
|
|
|
* 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/gm.h"
|
|
|
|
#include "include/core/SkCanvas.h"
|
2020-08-26 16:56:51 +00:00
|
|
|
#include "include/core/SkPathBuilder.h"
|
2019-09-24 02:16:03 +00:00
|
|
|
|
|
|
|
// Repro case for http://skbug.com/9453
|
|
|
|
DEF_SIMPLE_GM(inverseclip, canvas, 400, 400) {
|
2020-08-26 16:56:51 +00:00
|
|
|
SkPathBuilder clip;
|
2019-11-26 17:17:17 +00:00
|
|
|
clip.setFillType(SkPathFillType::kInverseWinding);
|
2019-09-24 02:16:03 +00:00
|
|
|
clip.moveTo(195.448f, 31);
|
|
|
|
clip.cubicTo(97.9925f, 31, 18.99f, 105.23f, 18.99f, 196.797f);
|
|
|
|
clip.cubicTo(18.99f, 288.365f, 97.9925f, 362.595f, 195.448f, 362.595f);
|
|
|
|
clip.cubicTo(292.905f, 362.595f, 371.905f, 288.365f, 371.905f, 196.797f);
|
|
|
|
clip.cubicTo(371.905f, 105.23f, 292.905f, 31, 195.448f, 31);
|
|
|
|
clip.close();
|
2020-08-26 16:56:51 +00:00
|
|
|
canvas->clipPath(clip.detach(), true);
|
2019-09-24 02:16:03 +00:00
|
|
|
|
|
|
|
SkPaint paint;
|
|
|
|
paint.setColor(SK_ColorBLUE);
|
|
|
|
canvas->drawRect(SkRect::MakeWH(400, 400), paint);
|
|
|
|
}
|