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) {}
151 bool render_with_attributes,
168 bool render_with_attributes)
override {
176 render_with_attributes,
true);
192 if (
Ceiling() - complexity_score_ < batched_complexity) {
196 return complexity_score_ + batched_complexity;
202 if (ceiling_ - complexity_score_ < complexity) {
207 complexity_score_ += complexity;
214 inline unsigned int Ceiling() {
return ceiling_; }
218 unsigned int line_verb_cost,
219 unsigned int quad_verb_cost,
220 unsigned int conic_verb_cost,
221 unsigned int cubic_verb_cost) {
222 int verb_count =
path.countVerbs();
223 std::vector<uint8_t> verbs(verb_count);
224 path.getVerbs(verbs.data(), verbs.size());
226 unsigned int complexity = 0;
227 for (
int i = 0;
i < verb_count;
i++) {
229 case SkPath::Verb::kLine_Verb:
230 complexity += line_verb_cost;
232 case SkPath::Verb::kQuad_Verb:
233 complexity += quad_verb_cost;
235 case SkPath::Verb::kConic_Verb:
236 complexity += conic_verb_cost;
238 case SkPath::Verb::kCubic_Verb:
239 complexity += cubic_verb_cost;
248 bool render_with_attributes,
249 bool enforce_src_edges) = 0;
262 bool is_complex_ =
false;
263 unsigned int ceiling_;
265 unsigned int complexity_score_ = 0;
SkISize dimensions() const
virtual bool isTextureBacked() const =0
void setAntiAlias(bool aa) 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)
sk_sp< const SkImage > atlas
sk_sp< const SkImage > image
PODArray< SkColor > colors
SkSamplingOptions sampling
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 SkString join(const CommandLineFlags::StringArray &)
static constexpr SkISize Make(int32_t w, int32_t h)