Flutter Engine
The Flutter Engine
Namespaces | Macros | Typedefs | Enumerations | Functions
dl_benchmarks.h File Reference
#include "flutter/display_list/dl_canvas.h"
#include "flutter/display_list/dl_sampling_options.h"
#include "flutter/display_list/dl_vertices.h"
#include "flutter/display_list/testing/dl_test_surface_provider.h"
#include "third_party/benchmark/include/benchmark/benchmark.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkPath.h"
#include "third_party/skia/include/core/SkRRect.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/core/SkVertices.h"

Go to the source code of this file.

Namespaces

namespace  flutter
 
namespace  flutter::testing
 

Macros

#define DRAW_LINE_BENCHMARKS(BACKEND, ATTRIBUTES)
 
#define DRAW_RECT_BENCHMARKS(BACKEND, ATTRIBUTES)
 
#define DRAW_OVAL_BENCHMARKS(BACKEND, ATTRIBUTES)
 
#define DRAW_CIRCLE_BENCHMARKS(BACKEND, ATTRIBUTES)
 
#define DRAW_ARC_BENCHMARKS(BACKEND, ATTRIBUTES)
 
#define DRAW_PATH_BENCHMARKS(BACKEND, ATTRIBUTES)
 
#define DRAW_POINTS_BENCHMARKS(BACKEND, ATTRIBUTES)
 
#define DRAW_VERTICES_BENCHMARKS(BACKEND, ATTRIBUTES)
 
#define DRAW_RRECT_BENCHMARKS(BACKEND, ATTRIBUTES)
 
#define DRAW_DRRECT_BENCHMARKS(BACKEND, ATTRIBUTES)
 
#define DRAW_IMAGE_BENCHMARKS(BACKEND, ATTRIBUTES)
 
#define DRAW_IMAGE_RECT_BENCHMARKS(BACKEND, ATTRIBUTES)
 
#define DRAW_IMAGE_NINE_BENCHMARKS(BACKEND, ATTRIBUTES)
 
#define DRAW_TEXT_BLOB_BENCHMARKS(BACKEND, ATTRIBUTES)
 
#define DRAW_SHADOW_BENCHMARKS(BACKEND, ATTRIBUTES)
 
#define SAVE_LAYER_BENCHMARKS(BACKEND, ATTRIBUTES)
 
#define STROKE_BENCHMARKS(BACKEND, ATTRIBUTES)
 
#define FILL_BENCHMARKS(BACKEND, ATTRIBUTES)
 
#define ANTI_ALIASING_BENCHMARKS(BACKEND, ATTRIBUTES)
 
#define OTHER_BENCHMARKS(BACKEND, ATTRIBUTES)
 
#define RUN_DISPLAYLIST_BENCHMARKS(BACKEND)
 

Typedefs

using flutter::testing::BackendType = DlSurfaceProvider::BackendType
 

Enumerations

enum  flutter::testing::BenchmarkAttributes {
  flutter::testing::kEmpty = 0 , flutter::testing::kStrokedStyle = 1 << 0 , flutter::testing::kFilledStyle = 1 << 1 , flutter::testing::kHairlineStroke = 1 << 2 ,
  flutter::testing::kAntiAliasing = 1 << 3
}
 

Functions

DlPaint flutter::testing::GetPaintForRun (unsigned attributes)
 
void flutter::testing::BM_DrawLine (benchmark::State &state, BackendType backend_type, unsigned attributes)
 
void flutter::testing::BM_DrawRect (benchmark::State &state, BackendType backend_type, unsigned attributes)
 
void flutter::testing::BM_DrawCircle (benchmark::State &state, BackendType backend_type, unsigned attributes)
 
void flutter::testing::BM_DrawOval (benchmark::State &state, BackendType backend_type, unsigned attributes)
 
void flutter::testing::BM_DrawArc (benchmark::State &state, BackendType backend_type, unsigned attributes)
 
void flutter::testing::BM_DrawRRect (benchmark::State &state, BackendType backend_type, unsigned attributes, SkRRect::Type type)
 
void flutter::testing::BM_DrawDRRect (benchmark::State &state, BackendType backend_type, unsigned attributes, SkRRect::Type type)
 
