Flutter Engine
The Flutter Engine
Shader_Methods_b.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.
4REG_FIDDLE(Shader_Methods_b, 256, 256, false, 0) {
5void draw(SkCanvas* canvas) {
8 bitmap.setInfo(SkImageInfo::MakeA8(5, 1), 5); // bitmap only contains alpha
9 uint8_t pixels[5] = { 0x22, 0x55, 0x88, 0xBB, 0xFF };
10 bitmap.setPixels(pixels);
14 paint.setColor(c); // all components in color affect shader
15 canvas->drawCircle(50, 50, 50, paint);
16 canvas->translate(70, 70);
17 }
18}
19} // END FIDDLE
REG_FIDDLE(Shader_Methods_b, 256, 256, false, 0)
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
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
void translate(SkScalar dx, SkScalar dy)
Definition: SkCanvas.cpp:1278
void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint &paint)
Definition: SkCanvas.cpp:2707
const Paint & paint
Definition: color_source.cc:38
Definition: bitmap.py:1
static SkImageInfo MakeA8(int width, int height)