Flutter Engine
The Flutter Engine
Functions
Bitmap_pixelRefOrigin.cpp File Reference
#include "tools/fiddle/examples.h"

Go to the source code of this file.

Functions

 REG_FIDDLE (Bitmap_pixelRefOrigin, 256, 256, true, 3)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Bitmap_pixelRefOrigin  ,
256  ,
256  ,
true  ,
 
)

Definition at line 4 of file Bitmap_pixelRefOrigin.cpp.

4 {
5void draw(SkCanvas* canvas) {
6 SkBitmap subset;
7 source.extractSubset(&subset, SkIRect::MakeXYWH(32, 64, 128, 256));
8 SkIPoint sourceOrigin = source.pixelRefOrigin();
9 SkIPoint subsetOrigin = subset.pixelRefOrigin();
10 SkDebugf("source origin: %d, %d\n", sourceOrigin.fX, sourceOrigin.fY);
11 SkDebugf("subset origin: %d, %d\n", subsetOrigin.fX, subsetOrigin.fY);
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
SkIPoint pixelRefOrigin() const
Definition: SkBitmap.cpp:168
bool extractSubset(SkBitmap *dst, const SkIRect &subset) const
Definition: SkBitmap.cpp:453
SkBitmap source
Definition: examples.cpp:28
int32_t fX
x-axis value
Definition: SkPoint_impl.h:29
int32_t fY
y-axis value
Definition: SkPoint_impl.h:30
static constexpr SkIRect MakeXYWH(int32_t x, int32_t y, int32_t w, int32_t h)
Definition: SkRect.h:104