void flutter::testing::BM_DrawPath (benchmark::State &state, BackendType backend_type, unsigned attributes, SkPath::Verb type)
 
void flutter::testing::BM_DrawPoints (benchmark::State &state, BackendType backend_type, unsigned attributes, DlCanvas::PointMode mode)
 
void flutter::testing::BM_DrawVertices (benchmark::State &state, BackendType backend_type, unsigned attributes, DlVertexMode mode)
 
void flutter::testing::BM_DrawImage (benchmark::State &state, BackendType backend_type, unsigned attributes, DlImageSampling options, bool upload_bitmap)
 
void flutter::testing::BM_DrawImageRect (benchmark::State &state, BackendType backend_type, unsigned attributes, DlImageSampling options, DlCanvas::SrcRectConstraint constraint, bool upload_bitmap)
 
void flutter::testing::BM_DrawImageNine (benchmark::State &state, BackendType backend_type, unsigned attributes, const DlFilterMode filter, bool upload_bitmap)
 
void flutter::testing::BM_DrawTextBlob (benchmark::State &state, BackendType backend_type, unsigned attributes)
 
void flutter::testing::BM_DrawShadow (benchmark::State &state, BackendType backend_type, unsigned attributes, bool transparent_occluder, SkPath::Verb type)
 
void flutter::testing::BM_SaveLayer (benchmark::State &state, BackendType backend_type, unsigned attributes, size_t save_depth)
 

Macro Definition Documentation

◆ ANTI_ALIASING_BENCHMARKS

#define ANTI_ALIASING_BENCHMARKS (   BACKEND,
  ATTRIBUTES 
)
Value:
DRAW_IMAGE_BENCHMARKS(BACKEND, ATTRIBUTES) \
DRAW_IMAGE_RECT_BENCHMARKS(BACKEND, ATTRIBUTES)
#define DRAW_IMAGE_BENCHMARKS(BACKEND, ATTRIBUTES)

Definition at line 562 of file dl_benchmarks.h.

◆ DRAW_ARC_BENCHMARKS

#define DRAW_ARC_BENCHMARKS (   BACKEND,
  ATTRIBUTES 
)
Value:
BackendType::k##BACKEND##Backend, \
ATTRIBUTES) \
->RangeMultiplier(2) \
->Range(128, 2048) \
->UseRealTime() \
->Unit(benchmark::kMillisecond);
void BM_DrawArc(benchmark::State &state, BackendType backend_type, unsigned attributes)
BENCHMARK_CAPTURE(BM_DisplayListBuilderDefault, kDefault, DisplayListBuilderBenchmarkType::kDefault) -> Unit(benchmark::kMicrosecond)

Definition at line 143 of file dl_benchmarks.h.

◆ DRAW_CIRCLE_BENCHMARKS

#define DRAW_CIRCLE_BENCHMARKS (   BACKEND,
  ATTRIBUTES 
)
Value:
BackendType::k##BACKEND##Backend, \
ATTRIBUTES) \
->RangeMultiplier(2) \
->Range(16, 2048) \
->UseRealTime() \
->Unit(benchmark::kMillisecond);
void BM_DrawCircle(benchmark::State &state, BackendType backend_type, unsigned attributes)

Definition at line 133 of file dl_benchmarks.h.

◆ DRAW_DRRECT_BENCHMARKS

#define DRAW_DRRECT_BENCHMARKS (   BACKEND,
  ATTRIBUTES 
)
Value:
BENCHMARK_CAPTURE(BM_DrawDRRect, Symmetric/BACKEND, \
BackendType::k##BACKEND##Backend, \
ATTRIBUTES, \
SkRRect::Type::kSimple_Type) \
->RangeMultiplier(2) \
->Range(16, 256) \
->UseRealTime() \
->Unit(benchmark::kMillisecond); \
BENCHMARK_CAPTURE(BM_DrawDRRect, NinePatch/BACKEND, \
BackendType::k##BACKEND##Backend, \
ATTRIBUTES, \
SkRRect::Type::kNinePatch_Type) \
->RangeMultiplier(2) \
->Range(16, 256) \
->UseRealTime() \
->Unit(benchmark::kMillisecond); \
BENCHMARK_CAPTURE(BM_DrawDRRect, Complex/BACKEND, \
BackendType::k##BACKEND##Backend, \
ATTRIBUTES, \
SkRRect::Type::kComplex_Type) \
->RangeMultiplier(2) \
->Range(16, 256) \
->UseRealTime() \
->Unit(benchmark::kMillisecond);
void BM_DrawDRRect(benchmark::State &state, BackendType backend_type, unsigned attributes, SkRRect::Type type)

