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

Go to the source code of this file.

Functions

 REG_FIDDLE_ANIMATED (software_bitmap_w_perspective, 256, 256, false, 6, 5)
 

Function Documentation

◆ REG_FIDDLE_ANIMATED()

REG_FIDDLE_ANIMATED ( software_bitmap_w_perspective  ,
256  ,
256  ,
false  ,
,
 
)

Definition at line 4 of file software_bitmap_w_perspective.cpp.

4 {
5void draw(SkCanvas* canvas) {
6 const float width = image->width();
7 const float height = image->height();
8
9 const SkPoint src[] = {{ 0, 0}, {width, 0}, {width * (float)frame, height * (float)frame}, { 0, height}};
10 const SkPoint dst[] = { {0, 0}, {width, 0}, {width, height}, {0, height} };
11
13 matrix.setPolyToPoly(src, dst, 4);
14
15 SkAutoCanvasRestore acr(canvas, true);
16 canvas->concat(matrix);
17 canvas->drawImage(image, 0, 0);
18}
19} // END FIDDLE
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition aaclip.cpp:27
void concat(const SkMatrix &matrix)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
Definition SkCanvas.h:1528
int width() const
Definition SkImage.h:285
int height() const
Definition SkImage.h:291
sk_sp< SkImage > image
Definition examples.cpp:29
double frame
Definition examples.cpp:31
unsigned useCenter Optional< SkMatrix > matrix
Definition SkRecords.h:258
dst
Definition cp.py:12
int32_t height
int32_t width