5#ifndef FLUTTER_DISPLAY_LIST_BENCHMARKING_DL_COMPLEXITY_HELPER_H_
6#define FLUTTER_DISPLAY_LIST_BENCHMARKING_DL_COMPLEXITY_HELPER_H_
8#include "flutter/display_list/benchmarking/dl_complexity.h"
9#include "flutter/display_list/dl_blend_mode.h"
10#include "flutter/display_list/dl_op_receiver.h"
11#include "flutter/display_list/utils/dl_receiver_utils.h"
100 : ceiling_(ceiling) {}
152 bool render_with_attributes,
158 render_with_attributes, constraint == SrcRectConstraint::kStrict);
169 bool render_with_attributes)
override {
175 for (
int i = 0; i <
count; i++) {
177 render_with_attributes,
true);
193 if (
Ceiling() - complexity_score_ < batched_complexity) {
197 return complexity_score_ + batched_complexity;
203 if (ceiling_ - complexity_score_ < complexity) {
208 complexity_score_ += complexity;
215 inline unsigned int Ceiling() {
return ceiling_; }
219 unsigned int line_verb_cost,
220 unsigned int quad_verb_cost,
221 unsigned int conic_verb_cost,
222 unsigned int cubic_verb_cost) {
223 int verb_count =
path.countVerbs();
224 std::vector<uint8_t> verbs(verb_count);
225 path.getVerbs(verbs.data(), verbs.size());
227 unsigned int complexity = 0;
228 for (
int i = 0; i < verb_count; i++) {
231 complexity += line_verb_cost;
234 complexity += quad_verb_cost;
237 complexity += conic_verb_cost;
240 complexity += cubic_verb_cost;
249 bool render_with_attributes,
250 bool enforce_src_edges) = 0;
263 bool is_complex_ =
false;
264 unsigned int ceiling_;
266 unsigned int complexity_score_ = 0;
SkISize dimensions() const
virtual bool isTextureBacked() const =0
void setAntiAlias(bool aa) override
void setPathEffect(const DlPathEffect *effect) override
void setStrokeMiter(SkScalar limit) override
virtual void ImageRect(const SkISize &size, bool texture_backed, bool render_with_attributes, bool enforce_src_edges)=0
void setInvertColors(bool invert) override
void setStrokeWidth(SkScalar width) override
void setColorSource(const DlColorSource *source) override
void drawPaint() override
void setColor(DlColor color) override
virtual ~ComplexityCalculatorHelper()=default
unsigned int CurrentComplexityScore()
void AccumulateComplexity(unsigned int complexity)
ComplexityCalculatorHelper(unsigned int ceiling)
void setMaskFilter(const DlMaskFilter *filter) override
void drawColor(DlColor color, DlBlendMode mode) override
void drawAtlas(const sk_sp< DlImage > atlas, const SkRSXform xform[], const SkRect tex[], const DlColor colors[], int count, DlBlendMode mode, DlImageSampling sampling, const SkRect *cull_rect, bool render_with_attributes) override
void setStrokeCap(DlStrokeCap cap) override
void setColorFilter(const DlColorFilter *filter) override
void setStrokeJoin(DlStrokeJoin join) override
virtual unsigned int BatchedComplexity()=0
void setImageFilter(const DlImageFilter *filter) override
void setBlendMode(DlBlendMode mode) override
void setDrawStyle(DlDrawStyle style) override
void drawImageRect(const sk_sp< DlImage > image, const SkRect &src, const SkRect &dst, DlImageSampling sampling, bool render_with_attributes, SrcRectConstraint constraint=SrcRectConstraint::kFast) override
unsigned int CalculatePathComplexity(const SkPath &path, unsigned int line_verb_cost, unsigned int quad_verb_cost, unsigned int conic_verb_cost, unsigned int cubic_verb_cost)
unsigned int ComplexityScore()
Internal API for rendering recorded display lists to backends.
DlPaint & setAntiAlias(bool isAntiAlias)
DlPaint & setStrokeWidth(float width)
DlDrawStyle getDrawStyle() const
float getStrokeWidth() const
DlPaint & setDrawStyle(DlDrawStyle style)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
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 mode
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
static constexpr SkISize Make(int32_t w, int32_t h)