2016-05-12 14:07:05 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2016 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
2019-04-23 17:05:21 +00:00
|
|
|
#include "gm/gm.h"
|
|
|
|
#include "include/core/SkCanvas.h"
|
2019-05-01 14:59:30 +00:00
|
|
|
#include "include/core/SkPaint.h"
|
2020-08-16 15:15:41 +00:00
|
|
|
#include "include/core/SkPathBuilder.h"
|
2019-04-23 17:05:21 +00:00
|
|
|
#include "include/core/SkRect.h"
|
2019-05-01 14:59:30 +00:00
|
|
|
#include "include/core/SkScalar.h"
|
2016-05-12 14:07:05 +00:00
|
|
|
|
|
|
|
DEF_SIMPLE_GM(bug5252, canvas, 500, 500) {
|
|
|
|
canvas->translate(SkIntToScalar(10), SkIntToScalar(20));
|
|
|
|
|
2020-08-25 15:48:41 +00:00
|
|
|
canvas->clipPath(SkPath::Oval(SkRect::MakeWH(225, 200))); // bug
|
2016-05-12 14:07:05 +00:00
|
|
|
|
2020-08-25 15:48:41 +00:00
|
|
|
//canvas->clipPath(SkPath::Oval(SkRect::MakeWH(220, 200))); // ok
|
2016-05-12 14:07:05 +00:00
|
|
|
|
|
|
|
SkPaint pa;
|
|
|
|
pa.setStyle(SkPaint::kStroke_Style);
|
|
|
|
pa.setAntiAlias(true);
|
|
|
|
pa.setStrokeWidth(1.0f);
|
|
|
|
for (int i = 0; i < 15; i++)
|
|
|
|
{
|
|
|
|
for (int j = 0; j < 10; j++)
|
|
|
|
{
|
|
|
|
SkAutoCanvasRestore acs(canvas, true);
|
|
|
|
|
|
|
|
canvas->translate(i * 15.f, j * 20.f);
|
|
|
|
canvas->drawRect(SkRect::MakeXYWH(5, 5, 10, 15),pa);
|
2020-08-16 15:15:41 +00:00
|
|
|
canvas->drawPath(SkPathBuilder().moveTo(6, 6)
|
|
|
|
.cubicTo(14, 10, 13, 12, 10, 12)
|
|
|
|
.cubicTo(7, 15, 8, 17, 14, 18)
|
|
|
|
.detach(), pa);
|
2016-05-12 14:07:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|