Flutter Engine
The Flutter Engine
Bitmap_setPixelRef.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_setPixelRef, 256, 140, false, 5) {
5void draw(SkCanvas* canvas) {
9 bitmap.setPixelRef(sk_ref_sp(source.pixelRef()), 5, 5);
10 canvas->drawImage(bitmap.asImage(), 10, 10);
11}
12} // END FIDDLE
REG_FIDDLE(Bitmap_setPixelRef, 256, 140, false, 5)
@ kOpaque_SkAlphaType
pixel is opaque
Definition: SkAlphaType.h:28
@ kGray_8_SkColorType
pixel with grayscale level in 8-bit byte
Definition: SkColorType.h:35
sk_sp< T > sk_ref_sp(T *obj)
Definition: SkRefCnt.h:381
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
SkPixelRef * pixelRef() const
Definition: SkBitmap.h:720
int width() const
Definition: SkBitmap.h:149
size_t rowBytes() const
Definition: SkBitmap.h:238
int height() const
Definition: SkBitmap.h:158
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
Definition: SkCanvas.h:1528
SkBitmap source
Definition: examples.cpp:28
Definition: bitmap.py:1
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)