Flutter Engine
The Flutter Engine
Public Types | Public Member Functions | Protected Member Functions | List of all members
Benchmark Class Referenceabstract

#include <Benchmark.h>

Inheritance diagram for Benchmark:
SkRefCnt SkRefCntBase AAClipBench AAClipBuilderBench AAClipRegionBench AlternatingColorPatternBench AndroidCodecBench ArbRoundRectBench AtlasBench BaseImageFilterCollapseBench BezierBench BigPathBench BlurBench BlurImageFilterBench BlurRectBench BlurRectsBench BulkRectBench< kRectCount, kLayout, kImageMode, kDrawMode > CLZBench CMAPBench CTZBench CanvasSaveRestoreBench ChartBench CirclesBench ClearBench ClipOverheadRecordingBench ClipStrategyBench CodecBench ColorSpaceTransformBench CommonConvexBench CompositingImages ComputeChecksumBench ConcatBench ConicBench ConicBench_Chop ConicBench_TinyError ConservativelyContainsBench ConstXTileBench ControlBench ConvexityBench CreateBackendTextureBench CubicMapBench DDLRecorderBench DashBench DashGridBench DashLineBench DecodeBench DeserializePictureBench DirectMaskGlyphVertexFillBenchmark DisplacementBaseBench DrawBitmapAABench DrawPathBench DrawPointsDashingBench EncodeBench FSRectBench FilterColorBench FilteredRectBench FilteringBench FindCubicConvex180ChopsBench FixedMathBench Floor2IntBench FloorBench FontCacheBench FontCacheEfficiency FontPathBench FourByteInterpBench< kFast, kScale > GMBench GameBench GeometryBench GetAlphafBench GiantDashBench GrMemoryPoolBench GrMipMapBench GrQuadBoundsBench GrResourceCacheBenchAdd GrResourceCacheBenchFind Gradient2Bench GradientBench HairlinePathBench HardStopGradientBench_ScaleNumColors HardStopGradientBench_ScaleNumHardStops HardStopGradientBench_SpecialHardStops Image2RasterBench ImageCacheBench ImageCacheBudgetBench ImageCacheBudgetDynamicBench ImageCycle ImageFilterDAGBench ImageFilterDisplacedBlur ImageFilterXfermodeIn ImageMakeWithFilterDAGBench InterpBench IsFiniteBench JsonBench LightingBaseBench LineBench M4Bench MSKPBench MakeDashBench MapRectBench MathBench MatrixBench MatrixConvolutionBench MemsetBench< T > MergeBench MipmapBench MorphologyBench MutexBench< Mutex > NestedAAClipBench NormalizeBench PDFScalarBench PatchBench PatchUtilsBench PathBench PathBuilderBench PathIterBench PathOpsBench PathOpsSimplifyBench PathTextBench PerlinNoiseBench PictureCentricBench PictureNesting PixmapOrientBench PolyUtilsBench PremulAndUnpremulAlphaOpsBench QuickRejectBench RTreeBuildBench RTreeQueryBench RandomPathBench RasterTileBench ReadPixBench RectBench RectanizerBench RefCntBench_Heap RefCntBench_New RefCntBench_Stack RegionBench RegionContainBench RepeatTileBench RotRectBench SKPBench ScrollGmailBench ShaderMFBench ShadowBench ShapesBench SharedBench Sk4fFloorBench Sk4fGradientBench Sk4fRoundtripBench< T > SkGlyphCacheBasic SkGlyphCacheStressTest SkSLCompileBench SkSLCompilerStartupBench SkSLModuleLoaderBench SkTextBlobBench SkcmsTransformBench SortBench StreamBench StrokeBench SwizzleBench TableBench TightBoundsBench TileImageFilterBench TiledPlaybackBench TopoSortBench TriangulatorBenchmark UtfToGlyph VertBench VertexColorSpaceBench WeakRefCntBench_Heap WeakRefCntBench_New WeakRefCntBench_Stack WritePixelsBench WriterBench XfermodeBench skgpu::ganesh::PathTessellateBenchmark skgpu::ganesh::TessPrepareBench skgpu::graphite::BoundsManagerBench skgpu::graphite::IntersectionTreeBench

Public Types

enum class  Backend {
  kNonRendering , kRaster , kGanesh , kGraphite ,
  kPDF , kHWUI
}
 

Public Member Functions

 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

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 36 of file Benchmark.h.

Member Enumeration Documentation

◆ Backend

enum class Benchmark::Backend
strong
Enumerator
kNonRendering 
kRaster 
kGanesh 
kGraphite 
kPDF 
kHWUI 

