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

Go to the source code of this file.

Functions

 REG_FIDDLE (Surface_writePixels_2, 256, 96, false, 4)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Surface_writePixels_2  ,
256  ,
96  ,
false  ,
 
)

Definition at line 4 of file Surface_writePixels_2.cpp.

4 {
5void draw(SkCanvas* canvas) {
7 auto surfCanvas = surf->getCanvas();
8 surfCanvas->clear(SK_ColorGREEN);
9 surf->writePixels(source, 25, 25);
10 sk_sp<SkImage> image(surf->makeImageSnapshot());
11 canvas->drawImage(image, 0, 0);
12}
13} // END FIDDLE
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
SkBitmap source
Definition: examples.cpp:28
sk_sp< const SkImage > image
Definition: SkRecords.h:269
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
static SkImageInfo MakeN32Premul(int width, int height)