Hal Canary | 8751512 | 2019-03-15 14:22:51 -0400 | [diff] [blame] | 1 | #if 0 // Disabled until updated to use current API. |
| 2 | // Copyright 2019 Google LLC. |
| 3 | // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. |
| 4 | #include "fiddle/examples.h" |
| 5 | // HASH=0bb057140e4119234bdd2e8dd2f0fa19 |
Hal Canary | a7181e7c | 2019-03-18 16:06:34 -0400 | [diff] [blame] | 6 | REG_FIDDLE(RRect_contains, 256, 110, false, 0) { |
Hal Canary | 8751512 | 2019-03-15 14:22:51 -0400 | [diff] [blame] | 7 | void draw(SkCanvas* canvas) { |
| 8 | SkRect test = {10, 10, 110, 80}; |
| 9 | SkRRect rrect = SkRRect::MakeRect(test); |
| 10 | SkRRect oval = SkRRect::MakeOval(test); |
| 11 | test.inset(10, 10); |
| 12 | SkPaint paint; |
| 13 | paint.setAntiAlias(true); |
| 14 | canvas->drawString(rrect.contains(test) ? "contains" : "does not contain", 55, 100, paint); |
| 15 | canvas->drawString(oval.contains(test) ? "contains" : "does not contain", 185, 100, paint); |
| 16 | paint.setStyle(SkPaint::kStroke_Style); |
| 17 | canvas->drawRRect(rrect, paint); |
| 18 | canvas->drawRect(test, paint); |
| 19 | canvas->translate(120, 0); |
| 20 | canvas->drawRRect(oval, paint); |
| 21 | canvas->drawRect(test, paint); |
| 22 | } |
| 23 | } // END FIDDLE |
| 24 | #endif // Disabled until updated to use current API. |