Definition at line 44 of file Benchmark.h.

44 {
45 kNonRendering,
46 kRaster,
47 kGanesh,
49 kPDF,
50 kHWUI,
51 };
@ kRaster
Suitable for thread which raster data.
Definition: embedder.h:266

Constructor & Destructor Documentation

◆ Benchmark()

Benchmark::Benchmark ( )

Definition at line 16 of file Benchmark.cpp.

16{}

Member Function Documentation

◆ delayedSetup()

void Benchmark::delayedSetup ( )

Definition at line 30 of file Benchmark.cpp.

30 {
31 this->onDelayedSetup();
32}
virtual void onDelayedSetup()
Definition: Benchmark.h:101

◆ draw()

void Benchmark::draw ( int  loops,
SkCanvas canvas 
)

Definition at line 50 of file Benchmark.cpp.

50 {
51 SkAutoCanvasRestore ar(canvas, true/*save now*/);
52 this->onDraw(loops, canvas);
53}
virtual void onDraw(int loops, SkCanvas *)=0

◆ getDMSAAStats()

virtual bool Benchmark::getDMSAAStats ( GrRecordingContext )
inlinevirtual

Reimplemented in SKPBench.

Definition at line 89 of file Benchmark.h.

89{ return false; }

◆ getGpuStats()

virtual void Benchmark::getGpuStats ( SkCanvas ,
skia_private::TArray< SkString > *  keys,
skia_private::TArray< double > *  values 
)
inlinevirtual

Reimplemented in SKPBench.

Definition at line 84 of file Benchmark.h.

86 {}

◆ getName()

const char * Benchmark::getName ( )

Definition at line 18 of file Benchmark.cpp.

18 {
19 return this->onGetName();
20}
virtual const char * onGetName()=0

◆ getSize()

SkISize Benchmark::getSize ( )

Definition at line 26 of file Benchmark.cpp.

26 {
27 return this->onGetSize();
28}
virtual SkISize onGetSize()
Definition: Benchmark.cpp:59

◆ getUniqueName()

const char * Benchmark::getUniqueName ( )

Definition at line 22 of file Benchmark.cpp.

22 {
23 return this->onGetUniqueName();
24}
virtual const char * onGetUniqueName()
Definition: Benchmark.h:100

◆ getUnits()

int Benchmark::getUnits ( ) const
inline

Definition at line 92 of file Benchmark.h.

92{ return fUnits; }

◆ isSuitableFor()

virtual bool Benchmark::isSuitableFor ( Backend  backend)
inlinevirtual

Reimplemented in PDFScalarBench, DecodeBench, skgpu::ganesh::PathTessellateBenchmark, TriangulatorBenchmark, AndroidCodecBench, BulkRectBench< kRectCount, kLayout, kImageMode, kDrawMode >, CanvasSaveRestoreBench, ComputeChecksumBench, CMAPBench, CodecBench, FilterColorBench, FourByteInterpBench< kFast, kScale >, ColorSpaceTransformBench, SkcmsTransformBench, CompositingImages, ControlBench, CubicMapBench, DDLRecorderBench, EncodeBench, FontPathBench, GeometryBench, ConvexityBench, GMBench, skgpu::graphite::BoundsManagerBench, skgpu::graphite::IntersectionTreeBench, GrMemoryPoolBench, GrMipMapBench, GrQuadBoundsBench, GrResourceCacheBenchAdd, GrResourceCacheBenchFind, Image2RasterBench, ImageCacheBudgetBench, ImageCacheBudgetDynamicBench, ImageCycle, InterpBench, JsonBench, MathBench, IsFiniteBench, FloorBench, CLZBench, CTZBench, NormalizeBench, FixedMathBench, Floor2IntBench, M4Bench, MapRectBench, MatrixBench, MemsetBench< T >, MipmapBench, MutexBench< Mutex >, SharedBench, PatchUtilsBench, RandomPathBench, ConservativelyContainsBench, ConicBench_Chop, ConicBench, TightBoundsBench, PathIterBench, PathOpsBench, PathOpsSimplifyBench, PathBuilderBench, PictureNestingRecording, PixmapOrientBench, GetAlphafBench, RectanizerBench, RefCntBench_Stack, RefCntBench_Heap, RefCntBench_New, WeakRefCntBench_Stack, WeakRefCntBench_Heap, WeakRefCntBench_New, RegionBench, RegionContainBench, RTreeBuildBench, RTreeQueryBench, Sk4fRoundtripBench< T >, Sk4fFloorBench, Sk4fGradientBench, SkGlyphCacheBasic, SkGlyphCacheStressTest, SKPBench, SkSLCompilerStartupBench, SkSLCompileBench, SkSLModuleLoaderBench, SortBench, StreamBench, StrokeBench, SwizzleBench, TopoSortBench, UtfToGlyph, VertexColorSpaceBench, WriterBench, PictureCentricBench, and DeserializePictureBench.

