Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions
Bitmap_pixelRef.cpp File Reference
#include "tools/fiddle/examples.h"

Go to the source code of this file.

Functions

 REG_FIDDLE (Bitmap_pixelRef, 256, 256, true, 3)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Bitmap_pixelRef  ,
256  ,
256  ,
true  ,
 
)

Definition at line 5 of file Bitmap_pixelRef.cpp.

5 {
6void draw(SkCanvas* canvas) {
7 SkBitmap subset;
8 source.extractSubset(&subset, SkIRect::MakeXYWH(32, 64, 128, 256));
9 SkDebugf("src ref %c= sub ref\n", source.pixelRef() == subset.pixelRef() ? '=' : '!');
10 SkDebugf("src pixels %c= sub pixels\n", source.getPixels() == subset.getPixels() ? '=' : '!');
11 SkDebugf("src addr %c= sub addr\n", source.getAddr(32, 64) == subset.getAddr(0, 0) ? '=' : '!');
12}
13} // END FIDDLE
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition aaclip.cpp:27
SkPixelRef * pixelRef() const
Definition SkBitmap.h:720
bool extractSubset(SkBitmap *dst, const SkIRect &subset) const
Definition SkBitmap.cpp:453
void * getAddr(int x, int y) const
Definition SkBitmap.cpp:406
void * getPixels() const
Definition SkBitmap.h:283
SkBitmap source
Definition examples.cpp:28
static constexpr SkIRect MakeXYWH(int32_t x, int32_t y, int32_t w, int32_t h)
Definition SkRect.h:104