Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Functions
drawable.cpp File Reference
#include "gm/gm.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkDrawable.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPathBuilder.h"
#include "include/core/SkRect.h"
#include "include/core/SkRefCnt.h"

Go to the source code of this file.

Classes

struct  MyDrawable
 

Functions

 DEF_SIMPLE_GM (drawable, canvas, 180, 275)
 

Function Documentation

◆ DEF_SIMPLE_GM()

DEF_SIMPLE_GM ( drawable  ,
canvas  ,
180  ,
275   
)

Definition at line 39 of file drawable.cpp.

39 {
40 sk_sp<SkDrawable> drawable(new MyDrawable);
41
42 canvas->translate(10, 10);
43 canvas->drawDrawable(drawable.get());
44 canvas->drawDrawable(drawable.get(), 0, 150);
45
46 SkMatrix m = SkMatrix::Scale(1.5f, 0.8f);
47 m.postTranslate(70, 0);
48 canvas->drawDrawable(drawable.get(), &m);
49
50 m.postTranslate(0, 150);
51 canvas->drawDrawable(drawable.get(), &m);
52}
static SkMatrix Scale(SkScalar sx, SkScalar sy)
Definition SkMatrix.h:75