Flutter Engine
The Flutter Engine
Public Member Functions | Protected Member Functions | List of all members
ScrollGmailBench Class Reference

Emulates the mix of rects blitted by gmail during scrolling. More...

Inheritance diagram for ScrollGmailBench:
Benchmark SkRefCnt SkRefCntBase

Public Member Functions

 ScrollGmailBench ()
 
- 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

const char * onGetName () override
 
void onDraw (int loops, SkCanvas *canvas) override
 
SkISize onGetSize () override
 
void setRectangle (SkRect &current, int i)
 
void validateBounds (SkCanvas *canvas)
 
- 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

Emulates the mix of rects blitted by gmail during scrolling.

Definition at line 452 of file ChromeBench.cpp.

Constructor & Destructor Documentation

◆ ScrollGmailBench()

ScrollGmailBench::ScrollGmailBench ( )
inline

Definition at line 459 of file ChromeBench.cpp.

459{ }

Member Function Documentation

◆ onDraw()

void ScrollGmailBench::onDraw ( int  loops,
SkCanvas canvas 
)
inlineoverrideprotectedvirtual

Implements Benchmark.

Definition at line 464 of file ChromeBench.cpp.

464 {
465 SkDEBUGCODE(this->validateBounds(canvas));
467 this->setupPaint(&paint);
468 for (int i = 0; i < N; i++) {
469 SkRect current;
470 setRectangle(current, i);
471 for (int j = 0; j < loops * gmailScrollingRectSpec[i*3]; j++) {
472 canvas->drawRect(current, paint);
473 }
474 }
475 }
int gmailScrollingRectSpec[431 *3]
blitRect() calls emitted by Chrome while scrolling through gmail: count, width, height.
Definition: ChromeBench.cpp:17
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()
virtual void setupPaint(SkPaint *paint)
Definition: Benchmark.cpp:55
void validateBounds(SkCanvas *canvas)
void setRectangle(SkRect &current, int i)
void drawRect(const SkRect &rect, const SkPaint &paint)
Definition: SkCanvas.cpp:1673
const Paint & paint
Definition: color_source.cc:38

◆ onGetName()

const char * ScrollGmailBench::onGetName ( )
inlineoverrideprotectedvirtual

Implements Benchmark.

Definition at line 463 of file ChromeBench.cpp.

463{ return "chrome_scrollGmail"; }

◆ onGetSize()

SkISize ScrollGmailBench::onGetSize ( )
inlineoverrideprotectedvirtual

Reimplemented from Benchmark.

Definition at line 476 of file ChromeBench.cpp.

476{ return SkISize::Make(W, H); }
Definition: SkMD5.cpp:130
static constexpr SkISize Make(int32_t w, int32_t h)
Definition: SkSize.h:20

◆ setRectangle()

void ScrollGmailBench::setRectangle ( SkRect current,
int  i 
)
inlineprotected

Definition at line 478 of file ChromeBench.cpp.

478 {
481 }
#define SkIntToScalar(x)
Definition: SkScalar.h:57
void setWH(float width, float height)
Definition: SkRect.h:944

◆ validateBounds()

void ScrollGmailBench::validateBounds ( SkCanvas canvas)
inlineprotected

Definition at line 482 of file ChromeBench.cpp.

482 {
483#ifdef SK_DEBUG
485 SkASSERT(bounds.right()-bounds.left() >= W);
486 SkASSERT(bounds.bottom()-bounds.top() >= H);
487#endif
488 }
#define SkASSERT(cond)
Definition: SkAssert.h:116
SkIRect getDeviceClipBounds() const
Definition: SkCanvas.cpp:1607
Optional< SkRect > bounds
Definition: SkRecords.h:189
Definition: SkRect.h:32

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