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

Go to the source code of this file.

Functions

 REG_FIDDLE (Matrix_decomposeScale, 256, 256, true, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Matrix_decomposeScale  ,
256  ,
256  ,
true  ,
 
)

Definition at line 4 of file Matrix_decomposeScale.cpp.

4 {
5void draw(SkCanvas* canvas) {
7 matrix.setRotate(90 * SK_Scalar1);
8 matrix.postScale(1.f / 4, 1.f / 2);
9 matrix.dump();
11 SkMatrix remaining;
12 remaining.reset();
13 bool success = matrix.decomposeScale(&scale, &remaining);
14 SkDebugf("success: %s ", success ? "true" : "false");
15 SkDebugf("scale: %g, %g\n", scale.width(), scale.height());
16 remaining.dump();
17 SkMatrix scaleMatrix = SkMatrix::Scale(scale.width(), scale.height());
18 SkMatrix combined = SkMatrix::Concat(scaleMatrix, remaining);
19 combined.dump();
20}
21} // END FIDDLE
static void scaleMatrix(const SkPath &one, const SkPath &two, SkMatrix &scale)
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
#define SK_Scalar1
Definition: SkScalar.h:18
#define SK_ScalarNaN
Definition: SkScalar.h:28
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
static SkMatrix Scale(SkScalar sx, SkScalar sy)
Definition: SkMatrix.h:75
void dump() const
Definition: SkMatrix.cpp:1604
static SkMatrix Concat(const SkMatrix &a, const SkMatrix &b)
Definition: SkMatrix.h:1775
SkMatrix & reset()
Definition: SkMatrix.cpp:49
unsigned useCenter Optional< SkMatrix > matrix
Definition: SkRecords.h:258
const Scalar scale
Definition: SkSize.h:52