Flutter Engine
The Flutter Engine
Public Member Functions | Public Attributes | List of all members
Sk4fGradientBench Struct Reference
Inheritance diagram for Sk4fGradientBench:
Benchmark SkRefCnt SkRefCntBase

Public Member Functions

const char * onGetName () override
 
bool isSuitableFor (Backend backend) override
 
void onDraw (int loops, SkCanvas *) override
 
- 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
 

Public Attributes

SkPMColor fDevice [100]
 

Additional Inherited Members

- Public Types inherited from Benchmark
enum class  Backend {
  kNonRendering , kRaster , kGanesh , kGraphite ,
  kPDF , kHWUI
}
 
- 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 ()
 

Detailed Description

Definition at line 59 of file Sk4fBench.cpp.

Member Function Documentation

◆ isSuitableFor()

bool Sk4fGradientBench::isSuitableFor ( Backend  backend)
inlineoverridevirtual

Reimplemented from Benchmark.

Definition at line 61 of file Sk4fBench.cpp.

const char * backend

◆ onDraw()

void Sk4fGradientBench::onDraw ( int  loops,
SkCanvas  
)
inlineoverridevirtual

Implements Benchmark.

Definition at line 64 of file Sk4fBench.cpp.

64 {
65 skvx::float4 c0(0,0,255,255),
66 c1(255,0,0,255),
67 dc = c1 - c0,
68 fx(0.1f),
69 dx(0.002f),
70 dcdx(dc*dx),
71 dcdx4(dcdx+dcdx+dcdx+dcdx);
72
73 for (int n = 0; n < loops; n++) {
74 auto a = c0 + dc*fx + 0.5f, // add an extra 0.5f to get rounding for free.
75 b = a + dcdx,
76 c = b + dcdx,
77 d = c + dcdx;
78 for (size_t i = 0; i < std::size(fDevice); i += 4) {
79 skvx::cast<uint8_t>(a).store(fDevice + i + 0);
80 skvx::cast<uint8_t>(b).store(fDevice + i + 1);
81 skvx::cast<uint8_t>(c).store(fDevice + i + 2);
82 skvx::cast<uint8_t>(d).store(fDevice + i + 3);
83 a = a + dcdx4;
84 b = b + dcdx4;
85 c = c + dcdx4;
86 d = d + dcdx4;
87 }
88 }
89 }
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
Definition: main.cc:19
static bool b
struct MyStruct a[10]
skia_private::AutoTArray< sk_sp< SkImageFilter > > filters TypedMatrix matrix TypedMatrix matrix SkScalar dx
Definition: SkRecords.h:208
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
SkPMColor fDevice[100]
Definition: Sk4fBench.cpp:63
Definition: SkVx.h:83

◆ onGetName()

const char * Sk4fGradientBench::onGetName ( )
inlineoverridevirtual

Implements Benchmark.

Definition at line 60 of file Sk4fBench.cpp.

60{ return "Sk4f_gradient"; }

Member Data Documentation

◆ fDevice

SkPMColor Sk4fGradientBench::fDevice[100]

Definition at line 63 of file Sk4fBench.cpp.


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