Flutter Engine
The Flutter Engine
Functions
Canvas_drawBitmapRect_3.cpp File Reference
#include "tools/fiddle/examples.h"

Go to the source code of this file.

Functions

 REG_FIDDLE (Canvas_drawBitmapRect_3, 256, 64, false, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Canvas_drawBitmapRect_3  ,
256  ,
64  ,
false  ,
 
)

Definition at line 4 of file Canvas_drawBitmapRect_3.cpp.

4 {
5void draw(SkCanvas* canvas) {
6 uint32_t pixels[][2] = { { 0x00000000, 0x55550000},
7 { 0xAAAA0000, 0xFFFF0000} };
9 bitmap.installPixels(SkImageInfo::MakeN32Premul(2, 2),
10 (void*) pixels, sizeof(pixels[0]));
12 canvas->scale(4, 4);
13 for (auto color : { SK_ColorRED, SK_ColorBLUE, SK_ColorGREEN } ) {
15 canvas->drawImageRect(bitmap.asImage().get(), SkRect::MakeWH(8, 8),
17 canvas->translate(8, 0);
18 }
19}
20} // END FIDDLE
@ kPlus
r = min(s + d, 1)
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 drawImageRect(const SkImage *, const SkRect &src, const SkRect &dst, const SkSamplingOptions &, const SkPaint *, SrcRectConstraint)
Definition: SkCanvas.cpp:2333
void scale(SkScalar sx, SkScalar sy)
Definition: SkCanvas.cpp:1289
static sk_sp< SkColorFilter > Blend(const SkColor4f &c, sk_sp< SkColorSpace >, SkBlendMode mode)
const Paint & paint
Definition: color_source.cc:38
DlColor color
Definition: bitmap.py:1
static SkImageInfo MakeN32Premul(int width, int height)
static constexpr SkRect MakeWH(float w, float h)
Definition: SkRect.h:609