Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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 5 of file Matrix_decomposeScale.cpp.

5 {
6void draw(SkCanvas* canvas) {
8 matrix.setRotate(90 * SK_Scalar1);
9 matrix.postScale(1.f / 4, 1.f / 2);
10 matrix.dump();
12 SkMatrix remaining;
13 remaining.reset();
14 bool success = matrix.decomposeScale(&scale, &remaining);
15 SkDebugf("success: %s ", success ? "true" : "false");
16 SkDebugf("scale: %g, %g\n", scale.width(), scale.height());
17 remaining.dump();
18 SkMatrix scaleMatrix = SkMatrix::Scale(scale.width(), scale.height());
19 SkMatrix combined = SkMatrix::Concat(scaleMatrix, remaining);
20 combined.dump();
21}
22} // 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
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