Definition at line 55 of file Benchmark.h.

55 {
57 }
const char * backend

◆ modifyGrContextOptions()

virtual void Benchmark::modifyGrContextOptions ( GrContextOptions )
inlinevirtual

Reimplemented in GMBench.

Definition at line 60 of file Benchmark.h.

60{}

◆ onDelayedSetup()

virtual void Benchmark::onDelayedSetup ( )
inlineprotectedvirtual

◆ onDraw()

virtual void Benchmark::onDraw ( int  loops,
SkCanvas  
)
protectedpure virtual

Implemented in MemsetBench< T >, MemsetBench< T >, MemsetBench< T >, skgpu::graphite::BoundsManagerBench, skgpu::graphite::IntersectionTreeBench, skgpu::ganesh::PathTessellateBenchmark, TriangulatorBenchmark, AAClipBuilderBench, AAClipRegionBench, BlurRectBench, ComputeChecksumBench, FourByteInterpBench< kFast, kScale >, ControlBench, CubicMapBench, MakeDashBench, BitmapDecodeBench, SkottieDecodeBench, SkottiePictureDecodeBench, EncodeBench, GMBench, GrMemoryPoolBench, GrQuadBoundsBench, Image2RasterBench, ImageCacheBench, InterpBench, JsonBench, MathBench, IsFiniteBench, FloorBench, CLZBench, CTZBench, NormalizeBench, FixedMathBench, Floor2IntBench, M4Bench, MapRectBench, MatrixBench, MemsetBench< T >, MipmapBench, MSKPBench, MutexBench< Mutex >, SharedBench, PatchUtilsBench, PathCreateBench, PathCopyBench, PathTransformBench, PathEqualityBench, SkBench_AddPathTest, ConicBench_EvalPos, ConicBench_EvalTan, ConicBench_TinyError, ConicBench_ComputeError, ConicBench_asQuadTol, ConicBench_quadPow2, PathIterBench, PDFScalarBench, PictureNestingRecording, PixmapOrientBench, GetAlphafBench, RecordingBench, DeserializePictureBench, RefCntBench_Stack, RefCntBench_Heap, RefCntBench_New, WeakRefCntBench_Stack, WeakRefCntBench_Heap, WeakRefCntBench_New, RegionContainBench, Sk4fGradientBench, SkGlyphCacheBasic, SkGlyphCacheStressTest, SkSLCompilerStartupBench, SkSLModuleLoaderBench, SortBench, SwizzleBench, TopoSortBench, WriterBench, AAClipBench, NestedAAClipBench, AlternatingColorPatternBench, BezierBench, BigPathBench, XfermodeBench, BlurBench, BlurImageFilterBench, BlurRectsBench, BulkRectBench< kRectCount, kLayout, kImageMode, kDrawMode >, CanvasSaveRestoreBench, ChartBench, ScrollGmailBench, ClearBench, RasterTileBench, ClipStrategyBench, CMAPBench, FilteredRectBench, ColorSpaceTransformBench, SkcmsTransformBench, CompositingImages, DrawPathBench, DashBench, DashLineBench, DrawPointsDashingBench, GiantDashBench, DashGridBench, DisplacementZeroBench, DisplacementAlphaBench, DisplacementFullBench, DrawBitmapAABench, FilteringBench, FontCacheBench, FontCacheEfficiency, FontPathBench, FSRectBench, GameBench, GeoRectBench_intersect, GeoRectBench_intersect_rect, GeoRectBench_Intersects, GeoRectBench_sort, EvalQuadAt0, EvalQuadAt1, EvalQuadTangentAt0, EvalQuadTangentAt1, ChopQuadAt, ChopCubicAt, ConvexityBench, GradientBench, Gradient2Bench, GrMipMapBench, GrResourceCacheBenchAdd, GrResourceCacheBenchFind, HairlinePathBench, HardStopGradientBench_ScaleNumColors, HardStopGradientBench_ScaleNumHardStops, HardStopGradientBench_SpecialHardStops, ImageCacheBudgetBench, ImageCacheBudgetDynamicBench, ImageCycle, BaseImageFilterCollapseBench, ImageFilterDAGBench, ImageMakeWithFilterDAGBench, ImageFilterDisplacedBlur, ImageFilterXfermodeIn, LightingPointLitDiffuseBench, LightingDistantLitDiffuseBench, LightingSpotLitDiffuseBench, LightingPointLitSpecularBench, LightingDistantLitSpecularBench, LightingSpotLitSpecularBench, LineBench, MatrixConvolutionBench, MergeBench, MorphologyBench, PatchBench, PathBench, CirclesBench, ArbRoundRectBench, TightBoundsBench, CommonConvexBench, PathOpsBench, PathOpsSimplifyBench, PathBuilderBench, PerlinNoiseBench, PictureNestingPlayback, TiledPlaybackBench, PolyUtilsBench, PremulAndUnpremulAlphaOpsBench, ReadPixBench, RectanizerBench, RectBench, PointsBench, BlitMaskBench, RegionBench, RepeatTileBench, RotRectBench, RTreeBuildBench, RTreeQueryBench, ShaderMFBench, ShadowBench, Sk4fRoundtripBench< T >, Sk4fFloorBench, SKPBench, SkSLCompileBench, StreamBench, StrokeBench, TableBench, ConstXTileBench, TileImageFilterBench, UtfToGlyph, VertBench, AtlasBench, VertexColorSpaceBench, WritePixelsBench, DDLRecorderBench, AndroidCodecBench, and CodecBench.

