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

Public Member Functions

 ReadPixBench (SkColorType ct, SkAlphaType at, sk_sp< SkColorSpace > cs)
 
- 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
 
- Protected Member Functions inherited from Benchmark
void setUnits (int units)
 
virtual void setupPaint (SkPaint *paint)
 
virtual const char * onGetUniqueName ()
 
virtual void onDelayedSetup ()
 
virtual void onPerCanvasPreDraw (SkCanvas *)
 
virtual void onPerCanvasPostDraw (SkCanvas *)
 
virtual void onPreDraw (SkCanvas *)
 
virtual void onPostDraw (SkCanvas *)
 
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 18 of file ReadPixBench.cpp.

Constructor & Destructor Documentation

◆ ReadPixBench()

ReadPixBench::ReadPixBench ( SkColorType  ct,
SkAlphaType  at,
sk_sp< SkColorSpace cs 
)
inline

Definition at line 20 of file ReadPixBench.cpp.

21 : fCT(ct), fAT(at), fCS(cs)
22 {
23 fName.printf("readpix_%s_%s_%s",
24 at == kPremul_SkAlphaType ? "pm" : "um",
25 ct == kRGBA_8888_SkColorType ? "rgba" : "bgra",
26 cs ? "srgb" : "null");
27 }
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
Definition SkAlphaType.h:29
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
Definition SkColorType.h:24
void printf(const char format[],...) SK_PRINTF_LIKE(2
Definition SkString.cpp:534

Member Function Documentation

◆ onDraw()

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

Implements Benchmark.

Definition at line 34 of file ReadPixBench.cpp.

34 {
35 canvas->clear(0x80000000);
36
37 SkISize size = canvas->getBaseLayerSize();
38
39 auto info = SkImageInfo::Make(size, fCT, fAT, fCS);
41 bitmap.allocPixels(info);
42
43 for (int i = 0; i < loops; i++) {
44 canvas->readPixels(bitmap.info(), bitmap.getPixels(), bitmap.rowBytes(), 0, 0);
45 }
46 }
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition DM.cpp:213
virtual SkISize getBaseLayerSize() const
Definition SkCanvas.cpp:373
void clear(SkColor color)
Definition SkCanvas.h:1199
bool readPixels(const SkImageInfo &dstInfo, void *dstPixels, size_t dstRowBytes, int srcX, int srcY)
Definition SkCanvas.cpp:386
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
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)

◆ onGetName()

const char * ReadPixBench::onGetName ( )
inlineoverrideprotectedvirtual

Implements Benchmark.

Definition at line 30 of file ReadPixBench.cpp.

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

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