| 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(RRect_makeOffset, 256, 256, false, 0) { |
| 5 |
void draw(SkCanvas* canvas) { |
| 6 |
SkPaint paint; |
| 7 |
paint.setAntiAlias(true); |
| 8 |
paint.setStyle(SkPaint::kStroke_Style); |
| 9 |
SkRRect rrect = SkRRect::MakeRectXY({100, 20, 140, 220}, 50, 100); |
| 10 |
for (int index = 0; index < 25; ++index) { |
| 11 |
canvas->drawRRect(rrect, paint); |
| 12 |
rrect = rrect.makeOffset(-3, 3); |
| 13 |
} |
| 14 |
} |
| 15 |
} // END FIDDLE |