Definition at line 292 of file dl_benchmarks.h.

◆ DRAW_IMAGE_BENCHMARKS

#define DRAW_IMAGE_BENCHMARKS (   BACKEND,
  ATTRIBUTES 
)
Value:
BENCHMARK_CAPTURE(BM_DrawImage, Texture/BACKEND, \
BackendType::k##BACKEND##Backend, \
ATTRIBUTES, \
DlImageSampling::kNearestNeighbor, false) \
->RangeMultiplier(2) \
->Range(128, 512) \
->UseRealTime() \
->Unit(benchmark::kMillisecond); \
BENCHMARK_CAPTURE(BM_DrawImage, Upload/BACKEND, \
BackendType::k##BACKEND##Backend, \
ATTRIBUTES, \
DlImageSampling::kNearestNeighbor, true) \
->RangeMultiplier(2) \
->Range(128, 512) \
->UseRealTime() \
->Unit(benchmark::kMillisecond);
void BM_DrawImage(benchmark::State &state, BackendType backend_type, unsigned attributes, DlImageSampling options, bool upload_bitmap)

Definition at line 321 of file dl_benchmarks.h.

◆ DRAW_IMAGE_NINE_BENCHMARKS

#define DRAW_IMAGE_NINE_BENCHMARKS (   BACKEND,
  ATTRIBUTES 
)

Definition at line 387 of file dl_benchmarks.h.

◆ DRAW_IMAGE_RECT_BENCHMARKS

#define DRAW_IMAGE_RECT_BENCHMARKS (   BACKEND,
  ATTRIBUTES 
)

Definition at line 341 of file dl_benchmarks.h.

◆ DRAW_LINE_BENCHMARKS

#define DRAW_LINE_BENCHMARKS (   BACKEND,
  ATTRIBUTES 
)
Value:
BackendType::k##BACKEND##Backend, \
ATTRIBUTES) \
->RangeMultiplier(2) \
->Range(16, 2048) \
->UseRealTime() \
->Unit(benchmark::kMillisecond);
void BM_DrawLine(benchmark::State &state, BackendType backend_type, unsigned attributes)

Definition at line 103 of file dl_benchmarks.h.

◆ DRAW_OVAL_BENCHMARKS

#define DRAW_OVAL_BENCHMARKS (   BACKEND,
  ATTRIBUTES 
)
Value:
BackendType::k##BACKEND##Backend, \
ATTRIBUTES) \
->RangeMultiplier(2) \
->Range(16, 2048) \
->UseRealTime() \
->Unit(benchmark::kMillisecond);
void BM_DrawOval(benchmark::State &state, BackendType backend_type, unsigned attributes)

Definition at line 123 of file dl_benchmarks.h.

◆ DRAW_PATH_BENCHMARKS

#define DRAW_PATH_BENCHMARKS (   BACKEND,
  ATTRIBUTES 
)

Definition at line 153 of file dl_benchmarks.h.

◆ DRAW_POINTS_BENCHMARKS

#define DRAW_POINTS_BENCHMARKS (   BACKEND,
  ATTRIBUTES 
)
Value:
BENCHMARK_CAPTURE(BM_DrawPoints, Points/BACKEND, \
BackendType::k##BACKEND##Backend, \
ATTRIBUTES, \
->RangeMultiplier(2) \
->Range(1024, 32768) \
->UseRealTime() \
->Unit(benchmark::kMillisecond); \
BackendType::k##BACKEND##Backend, \
ATTRIBUTES, \
DlCanvas::PointMode::kLines) \
->RangeMultiplier(2) \
->Range(1024, 32768) \
->UseRealTime() \
->Unit(benchmark::kMillisecond); \
BENCHMARK_CAPTURE(BM_DrawPoints, Polygon/BACKEND, \
BackendType::k##BACKEND##Backend, \
ATTRIBUTES, \
DlCanvas::PointMode::kPolygon) \
->RangeMultiplier(2) \
->Range(1024, 32768) \
->UseRealTime() \
->Unit(benchmark::kMillisecond);
static const SkPoint kPoints[kNumLabels]
Definition: flippity.cpp:53
void BM_DrawPoints(benchmark::State &state, BackendType backend_type, unsigned attributes, DlCanvas::PointMode mode)

