Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
dl_benchmarks.cc File Reference
#include "flutter/display_list/benchmarking/dl_benchmarks.h"
#include "flutter/display_list/dl_builder.h"
#include "flutter/display_list/dl_op_flags.h"
#include "flutter/display_list/dl_text_skia.h"
#include "flutter/display_list/geometry/dl_path_builder.h"
#include "flutter/display_list/image/dl_image_skia.h"
#include "flutter/display_list/skia/dl_sk_canvas.h"
#include "flutter/display_list/testing/dl_test_snippets.h"
#include "flutter/testing/display_list_testing.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkImage.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/core/SkTextBlob.h"

Go to the source code of this file.

Namespaces

namespace  flutter
 
namespace  flutter::testing
 

Macros

#define BENCHMARK_OVERHEAD(FUNC, BACKEND)
 
#define DRAW_BENCHMARK_PRIMITIVES_LIMITS(BACKEND, TYPE, ATTRIBUTES, MIN, MAX, MULT)
 
#define DRAW_BENCHMARK_PRIMITIVE(BACKEND, TYPE, ATTRIBUTES)    DRAW_BENCHMARK_PRIMITIVES_LIMITS(BACKEND, TYPE, ATTRIBUTES, 16, 1024, 4)
 
#define DRAW_BENCHMARK_SHADOW_PRIMITIVE(BACKEND, TYPE, ATTRIBUTES)    DRAW_BENCHMARK_PRIMITIVES_LIMITS(BACKEND, TYPE, ATTRIBUTES, 64, 256, 4)
 
#define DRAW_BENCHMARK_PRIMITIVES_LINE(BACKEND)
 
#define DRAW_BENCHMARK_PRIMITIVES_TYPE(BACKEND, TYPE)
 
#define DRAW_BENCHMARK_PRIMITIVE_SUITE(BACKEND)
 

Functions

void flutter::testing::BM_SyncOverhead (benchmark::State &state, BackendType backend_type)
 
void flutter::testing::BM_EmptyDisplayList (benchmark::State &state, BackendType backend_type)
 
void flutter::testing::BM_SingleOpDisplayList (benchmark::State &state, BackendType backend_type)
 
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_DrawOval (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_DrawRRect (benchmark::State &state, BackendType backend_type, unsigned attributes, RRectType type)
 
void flutter::testing::BM_DrawSimpleRRect (benchmark::State &state, BackendType backend_type, unsigned attributes)
 
void flutter::testing::BM_DrawNinePatchRRect (benchmark::State &state, BackendType backend_type, unsigned attributes)
 
void flutter::testing::BM_DrawComplexRRect (benchmark::State &state, BackendType backend_type, unsigned attributes)
 
void flutter::testing::BM_DrawRSE (benchmark::State &state, BackendType backend_type, unsigned attributes, RRectType type)
 
void flutter::testing::BM_DrawSimpleRSE (benchmark::State &state, BackendType backend_type, unsigned attributes)
 
void flutter::testing::BM_DrawNinePatchRSE (benchmark::State &state, BackendType backend_type, unsigned attributes)
 
void flutter::testing::BM_DrawComplexRSE (benchmark::State &state, BackendType backend_type, unsigned attributes)
 
void flutter::testing::BM_DrawDRRect (benchmark::State &state, BackendType backend_type, unsigned attributes, RRectType type)
 
void flutter::testing::BM_DrawArc (benchmark::State &state, BackendType backend_type, unsigned attributes)
 
std::vector< DlPointflutter::testing::GetPolygonPoints (size_t n, DlPoint center, DlScalar r)
 
void flutter::testing::GetLinesPath (DlPathBuilder &path_builder, size_t sides, DlPoint center, float radius)
 
void flutter::testing::GetQuadsPath (DlPathBuilder &path_builder, size_t sides, DlPoint center, float radius)
 
void flutter::testing::GetConicsPath (DlPathBuilder &path_builder, size_t sides, DlPoint center, float radius)
 
void flutter::testing::GetCubicsPath (DlPathBuilder &path_builder, size_t sides, DlPoint center, float radius)
 
void flutter::testing::MultiplyPath (DlPathBuilder &path_builder, PathVerb type, DlPoint center, size_t sides, size_t number, float radius)
 
std::string flutter::testing::VerbToString (PathVerb type)
 
void flutter::testing::BM_DrawPath (benchmark::State &state, BackendType backend_type, unsigned attributes, PathVerb type)
 
std::shared_ptr< DlVerticesflutter::testing::GetTestVertices (DlPoint center, float radius, size_t vertex_count, DlVertexMode mode, size_t &final_vertex_count)
 
std::string flutter::testing::VertexModeToString (DlVertexMode mode)
 
void flutter::testing::BM_DrawVertices (benchmark::State &state, BackendType backend_type, unsigned attributes, DlVertexMode mode)
 
std::vector< DlPointflutter::testing::GetTestPoints (size_t count, DlISize canvas_size)
 
std::string flutter::testing::PointModeToString (DlPointMode mode)
 
void flutter::testing::BM_DrawPoints (benchmark::State &state, BackendType backend_type, unsigned attributes, DlPointMode mode)
 
sk_sp< SkImage > flutter::testing::ImageFromBitmapWithNewID (const SkBitmap &bitmap)
 
void flutter::testing::BM_DrawImage (benchmark::State &state, BackendType backend_type, unsigned attributes, DlImageSampling options, bool upload_bitmap)
 
std::string flutter::testing::ConstraintToString (DlSrcRectConstraint constraint)
 
void flutter::testing::BM_DrawImageRect (benchmark::State &state, BackendType backend_type, unsigned attributes, DlImageSampling options, DlSrcRectConstraint constraint, bool upload_bitmap)
 
std::string flutter::testing::FilterModeToString (const DlFilterMode mode)
 
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, PathVerb type)
 
