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

Go to the source code of this file.

Functions

 REG_FIDDLE (Surface_readPixels_3, 256, 256, false, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Surface_readPixels_3  ,
256  ,
256  ,
false  ,
 
)

Definition at line 5 of file Surface_readPixels_3.cpp.

5 {
6void draw(SkCanvas* canvas) {
8 auto surfCanvas = surf->getCanvas();
9 surfCanvas->clear(SK_ColorGREEN);
11 surfCanvas->drawOval({2, 10, 58, 54}, paint);
14 bitmap.setInfo(info);
15 bitmap.allocPixels();
16 for (int x : { 32, -32 } ) {
17 for (int y : { 32, -32 } ) {
18 surf->readPixels(bitmap, x, y);
19 }
20 }
21 canvas->drawImage(bitmap.asImage(), 0, 0);
22}
23} // END FIDDLE
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition DM.cpp:213
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
Definition SkAlphaType.h:29
@ kBGRA_8888_SkColorType
pixel with 8 bits for blue, green, red, alpha; in 32-bit word
Definition SkColorType.h:26
constexpr SkColor SK_ColorGREEN
Definition SkColor.h:131
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition aaclip.cpp:27
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
Definition SkCanvas.h:1528
const Paint & paint
double y
double x
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
static SkImageInfo MakeN32Premul(int width, int height)
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)