Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Canvas_drawPaint.cpp
Go to the documentation of this file.
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.
4// HASH=1cd076b9b1a7c976cdca72b93c4f42dd
5REG_FIDDLE(Canvas_drawPaint, 256, 256, false, 0) {
6void draw(SkCanvas* canvas) {
8 SkScalar pos[] = { 0, SK_Scalar1/2, SK_Scalar1 };
10 paint.setShader(SkGradientShader::MakeSweep(256, 256, colors, pos, std::size(colors)));
11 canvas->drawPaint(paint);
12}
13} // END FIDDLE
SkPoint pos
uint32_t SkColor
Definition SkColor.h:37
constexpr SkColor SK_ColorBLUE
Definition SkColor.h:135
constexpr SkColor SK_ColorRED
Definition SkColor.h:126
constexpr SkColor SK_ColorGREEN
Definition SkColor.h:131
#define SK_Scalar1
Definition SkScalar.h:18
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition aaclip.cpp:27
void drawPaint(const SkPaint &paint)
static sk_sp< SkShader > MakeSweep(SkScalar cx, SkScalar cy, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, SkScalar startAngle, SkScalar endAngle, uint32_t flags, const SkMatrix *localMatrix)
const Paint & paint
#define REG_FIDDLE(NAME, W, H, TEXT, I)
Definition examples.h:60
float SkScalar
Definition extension.cpp:12