Flutter Engine
The Flutter Engine
rotations.cpp
Go to the documentation of this file.
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.
4REG_FIDDLE(rotations, 256, 256, false, 0) {
5void draw(SkCanvas* canvas) {
6 canvas->translate(128, 0);
7 canvas->rotate(60);
8 SkRect rect = SkRect::MakeXYWH(0, 0, 200, 100);
9
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
#define SkIntToScalar(x)
Definition: SkScalar.h:57
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
void drawRect(const SkRect &rect, const SkPaint &paint)
Definition: SkCanvas.cpp:1673
void translate(SkScalar dx, SkScalar dy)
Definition: SkCanvas.cpp:1278
void rotate(SkScalar degrees)
Definition: SkCanvas.cpp:1300
const Paint & paint
Definition: color_source.cc:38
sk_sp< SkBlender > blender SkRect rect
Definition: SkRecords.h:350
REG_FIDDLE(rotations, 256, 256, false, 0)
Definition: rotations.cpp:4
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
Definition: SkRect.h:659