• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2020 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(rotations, 256, 256, false, 0) {
draw(SkCanvas * canvas)5 void draw(SkCanvas* canvas) {
6     canvas->translate(128, 0);
7     canvas->rotate(60);
8     SkRect rect = SkRect::MakeXYWH(0, 0, 200, 100);
9 
10     SkPaint paint;
11     paint.setAntiAlias(true);
12     paint.setColor(0xff4285F4);
13     canvas->drawRect(rect, paint);
14 
15     canvas->rotate(SkIntToScalar(20));
16     paint.setColor(0xffDB4437);
17     canvas->drawRect(rect, paint);
18 }
19 }  // END FIDDLE
20