◆ onGetName()

virtual const char * Benchmark::onGetName ( )
protectedpure virtual

Implemented in DecodeBench, skgpu::graphite::BoundsManagerBench, skgpu::graphite::IntersectionTreeBench, AAClipBench, NestedAAClipBench, AAClipBuilderBench, AAClipRegionBench, AlternatingColorPatternBench, AndroidCodecBench, BezierBench, BigPathBench, XfermodeBench, BlurBench, BlurImageFilterBench, BlurRectBench, BlurRectsBench, BulkRectBench< kRectCount, kLayout, kImageMode, kDrawMode >, CanvasSaveRestoreBench, ChartBench, ComputeChecksumBench, ScrollGmailBench, ClearBench, RasterTileBench, ClipStrategyBench, CMAPBench, CodecBench, FilteredRectBench, FourByteInterpBench< kFast, kScale >, ColorSpaceTransformBench, SkcmsTransformBench, CompositingImages, ControlBench, DrawPathBench, CubicMapBench, DashBench, MakeDashBench, DashLineBench, DrawPointsDashingBench, GiantDashBench, DashGridBench, DDLRecorderBench, DisplacementZeroBench, DisplacementAlphaBench, DisplacementFullBench, DrawBitmapAABench, EncodeBench, FilteringBench, FontCacheBench, FontCacheEfficiency, FontPathBench, FSRectBench, GameBench, GeometryBench, ConvexityBench, GMBench, GradientBench, Gradient2Bench, GrMemoryPoolBench, GrMipMapBench, GrQuadBoundsBench, GrResourceCacheBenchAdd, GrResourceCacheBenchFind, HairlinePathBench, HardStopGradientBench_ScaleNumColors, HardStopGradientBench_ScaleNumHardStops, HardStopGradientBench_SpecialHardStops, Image2RasterBench, ImageCacheBench, ImageCacheBudgetBench, ImageCacheBudgetDynamicBench, ImageCycle, TableCollapseBench, MatrixCollapseBench, ImageFilterDAGBench, ImageMakeWithFilterDAGBench, ImageFilterDisplacedBlur, ImageFilterXfermodeIn, InterpBench, JsonBench, LightingPointLitDiffuseBench, LightingDistantLitDiffuseBench, LightingSpotLitDiffuseBench, LightingPointLitSpecularBench, LightingDistantLitSpecularBench, LightingSpotLitSpecularBench, LineBench, MathBench, IsFiniteBench, FloorBench, CLZBench, CTZBench, NormalizeBench, FixedMathBench, Floor2IntBench, M4Bench, MapRectBench, MatrixBench, MatrixConvolutionBench, MemsetBench< T >, MergeBench, MipmapBench, MorphologyBench, MSKPBench, MutexBench< Mutex >, SharedBench, PatchBench, PatchUtilsBench, PathBench, PathCreateBench, PathCopyBench, PathTransformBench, PathEqualityBench, SkBench_AddPathTest, CirclesBench, ArbRoundRectBench, ConicBench_TinyError, ConicBench_ComputeError, ConicBench_asQuadTol, ConicBench_quadPow2, TightBoundsBench, CommonConvexBench, PathIterBench, PathOpsBench, PathOpsSimplifyBench, PathBuilderBench, PDFScalarBench, PerlinNoiseBench, PictureNesting, TiledPlaybackBench, PolyUtilsBench, PremulAndUnpremulAlphaOpsBench, ReadPixBench, PixmapOrientBench, GetAlphafBench, PictureCentricBench, DeserializePictureBench, RectanizerBench, RectBench, SrcModeRectBench, TransparentRectBench, LocalCoordsRectBench, OvalBench, RRectBench, PointsBench, BlitMaskBench, RefCntBench_Stack, RefCntBench_Heap, RefCntBench_New, WeakRefCntBench_Stack, WeakRefCntBench_Heap, WeakRefCntBench_New, RegionBench, RegionContainBench, RepeatTileBench, RotRectBench, RTreeBuildBench, RTreeQueryBench, ShaderMFBench, ShadowBench, Sk4fRoundtripBench< T >, Sk4fFloorBench, Sk4fGradientBench, SkGlyphCacheBasic, SkGlyphCacheStressTest, SKPBench, SkSLCompilerStartupBench, SkSLCompileBench, SkSLModuleLoaderBench, SortBench, StreamBench, StrokeBench, SwizzleBench, TableBench, skgpu::ganesh::PathTessellateBenchmark, ConstXTileBench, TileImageFilterBench, TopoSortBench, TriangulatorBenchmark, UtfToGlyph, VertBench, AtlasBench, VertexColorSpaceBench, WritePixelsBench, and WriterBench.

