| 1 |
// Copyright 2019 Google LLC. |
| 2 |
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. |
| 3 |
#include "tools/fiddle/examples.h" |
| 4 |
REG_FIDDLE(Canvas_quickReject_2, 256, 256, true, 0) { |
| 5 |
void draw(SkCanvas* canvas) { |
| 6 |
SkPoint testPoints[] = {{30, 30}, {120, 30}, {120, 129} }; |
| 7 |
SkPoint clipPoints[] = {{30, 130}, {120, 130}, {120, 230} }; |
| 8 |
SkPath testPath = SkPath::Polygon(testPoints, true); |
| 9 |
SkPath clipPath = SkPath::Polygon(clipPoints, true); |
| 10 |
canvas->save(); |
| 11 |
canvas->clipPath(clipPath); |
| 12 |
SkDebugf("quickReject %s\n", canvas->quickReject(testPath) ? "true" : "false"); |
| 13 |
canvas->restore(); |
| 14 |
canvas->rotate(10); |
| 15 |
canvas->clipPath(clipPath); |
| 16 |
SkDebugf("quickReject %s\n", canvas->quickReject(testPath) ? "true" : "false"); |
| 17 |
} |
| 18 |
} // END FIDDLE |