Flutter Engine
The Flutter Engine
Pixmap_writable_addr64.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(Pixmap_writable_addr64, 256, 40, false, 0) {
5void draw(SkCanvas* canvas) {
7 uint64_t storage[9];
8 SkPixmap pixmap(info, storage, 3 * sizeof(uint64_t));
9 SkColor4f c4 { 1, 0.45f, 0.25f, 0.65f };
10 pixmap.erase(c4);
12 canvas->scale(10, 10);
13 bitmap.installPixels(pixmap);
14 canvas->drawImage(bitmap.asImage(), 0, 0);
15 *pixmap.writable_addr64(1, 1) |= 0x00ff000000000000LL;
16 bitmap.installPixels(pixmap);
17 canvas->drawImage(bitmap.asImage(), 10, 0);
18}
19} // END FIDDLE
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
REG_FIDDLE(Pixmap_writable_addr64, 256, 40, false, 0)
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
Definition: SkAlphaType.h:29
@ kRGBA_F16_SkColorType
pixel with half floats for red, green, blue, alpha;
Definition: SkColorType.h:38
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
uint64_t * writable_addr64(int x, int y) const
Definition: SkPixmap.h:551
bool erase(SkColor color, const SkIRect &subset) const
Definition: SkPixmap.cpp:742
Definition: bitmap.py:1
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)