Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
AreaSummer Class Reference

Public Member Functions

 AreaSummer ()
 
template<typename T >
void operator() (const T &)
 
void operator() (const SkRecords::DrawRect &draw)
 
int area () const
 
void apply (const SkRecord &record)
 

Detailed Description

Definition at line 19 of file RecordTest.cpp.

Constructor & Destructor Documentation

◆ AreaSummer()

AreaSummer::AreaSummer ( )
inline

Definition at line 21 of file RecordTest.cpp.

21: fArea(0) {}

Member Function Documentation

◆ apply()

void AreaSummer::apply ( const SkRecord record)
inline

Definition at line 31 of file RecordTest.cpp.

31 {
32 for (int i = 0; i < record.count(); i++) {
33 record.visit(i, *this);
34 }
35 }
auto visit(int i, F &&f) const -> decltype(f(SkRecords::NoOp()))
Definition: SkRecord.h:45
int count() const
Definition: SkRecord.h:38

◆ area()

int AreaSummer::area ( ) const
inline

Definition at line 29 of file RecordTest.cpp.

29{ return fArea; }

◆ operator()() [1/2]

void AreaSummer::operator() ( const SkRecords::DrawRect &  draw)
inline

Definition at line 25 of file RecordTest.cpp.

25 {
26 fArea += (int)(draw.rect.width() * draw.rect.height());
27 }
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27

◆ operator()() [2/2]

template<typename T >
void AreaSummer::operator() ( const T )
inline

Definition at line 23 of file RecordTest.cpp.

23{ }

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