void flutter::testing::BM_SaveLayer (benchmark::State &state, BackendType backend_type, unsigned attributes, size_t save_depth)
 

Variables

constexpr int flutter::testing::kAAFilledPrimitive
 
constexpr int flutter::testing::kAAHairlinePrimitive
 
constexpr int flutter::testing::kAAStroke10Primitive
 
constexpr int flutter::testing::kFilledShadow5Primitive
 
constexpr int flutter::testing::kFilledShadow10Primitive
 

Macro Definition Documentation

◆ BENCHMARK_OVERHEAD

#define BENCHMARK_OVERHEAD (   FUNC,
  BACKEND 
)
Value:
BENCHMARK_CAPTURE(BM_##FUNC, BACKEND, BackendType::k##BACKEND) \
->RangeMultiplier(4) \
->Range(16, 1024) \
->UseRealTime() \
->Unit(benchmark::kNanosecond);

Definition at line 1645 of file dl_benchmarks.cc.

◆ DRAW_BENCHMARK_PRIMITIVE

#define DRAW_BENCHMARK_PRIMITIVE (   BACKEND,
  TYPE,
  ATTRIBUTES 
)     DRAW_BENCHMARK_PRIMITIVES_LIMITS(BACKEND, TYPE, ATTRIBUTES, 16, 1024, 4)

Definition at line 1662 of file dl_benchmarks.cc.

◆ DRAW_BENCHMARK_PRIMITIVE_SUITE

#define DRAW_BENCHMARK_PRIMITIVE_SUITE (   BACKEND)
Value:
BENCHMARK_OVERHEAD(SyncOverhead, BACKEND) \
BENCHMARK_OVERHEAD(EmptyDisplayList, BACKEND) \
BENCHMARK_OVERHEAD(SingleOpDisplayList, BACKEND) \
DRAW_BENCHMARK_PRIMITIVES_LINE(BACKEND) \
DRAW_BENCHMARK_PRIMITIVES_TYPE(BACKEND, Rect) \
DRAW_BENCHMARK_PRIMITIVES_TYPE(BACKEND, Oval) \
DRAW_BENCHMARK_PRIMITIVES_TYPE(BACKEND, Circle) \
DRAW_BENCHMARK_PRIMITIVES_TYPE(BACKEND, SimpleRRect) \
DRAW_BENCHMARK_PRIMITIVES_TYPE(BACKEND, ComplexRRect) \
DRAW_BENCHMARK_PRIMITIVES_TYPE(BACKEND, SimpleRSE) \
DRAW_BENCHMARK_PRIMITIVES_TYPE(BACKEND, ComplexRSE)
#define BENCHMARK_OVERHEAD(FUNC, BACKEND)

Definition at line 1679 of file dl_benchmarks.cc.

◆ DRAW_BENCHMARK_PRIMITIVES_LIMITS

#define DRAW_BENCHMARK_PRIMITIVES_LIMITS (   BACKEND,
  TYPE,
  ATTRIBUTES,
  MIN,
  MAX,
  MULT 
)
Value:
BENCHMARK_CAPTURE(BM_Draw##TYPE, ATTRIBUTES/BACKEND, \
BackendType::k##BACKEND, \
k##ATTRIBUTES##Primitive) \
->RangeMultiplier(MULT) \
->Range(MIN, MAX) \
->UseRealTime() \
->Unit(benchmark::kMillisecond);

Definition at line 1652 of file dl_benchmarks.cc.

◆ DRAW_BENCHMARK_PRIMITIVES_LINE

#define DRAW_BENCHMARK_PRIMITIVES_LINE (   BACKEND)
Value:
DRAW_BENCHMARK_PRIMITIVE(BACKEND, Line, AAHairline) \
DRAW_BENCHMARK_PRIMITIVE(BACKEND, Line, AAStroke10) \
#define DRAW_BENCHMARK_PRIMITIVE(BACKEND, TYPE, ATTRIBUTES)

Definition at line 1668 of file dl_benchmarks.cc.

◆ DRAW_BENCHMARK_PRIMITIVES_TYPE

#define DRAW_BENCHMARK_PRIMITIVES_TYPE (   BACKEND,
  TYPE 
)
Value:
DRAW_BENCHMARK_PRIMITIVE(BACKEND, TYPE, AAFilled) \
DRAW_BENCHMARK_PRIMITIVE(BACKEND, TYPE, AAHairline) \
DRAW_BENCHMARK_PRIMITIVE(BACKEND, TYPE, AAStroke10) \
DRAW_BENCHMARK_SHADOW_PRIMITIVE(BACKEND, TYPE, FilledShadow5) \
DRAW_BENCHMARK_SHADOW_PRIMITIVE(BACKEND, TYPE, FilledShadow10) \

Definition at line 1672 of file dl_benchmarks.cc.

◆ DRAW_BENCHMARK_SHADOW_PRIMITIVE

#define DRAW_BENCHMARK_SHADOW_PRIMITIVE (   BACKEND,
  TYPE,
  ATTRIBUTES 
)     DRAW_BENCHMARK_PRIMITIVES_LIMITS(BACKEND, TYPE, ATTRIBUTES, 64, 256, 4)

Definition at line 1665 of file dl_benchmarks.cc.