Flutter Engine
The Flutter Engine
Bitmap_writePixels_2.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(Bitmap_writePixels_2, 256, 80, false, 0) {
5void draw(SkCanvas* canvas) {
7 bitmap.allocPixels(SkImageInfo::MakeN32Premul(2, 2));
8 bitmap.eraseColor(SK_ColorGREEN);
9 SkPMColor color = 0xFF5599BB;
11 bitmap.writePixels(src);
12 canvas->scale(40, 40);
13 canvas->drawImage(bitmap.asImage(), 0, 0);
14}
15} // END FIDDLE
REG_FIDDLE(Bitmap_writePixels_2, 256, 80, false, 0)
uint32_t SkPMColor
Definition: SkColor.h:205
constexpr SkColor SK_ColorGREEN
Definition: SkColor.h:131
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
void scale(SkScalar sx, SkScalar sy)
Definition: SkCanvas.cpp:1289
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
Definition: SkCanvas.h:1528
DlColor color
Definition: bitmap.py:1
static SkImageInfo MakeN32Premul(int width, int height)