Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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.
4// HASH=f98cc0451c6e77a8833d261c9a484c5f
5REG_FIDDLE(Bitmap_setPixelRef, 256, 140, false, 5) {
6void draw(SkCanvas* canvas) {
10 bitmap.setPixelRef(sk_ref_sp(source.pixelRef()), 5, 5);
11 canvas->drawImage(bitmap.asImage(), 10, 10);
12}
13} // END FIDDLE
@ 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
#define REG_FIDDLE(NAME, W, H, TEXT, I)
Definition examples.h:60
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)