Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
UnicornPoop.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(UnicornPoop, 256, 256, false, 0) {
5void draw(SkCanvas* canvas) {
6 SkPaint p;
7 p.setAntiAlias(true);
8 p.setStyle(SkPaint::kStroke_Style);
9 p.setStrokeWidth(10);
10
11 for (int r = 0; r <= 255; r += 10) {
12 for (int g = 0; g <= 255; g += 10) {
13 for (int b = 0; b <= 255; b += 10) {
14 p.setColor(SkColorSetRGB(r, g, b));
15 canvas->drawRect(SkRect::MakeXYWH(r, g, b, 1), p);
16 }
17 }
18 }
19}
20} // END FIDDLE
#define SkColorSetRGB(r, g, b)
Definition SkColor.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)
@ kStroke_Style
set to stroke geometry
Definition SkPaint.h:194
#define REG_FIDDLE(NAME, W, H, TEXT, I)
Definition examples.h:60
static bool b
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
Definition SkRect.h:659