Flutter Engine
The Flutter Engine
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
skgpu::graphite::BoundsManagerBench Class Referenceabstract
Inheritance diagram for skgpu::graphite::BoundsManagerBench:
Benchmark SkRefCnt SkRefCntBase skgpu::graphite::FileBoundsManagerBench skgpu::graphite::RandomBoundsManagerBench

Public Member Functions

 BoundsManagerBench (std::unique_ptr< BoundsManager > manager)
 
- 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

virtual void gatherRects (TArray< SkRect > *rects)=0
 
bool isSuitableFor (Backend backend) override
 
const char * onGetName () final
 
void onDelayedSetup () final
 
void onDraw (int loops, SkCanvas *) final
 
void onPerCanvasPostDraw (SkCanvas *) override
 
void doBench ()
 
- 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 ()
 

Protected Attributes

std::unique_ptr< BoundsManagerfManager
 
SkString fName
 
SkArenaAlloc fAlignedAllocator {0}
 
int fRectCount
 
RectfRects
 
CompressedPaintersOrder fMaxRead
 

Additional Inherited Members

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

Detailed Description

Definition at line 29 of file BoundsManagerBench.cpp.

Constructor & Destructor Documentation

◆ BoundsManagerBench()

skgpu::graphite::BoundsManagerBench::BoundsManagerBench ( std::unique_ptr< BoundsManager manager)
inline

Definition at line 31 of file BoundsManagerBench.cpp.

31: fManager(std::move(manager)) {}
std::unique_ptr< BoundsManager > fManager
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 manager
Definition: switches.h:218

Member Function Documentation

◆ doBench()

void skgpu::graphite::BoundsManagerBench::doBench ( )
inlineprotected

Definition at line 66 of file BoundsManagerBench.cpp.

66 {
68 for (int i = 0; i < fRectCount; ++i) {
69 const Rect& drawBounds = fRects[i];
70 CompressedPaintersOrder order = fManager->getMostRecentDraw(drawBounds).next();
71 fManager->recordDraw(drawBounds, order);
72 if (order > maxRead) {
73 maxRead = order;
74 }
75 }
76
77 fMaxRead = maxRead;
78 fManager->reset();
79 }
TRect< Scalar > Rect
Definition: rect.h:769
MonotonicValue< CompressedPaintersOrderSequence > CompressedPaintersOrder
Definition: DrawOrder.h:58

◆ gatherRects()

virtual void skgpu::graphite::BoundsManagerBench::gatherRects ( TArray< SkRect > *  rects)
protectedpure virtual

◆ isSuitableFor()

bool skgpu::graphite::BoundsManagerBench::isSuitableFor ( Backend  backend)
inlineoverrideprotectedvirtual

Reimplemented from Benchmark.

Definition at line 36 of file BoundsManagerBench.cpp.

36 {
38 }
const char * backend

◆ onDelayedSetup()

void skgpu::graphite::BoundsManagerBench::onDelayedSetup ( )
inlinefinalprotectedvirtual

Reimplemented from Benchmark.

Definition at line 42 of file BoundsManagerBench.cpp.

42 {
43 TArray<SkRect> rects;
44 this->gatherRects(&rects);
45
46 fRectCount = rects.size();
48 for (int i = 0; i < fRectCount; ++i) {
49 fRects[i] = rects[i];
50 }
51 }
T * makeArray(size_t count)
Definition: SkArenaAlloc.h:181
virtual void gatherRects(TArray< SkRect > *rects)=0
int size() const
Definition: SkTArray.h:421

◆ onDraw()

void skgpu::graphite::BoundsManagerBench::onDraw ( int  loops,
SkCanvas  
)
inlinefinalprotectedvirtual

Implements Benchmark.

Definition at line 53 of file BoundsManagerBench.cpp.

53 {
54 for (int i = 0; i < loops; ++i) {
55 this->doBench();
56 }
57 }

◆ onGetName()

const char * skgpu::graphite::BoundsManagerBench::onGetName ( )
inlinefinalprotectedvirtual

Implements Benchmark.

Definition at line 40 of file BoundsManagerBench.cpp.

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

◆ onPerCanvasPostDraw()

void skgpu::graphite::BoundsManagerBench::onPerCanvasPostDraw ( SkCanvas )
inlineoverrideprotectedvirtual

Reimplemented from Benchmark.

Definition at line 59 of file BoundsManagerBench.cpp.

59 {
60#if PRINT_DRAWSET_COUNT
61 SkDebugf("%s >> grouped %d draws into %d sets <<\n",
63#endif
64 }
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1

Member Data Documentation

◆ fAlignedAllocator

SkArenaAlloc skgpu::graphite::BoundsManagerBench::fAlignedAllocator {0}
protected

Definition at line 83 of file BoundsManagerBench.cpp.

◆ fManager

std::unique_ptr<BoundsManager> skgpu::graphite::BoundsManagerBench::fManager
protected

Definition at line 81 of file BoundsManagerBench.cpp.

◆ fMaxRead

CompressedPaintersOrder skgpu::graphite::BoundsManagerBench::fMaxRead
protected

Definition at line 87 of file BoundsManagerBench.cpp.

◆ fName

SkString skgpu::graphite::BoundsManagerBench::fName
protected

Definition at line 82 of file BoundsManagerBench.cpp.

◆ fRectCount

int skgpu::graphite::BoundsManagerBench::fRectCount
protected

Definition at line 84 of file BoundsManagerBench.cpp.

◆ fRects

Rect* skgpu::graphite::BoundsManagerBench::fRects
protected

Definition at line 85 of file BoundsManagerBench.cpp.


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