◆ onGetSize()

SkISize Benchmark::onGetSize ( )
protectedvirtual

◆ onGetUniqueName()

virtual const char * Benchmark::onGetUniqueName ( )
inlineprotectedvirtual

Reimplemented in SKPAnimationBench, and SKPBench.

Definition at line 100 of file Benchmark.h.

100{ return this->onGetName(); }

◆ onPerCanvasPostDraw()

virtual void Benchmark::onPerCanvasPostDraw ( SkCanvas )
inlineprotectedvirtual

◆ onPerCanvasPreDraw()

virtual void Benchmark::onPerCanvasPreDraw ( SkCanvas )
inlineprotectedvirtual

◆ onPostDraw()

virtual void Benchmark::onPostDraw ( SkCanvas )
inlineprotectedvirtual

Reimplemented in ComputeChecksumBench, and MSKPBench.

Definition at line 105 of file Benchmark.h.

105{}

◆ onPreDraw()

virtual void Benchmark::onPreDraw ( SkCanvas )
inlineprotectedvirtual

◆ perCanvasPostDraw()

void Benchmark::perCanvasPostDraw ( SkCanvas canvas)

Definition at line 46 of file Benchmark.cpp.

46 {
47 this->onPerCanvasPostDraw(canvas);
48}
virtual void onPerCanvasPostDraw(SkCanvas *)
Definition: Benchmark.h:103

◆ perCanvasPreDraw()

void Benchmark::perCanvasPreDraw ( SkCanvas canvas)

Definition at line 34 of file Benchmark.cpp.

34 {
35 this->onPerCanvasPreDraw(canvas);
36}
virtual void onPerCanvasPreDraw(SkCanvas *)
Definition: Benchmark.h:102

◆ postDraw()

void Benchmark::postDraw ( SkCanvas canvas)

Definition at line 42 of file Benchmark.cpp.

42 {
43 this->onPostDraw(canvas);
44}
virtual void onPostDraw(SkCanvas *)
Definition: Benchmark.h:105

◆ preDraw()

void Benchmark::preDraw ( SkCanvas canvas)

Definition at line 38 of file Benchmark.cpp.

38 {
39 this->onPreDraw(canvas);
40}
virtual void onPreDraw(SkCanvas *)
Definition: Benchmark.h:104

◆ setUnits()

void Benchmark::setUnits ( int  units)
inlineprotected

Definition at line 95 of file Benchmark.h.

95{ SkASSERT(units > 0); fUnits = units; }
#define SkASSERT(cond)
Definition: SkAssert.h:116

◆ setupPaint()

void Benchmark::setupPaint ( SkPaint paint)
protectedvirtual

Reimplemented in RotatedRectBench, NonAACirclePathBench, RectBench, SrcModeRectBench, TransparentRectBench, and LocalCoordsRectBench.

Definition at line 55 of file Benchmark.cpp.

55 {
56 paint->setAntiAlias(true);
57}
const Paint & paint
Definition: color_source.cc:38

◆ shouldLoop()

virtual bool Benchmark::shouldLoop ( ) const
inlinevirtual

Reimplemented in SKPBench, and SkSLModuleLoaderBench.

Definition at line 63 of file Benchmark.h.

63 {
64 return true;
65 }

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