Flutter Engine
The Flutter Engine
Classes | Public Member Functions | Static Public Member Functions | List of all members
flutter::DisplayListMetalComplexityCalculator Class Reference

#include <dl_complexity_metal.h>

Inheritance diagram for flutter::DisplayListMetalComplexityCalculator:
flutter::DisplayListComplexityCalculator

Public Member Functions

unsigned int Compute (const DisplayList *display_list) override
 
bool ShouldBeCached (unsigned int complexity_score) override
 
void SetComplexityCeiling (unsigned int ceiling) override
 
- Public Member Functions inherited from flutter::DisplayListComplexityCalculator
virtual ~DisplayListComplexityCalculator ()=default
 
virtual unsigned int Compute (const DisplayList *display_list)=0
 
virtual bool ShouldBeCached (unsigned int complexity_score)=0
 
virtual void SetComplexityCeiling (unsigned int ceiling)=0
 

Static Public Member Functions

static DisplayListMetalComplexityCalculatorGetInstance ()
 
- Static Public Member Functions inherited from flutter::DisplayListComplexityCalculator
static DisplayListComplexityCalculatorGetForSoftware ()
 
static DisplayListComplexityCalculatorGetForBackend (GrBackendApi backend)
 

Detailed Description

Definition at line 12 of file dl_complexity_metal.h.

Member Function Documentation

◆ Compute()

unsigned int flutter::DisplayListMetalComplexityCalculator::Compute ( const DisplayList display_list)
inlineoverridevirtual

Implements flutter::DisplayListComplexityCalculator.

Definition at line 17 of file dl_complexity_metal.h.

17 {
18 MetalHelper helper(ceiling_);
19 display_list->Dispatch(helper);
20 return helper.ComplexityScore();
21 }

◆ GetInstance()

DisplayListMetalComplexityCalculator * flutter::DisplayListMetalComplexityCalculator::GetInstance ( )
static

Definition at line 21 of file dl_complexity_metal.cc.

21 {
22 if (instance_ == nullptr) {
23 instance_ = new DisplayListMetalComplexityCalculator();
24 }
25 return instance_;
26}

◆ SetComplexityCeiling()

void flutter::DisplayListMetalComplexityCalculator::SetComplexityCeiling ( unsigned int  ceiling)
inlineoverridevirtual

Implements flutter::DisplayListComplexityCalculator.

Definition at line 28 of file dl_complexity_metal.h.

28 {
29 ceiling_ = ceiling;
30 }

◆ ShouldBeCached()

bool flutter::DisplayListMetalComplexityCalculator::ShouldBeCached ( unsigned int  complexity_score)
inlineoverridevirtual

Implements flutter::DisplayListComplexityCalculator.

Definition at line 23 of file dl_complexity_metal.h.

23 {
24 // Set cache threshold at 1ms
25 return complexity_score > 200000u;
26 }

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