Definition at line 199 of file dl_benchmarks.h.

◆ DRAW_RECT_BENCHMARKS

#define DRAW_RECT_BENCHMARKS (   BACKEND,
  ATTRIBUTES 
)
Value:
BackendType::k##BACKEND##Backend, \
ATTRIBUTES) \
->RangeMultiplier(2) \
->Range(16, 2048) \
->UseRealTime() \
->Unit(benchmark::kMillisecond);
void BM_DrawRect(benchmark::State &state, BackendType backend_type, unsigned attributes)

Definition at line 113 of file dl_benchmarks.h.

◆ DRAW_RRECT_BENCHMARKS

#define DRAW_RRECT_BENCHMARKS (   BACKEND,
  ATTRIBUTES 
)
Value:
BENCHMARK_CAPTURE(BM_DrawRRect, Symmetric/BACKEND, \
BackendType::k##BACKEND##Backend, \
ATTRIBUTES, \
SkRRect::Type::kSimple_Type) \
->RangeMultiplier(2) \
->Range(16, 256) \
->UseRealTime() \
->Unit(benchmark::kMillisecond); \
BENCHMARK_CAPTURE(BM_DrawRRect, NinePatch/BACKEND, \
BackendType::k##BACKEND##Backend, \
ATTRIBUTES, \
SkRRect::Type::kNinePatch_Type) \
->RangeMultiplier(2) \
->Range(16, 256) \
->UseRealTime() \
->Unit(benchmark::kMillisecond); \
BENCHMARK_CAPTURE(BM_DrawRRect, Complex/BACKEND, \
BackendType::k##BACKEND##Backend, \
ATTRIBUTES, \
SkRRect::Type::kComplex_Type) \
->RangeMultiplier(2) \
->Range(16, 256) \
->UseRealTime() \
->Unit(benchmark::kMillisecond);
void BM_DrawRRect(benchmark::State &state, BackendType backend_type, unsigned attributes, SkRRect::Type type)

Definition at line 263 of file dl_benchmarks.h.

◆ DRAW_SHADOW_BENCHMARKS

#define DRAW_SHADOW_BENCHMARKS (   BACKEND,
  ATTRIBUTES 
)

Definition at line 436 of file dl_benchmarks.h.

◆ DRAW_TEXT_BLOB_BENCHMARKS

#define DRAW_TEXT_BLOB_BENCHMARKS (   BACKEND,
  ATTRIBUTES 
)
Value:
BackendType::k##BACKEND##Backend, \
ATTRIBUTES) \
->RangeMultiplier(2) \
->Range(1, 256) \
->UseRealTime() \
->Unit(benchmark::kMillisecond) \
->Complexity();
void BM_DrawTextBlob(benchmark::State &state, BackendType backend_type, unsigned attributes)

Definition at line 425 of file dl_benchmarks.h.

◆ DRAW_VERTICES_BENCHMARKS

#define DRAW_VERTICES_BENCHMARKS (   BACKEND,
  ATTRIBUTES 
)

Definition at line 228 of file dl_benchmarks.h.

◆ FILL_BENCHMARKS

#define FILL_BENCHMARKS (   BACKEND,
  ATTRIBUTES 
)
Value:
DRAW_RECT_BENCHMARKS(BACKEND, ATTRIBUTES) \
DRAW_OVAL_BENCHMARKS(BACKEND, ATTRIBUTES) \
DRAW_CIRCLE_BENCHMARKS(BACKEND, ATTRIBUTES) \
DRAW_ARC_BENCHMARKS(BACKEND, ATTRIBUTES) \
DRAW_PATH_BENCHMARKS(BACKEND, ATTRIBUTES) \
DRAW_RRECT_BENCHMARKS(BACKEND, ATTRIBUTES) \
DRAW_DRRECT_BENCHMARKS(BACKEND, ATTRIBUTES) \
DRAW_TEXT_BLOB_BENCHMARKS(BACKEND, ATTRIBUTES)
#define DRAW_RECT_BENCHMARKS(BACKEND, ATTRIBUTES)

