Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Member Functions | List of all members
ConservativelyContainsBench Class Reference
Inheritance diagram for ConservativelyContainsBench:
Benchmark SkRefCnt SkRefCntBase

Public Types

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

Public Member Functions

 ConservativelyContainsBench (Type type)
 
bool isSuitableFor (Backend backend) override
 
- Public Member Functions inherited from Benchmark
 Benchmark ()
 
const char * getName ()
 
const char * getUniqueName ()
 
SkISize getSize ()
 
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
 

Private Member Functions

const char * onGetName () override
 
void onDraw (int loops, SkCanvas *) override
 
void onDelayedSetup () override
 

Additional Inherited Members

- Protected Member Functions inherited from Benchmark
void setUnits (int units)
 
virtual void setupPaint (SkPaint *paint)
 
virtual const char * onGetUniqueName ()
 
virtual void onPerCanvasPreDraw (SkCanvas *)
 
virtual void onPerCanvasPostDraw (SkCanvas *)
 
virtual void onPreDraw (SkCanvas *)
 
virtual void onPostDraw (SkCanvas *)
 
virtual SkISize onGetSize ()
 

Detailed Description

Definition at line 818 of file PathBench.cpp.

Member Enumeration Documentation

◆ Type

Enumerator
kRect_Type 
kRoundRect_Type 
kOval_Type 

Definition at line 820 of file PathBench.cpp.

Constructor & Destructor Documentation

◆ ConservativelyContainsBench()

ConservativelyContainsBench::ConservativelyContainsBench ( Type  type)
inline

Definition at line 826 of file PathBench.cpp.

826 {
827 fParity = false;
828 fName = "conservatively_contains_";
829 switch (type) {
830 case kRect_Type:
831 fName.append("rect");
832 fPath.addRect(kBaseRect);
833 break;
834 case kRoundRect_Type:
835 fName.append("round_rect");
836 fPath.addRoundRect(kBaseRect, kRRRadii[0], kRRRadii[1]);
837 break;
838 case kOval_Type:
839 fName.append("oval");
840 fPath.addOval(kBaseRect);
841 break;
842 }
843 }
SkPath & addRoundRect(const SkRect &rect, SkScalar rx, SkScalar ry, SkPathDirection dir=SkPathDirection::kCW)
Definition SkPath.cpp:1088
SkPath & addOval(const SkRect &oval, SkPathDirection dir=SkPathDirection::kCW)
Definition SkPath.cpp:1101
SkPath & addRect(const SkRect &rect, SkPathDirection dir, unsigned start)
Definition SkPath.cpp:854
void append(const char text[])
Definition SkString.h:203

Member Function Documentation

◆ isSuitableFor()

bool ConservativelyContainsBench::isSuitableFor ( Backend  backend)
inlineoverridevirtual

Reimplemented from Benchmark.

Definition at line 845 of file PathBench.cpp.

845 {
847 }
const char * backend

◆ onDelayedSetup()

void ConservativelyContainsBench::onDelayedSetup ( )
inlineoverrideprivatevirtual

Reimplemented from Benchmark.

Definition at line 861 of file PathBench.cpp.

861 {
862 fQueryRects.resize(kQueryRectCnt);
863
864 SkRandom rand;
865 for (int i = 0; i < kQueryRectCnt; ++i) {
866 SkSize size;
867 SkPoint xy;
868 size.fWidth = rand.nextRangeScalar(kQueryMin.fWidth, kQueryMax.fWidth);
869 size.fHeight = rand.nextRangeScalar(kQueryMin.fHeight, kQueryMax.fHeight);
870 xy.fX = rand.nextRangeScalar(kBounds.fLeft, kBounds.fRight - size.fWidth);
871 xy.fY = rand.nextRangeScalar(kBounds.fTop, kBounds.fBottom - size.fHeight);
872
873 fQueryRects[i] = SkRect::MakeXYWH(xy.fX, xy.fY, size.fWidth, size.fHeight);
874 }
875 }
SkScalar nextRangeScalar(SkScalar min, SkScalar max)
Definition SkRandom.h:106
void resize(int count)
Definition SkTDArray.h:183
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition switches.h:259
float fX
x-axis value
float fY
y-axis value
SkScalar fBottom
larger y-axis bounds
Definition extension.cpp:17
SkScalar fLeft
smaller x-axis bounds
Definition extension.cpp:14
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
Definition SkRect.h:659
SkScalar fRight
larger x-axis bounds
Definition extension.cpp:16
SkScalar fTop
smaller y-axis bounds
Definition extension.cpp:15
SkScalar fHeight
Definition SkSize.h:54
SkScalar fWidth
Definition SkSize.h:53

◆ onDraw()

void ConservativelyContainsBench::onDraw ( int  loops,
SkCanvas  
)
inlineoverrideprivatevirtual

Implements Benchmark.

Definition at line 854 of file PathBench.cpp.

854 {
855 for (int i = 0; i < loops; ++i) {
856 const SkRect& rect = fQueryRects[i % kQueryRectCnt];
857 fParity = fParity != fPath.conservativelyContainsRect(rect);
858 }
859 }
bool conservativelyContainsRect(const SkRect &rect) const
Definition SkPath.cpp:289
sk_sp< SkBlender > blender SkRect rect
Definition SkRecords.h:350

◆ onGetName()

const char * ConservativelyContainsBench::onGetName ( )
inlineoverrideprivatevirtual

Implements Benchmark.

Definition at line 850 of file PathBench.cpp.

850 {
851 return fName.c_str();
852 }
const char * c_str() const
Definition SkString.h:133

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