Flutter Engine
The Flutter Engine
Classes | Functions
MatrixBench.cpp File Reference
#include "bench/Benchmark.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkString.h"
#include "src/base/SkRandom.h"
#include "src/core/SkMatrixUtils.h"

Go to the source code of this file.

Classes

class  MatrixBench
 
class  ScaleMatrixBench
 
class  DecomposeMatrixBench
 
class  InvertMapRectMatrixBench
 
class  MapPointsMatrixBench
 
class  MapRectMatrixBench
 

Functions

template<typename T >
void init9 (T array[9])
 
 DEF_BENCH (return new InvertMapRectMatrixBench("invert_maprect_rectstaysrect", InvertMapRectMatrixBench::kScale_Flag|InvertMapRectMatrixBench::kTranslate_Flag);) DEF_BENCH(return new InvertMapRectMatrixBench("invert_maprect_translate"
 
 DEF_BENCH (return new InvertMapRectMatrixBench("invert_maprect_nonpersp", InvertMapRectMatrixBench::kScale_Flag|InvertMapRectMatrixBench::kRotate_Flag|InvertMapRectMatrixBench::kTranslate_Flag);) DEF_BENCH(return new InvertMapRectMatrixBench("invert_maprect_persp"
 
 DEF_BENCH (return new InvertMapRectMatrixBench("invert_maprect_typemask_rectstaysrect", InvertMapRectMatrixBench::kUncachedTypeMask_Flag|InvertMapRectMatrixBench::kScale_Flag|InvertMapRectMatrixBench::kTranslate_Flag);) DEF_BENCH(return new InvertMapRectMatrixBench("invert_maprect_typemask_nonpersp"
 
static SkMatrix make_trans ()
 
static SkMatrix make_scale ()
 
static SkMatrix make_afine ()
 
 DEF_BENCH (return new MapPointsMatrixBench("mappoints_identity", SkMatrix::I());) DEF_BENCH(return new MapPointsMatrixBench("mappoints_trans"
 
 DEF_BENCH (return new MapPointsMatrixBench("mappoints_scale", make_scale());) DEF_BENCH(return new MapPointsMatrixBench("mappoints_affine"
 

Function Documentation

◆ DEF_BENCH() [1/5]

DEF_BENCH ( return new InvertMapRectMatrixBench("invert_maprect_nonpersp", InvertMapRectMatrixBench::kScale_Flag|InvertMapRectMatrixBench::kRotate_Flag|InvertMapRectMatrixBench::kTranslate_Flag);   )
new

◆ DEF_BENCH() [2/5]

DEF_BENCH ( return new InvertMapRectMatrixBench("invert_maprect_rectstaysrect", InvertMapRectMatrixBench::kScale_Flag|InvertMapRectMatrixBench::kTranslate_Flag);   )
new

◆ DEF_BENCH() [3/5]

DEF_BENCH ( return new InvertMapRectMatrixBench("invert_maprect_typemask_rectstaysrect", InvertMapRectMatrixBench::kUncachedTypeMask_Flag|InvertMapRectMatrixBench::kScale_Flag|InvertMapRectMatrixBench::kTranslate_Flag);   )
new

◆ DEF_BENCH() [4/5]

DEF_BENCH ( return new MapPointsMatrixBench("mappoints_identity", SkMatrix::I());   )
new

◆ DEF_BENCH() [5/5]

DEF_BENCH ( return new MapPointsMatrixBench("mappoints_scale", make_scale());   )
new

◆ init9()

template<typename T >
void init9 ( T  array[9])

Definition at line 67 of file MatrixBench.cpp.

67 {
68 SkRandom rand;
69 for (int i = 0; i < 9; i++) {
70 array[i] = rand.nextSScalar1();
71 }
72}
SkScalar nextSScalar1()
Definition: SkRandom.h:113

◆ make_afine()

make_afine ( )
static

Definition at line 200 of file MatrixBench.cpp.

200{ SkMatrix m(make_trans()); m.postRotate(15); return m; }
static SkMatrix make_trans()

◆ make_scale()

static SkMatrix make_scale ( )
static

Definition at line 199 of file MatrixBench.cpp.

199{ SkMatrix m(make_trans()); m.postScale(1.5f, 0.5f); return m; }

◆ make_trans()

make_trans ( )
static

Definition at line 198 of file MatrixBench.cpp.

198{ return SkMatrix::Translate(2, 3); }
static SkMatrix Translate(SkScalar dx, SkScalar dy)
Definition: SkMatrix.h:91