Flutter Engine
The Flutter Engine
Public Member Functions | Protected Member Functions | List of all members
DecomposeMatrixBench Class Reference
Inheritance diagram for DecomposeMatrixBench:
MatrixBench Benchmark SkRefCnt SkRefCntBase

Public Member Functions

 DecomposeMatrixBench ()
 
- Public Member Functions inherited from MatrixBench
 MatrixBench (const char name[])
 
bool isSuitableFor (Backend backend) override
 
virtual void performTest ()=0
 
- Public Member Functions inherited from Benchmark
 Benchmark ()
 
const char * getName ()
 
const char * getUniqueName ()
 
SkISize getSize ()
 
virtual bool isSuitableFor (Backend backend)
 
virtual void modifyGrContextOptions (GrContextOptions *)
 
virtual bool shouldLoop () const
 
void delayedSetup ()
 
void perCanvasPreDraw (SkCanvas *)
 
void perCanvasPostDraw (SkCanvas *)
 
void preDraw (SkCanvas *)
 
void postDraw (SkCanvas *)
 
void draw (int loops, SkCanvas *)
 
virtual void getGpuStats (SkCanvas *, skia_private::TArray< SkString > *keys, skia_private::TArray< double > *values)
 
virtual bool getDMSAAStats (GrRecordingContext *)
 
int getUnits () const
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 

Protected Member Functions

void onDelayedSetup () override
 
void performTest () override
 
- Protected Member Functions inherited from MatrixBench
virtual int mulLoopCount () const
 
const char * onGetName () override
 
void onDraw (int loops, SkCanvas *) override
 
- Protected Member Functions inherited from Benchmark
void setUnits (int units)
 
virtual void setupPaint (SkPaint *paint)
 
virtual const char * onGetName ()=0
 
virtual const char * onGetUniqueName ()
 
virtual void onDelayedSetup ()
 
virtual void onPerCanvasPreDraw (SkCanvas *)
 
virtual void onPerCanvasPostDraw (SkCanvas *)
 
virtual void onPreDraw (SkCanvas *)
 
virtual void onPostDraw (SkCanvas *)
 
virtual void onDraw (int loops, SkCanvas *)=0
 
virtual SkISize onGetSize ()
 

Additional Inherited Members

- Public Types inherited from Benchmark
enum class  Backend {
  kNonRendering , kRaster , kGanesh , kGraphite ,
  kPDF , kHWUI
}
 

Detailed Description

Definition at line 74 of file MatrixBench.cpp.

Constructor & Destructor Documentation

◆ DecomposeMatrixBench()

DecomposeMatrixBench::DecomposeMatrixBench ( )
inline

Definition at line 76 of file MatrixBench.cpp.

76: INHERITED("decompose") {}

Member Function Documentation

◆ onDelayedSetup()

void DecomposeMatrixBench::onDelayedSetup ( )
inlineoverrideprotectedvirtual

Reimplemented from Benchmark.

Definition at line 79 of file MatrixBench.cpp.

79 {
80 for (int i = 0; i < 10; ++i) {
81 SkScalar rot0 = (fRandom.nextBool()) ? fRandom.nextRangeF(-180, 180) : 0.0f;
82 SkScalar sx = fRandom.nextRangeF(-3000.f, 3000.f);
83 SkScalar sy = (fRandom.nextBool()) ? fRandom.nextRangeF(-3000.f, 3000.f) : sx;
84 SkScalar rot1 = fRandom.nextRangeF(-180, 180);
85 fMatrix[i].setRotate(rot0);
86 fMatrix[i].postScale(sx, sy);
87 fMatrix[i].postRotate(rot1);
88 }
89 }
SkMatrix & postRotate(SkScalar degrees, SkScalar px, SkScalar py)
Definition: SkMatrix.cpp:474
SkMatrix & postScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py)
Definition: SkMatrix.cpp:360
SkMatrix & setRotate(SkScalar degrees, SkScalar px, SkScalar py)
Definition: SkMatrix.cpp:452
bool nextBool()
Definition: SkRandom.h:117
float nextRangeF(float min, float max)
Definition: SkRandom.h:64
float SkScalar
Definition: extension.cpp:12

◆ performTest()

void DecomposeMatrixBench::performTest ( )
inlineoverrideprotectedvirtual

Implements MatrixBench.

Definition at line 90 of file MatrixBench.cpp.

90 {
91 SkPoint rotation1, scale, rotation2;
92 for (int i = 0; i < 10; ++i) {
93 (void) SkDecomposeUpper2x2(fMatrix[i], &rotation1, &scale, &rotation2);
94 }
95 }
bool SkDecomposeUpper2x2(const SkMatrix &matrix, SkPoint *rotation1, SkPoint *scale, SkPoint *rotation2)
Definition: SkMatrix.cpp:1689
const Scalar scale

The documentation for this class was generated from the following file: