skia2/gm/bug5252.cpp
Mike Klein c0bd9f9fe5 rewrite includes to not need so much -Ifoo
Current strategy: everything from the top

Things to look at first are the manual changes:

   - added tools/rewrite_includes.py
   - removed -Idirectives from BUILD.gn
   - various compile.sh simplifications
   - tweak tools/embed_resources.py
   - update gn/find_headers.py to write paths from the top
   - update gn/gn_to_bp.py SkUserConfig.h layout
     so that #include "include/config/SkUserConfig.h" always
     gets the header we want.

No-Presubmit: true
Change-Id: I73a4b181654e0e38d229bc456c0d0854bae3363e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209706
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-04-24 16:27:11 +00:00

44 lines
1014 B
C++

/*
* Copyright 2016 Google Inc.
*
* 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/SkPath.h"
#include "include/core/SkRect.h"
DEF_SIMPLE_GM(bug5252, canvas, 500, 500) {
canvas->translate(SkIntToScalar(10), SkIntToScalar(20));
SkPath clip1;
clip1.addOval(SkRect::MakeWH(225, 200));
canvas->clipPath(clip1); // bug
SkPath clip2;
clip2.addRect(SkRect::MakeWH(220, 200));
//canvas->clipPath(clip2); // ok
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);
SkPath path;
path.moveTo(6, 6);
path.cubicTo(14, 10, 13, 12, 10, 12);
path.cubicTo(7, 15, 8, 17, 14, 18);
canvas->drawPath(path, pa);
}
}
}