Definition at line 551 of file dl_benchmarks.h.

◆ OTHER_BENCHMARKS

#define OTHER_BENCHMARKS (   BACKEND,
  ATTRIBUTES 
)
Value:
DRAW_IMAGE_NINE_BENCHMARKS(BACKEND, ATTRIBUTES) \
DRAW_VERTICES_BENCHMARKS(BACKEND, ATTRIBUTES) \
DRAW_SHADOW_BENCHMARKS(BACKEND, ATTRIBUTES) \
SAVE_LAYER_BENCHMARKS(BACKEND, ATTRIBUTES)
#define DRAW_IMAGE_NINE_BENCHMARKS(BACKEND, ATTRIBUTES)

Definition at line 567 of file dl_benchmarks.h.

◆ RUN_DISPLAYLIST_BENCHMARKS

#define RUN_DISPLAYLIST_BENCHMARKS (   BACKEND)
Value:
STROKE_BENCHMARKS(BACKEND, kStrokedStyle | kAntiAliasing) \
STROKE_BENCHMARKS(BACKEND, kStrokedStyle | kHairlineStroke) \
STROKE_BENCHMARKS(BACKEND, kStrokedStyle | kHairlineStroke | \
FILL_BENCHMARKS(BACKEND, kFilledStyle) \
FILL_BENCHMARKS(BACKEND, kFilledStyle | kAntiAliasing) \
ANTI_ALIASING_BENCHMARKS(BACKEND, kEmpty) \
ANTI_ALIASING_BENCHMARKS(BACKEND, kAntiAliasing) \
OTHER_BENCHMARKS(BACKEND, kEmpty)
#define STROKE_BENCHMARKS(BACKEND, ATTRIBUTES)

Definition at line 573 of file dl_benchmarks.h.

◆ SAVE_LAYER_BENCHMARKS

#define SAVE_LAYER_BENCHMARKS (   BACKEND,
  ATTRIBUTES 
)
Value:
BENCHMARK_CAPTURE(BM_SaveLayer, Depth 1/BACKEND, \
BackendType::k##BACKEND##Backend, \
ATTRIBUTES, \
1) \
->RangeMultiplier(2) \
->Range(1, 128) \
->UseRealTime() \
->Unit(benchmark::kMillisecond); \
BENCHMARK_CAPTURE(BM_SaveLayer, Depth 8/BACKEND, \
BackendType::k##BACKEND##Backend, \
ATTRIBUTES, \
8) \
->RangeMultiplier(2) \
->Range(1, 128) \
->UseRealTime() \
->Unit(benchmark::kMillisecond);
void BM_SaveLayer(benchmark::State &state, BackendType backend_type, unsigned attributes, size_t save_depth)

Definition at line 518 of file dl_benchmarks.h.

◆ STROKE_BENCHMARKS

#define STROKE_BENCHMARKS (   BACKEND,
  ATTRIBUTES 
)
Value:
DRAW_LINE_BENCHMARKS(BACKEND, ATTRIBUTES) \
DRAW_POINTS_BENCHMARKS(BACKEND, ATTRIBUTES) \
DRAW_RECT_BENCHMARKS(BACKEND, ATTRIBUTES) \
DRAW_OVAL_BENCHMARKS(BACKEND, ATTRIBUTES) \
DRAW_CIRCLE_BENCHMARKS(BACKEND, ATTRIBUTES) \
DRAW_ARC_BENCHMARKS(BACKEND, ATTRIBUTES) \
DRAW_PATH_BENCHMARKS(BACKEND, ATTRIBUTES) \
DRAW_RRECT_BENCHMARKS(BACKEND, ATTRIBUTES) \
DRAW_DRRECT_BENCHMARKS(BACKEND, ATTRIBUTES) \
DRAW_TEXT_BLOB_BENCHMARKS(BACKEND, ATTRIBUTES)
#define DRAW_LINE_BENCHMARKS(BACKEND, ATTRIBUTES)

Definition at line 538 of file dl_benchmarks.h.