Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Dumper Class Reference

Public Member Functions

 Dumper (SkCanvas *canvas, int count)
 
template<typename T >
void operator() (const T &command)
 
void operator() (const SkRecords::NoOp &)
 
template<typename T >
void print (const T &command, double ns)
 
void print (const SkRecords::Restore &command, double ns)
 
void print (const SkRecords::Save &command, double ns)
 
void print (const SkRecords::SaveLayer &command, double ns)
 
void print (const SkRecords::DrawPicture &command, double ns)
 
void print (const SkRecords::DrawAnnotation &command, double ns)
 

Detailed Description

Definition at line 33 of file dump_record.cpp.

Constructor & Destructor Documentation

◆ Dumper()

Dumper::Dumper ( SkCanvas canvas,
int  count 
)
inlineexplicit

Definition at line 35 of file dump_record.cpp.

36 : fDigits(0)
37 , fIndent(0)
38 , fIndex(0)
39 , fDraw(canvas, nullptr, nullptr, 0, nullptr)
40 {
41 while (count > 0) {
42 count /= 10;
43 fDigits++;
44 }
45 }
int count

Member Function Documentation

◆ operator()() [1/2]

void Dumper::operator() ( const SkRecords::NoOp &  )
inline

Definition at line 54 of file dump_record.cpp.

54 {
55 // Move on without printing anything.
56 }

◆ operator()() [2/2]

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

Definition at line 48 of file dump_record.cpp.

48 {
49 auto start = SkTime::GetNSecs();
50 fDraw(command);
51 this->print(command, SkTime::GetNSecs() - start);
52 }
void print(const T &command, double ns)
double GetNSecs()
Definition SkTime.cpp:17

◆ print() [1/6]

void Dumper::print ( const SkRecords::DrawAnnotation &  command,
double  ns 
)
inline

Definition at line 93 of file dump_record.cpp.

93 {
94 int us = (int)(ns * 1e-3);
95 if (!FLAGS_timeWithCommand) {
96 printf("%6dus ", us);
97 }
98 printf("%*d ", fDigits, fIndex++);
99 for (int i = 0; i < fIndent; i++) {
100 printf(" ");
101 }
102 if (FLAGS_timeWithCommand) {
103 printf("%6dus ", us);
104 }
105 printf("DrawAnnotation [%g %g %g %g] %s\n",
106 command.rect.left(), command.rect.top(), command.rect.right(), command.rect.bottom(),
107 command.key.c_str());
108 }
Type::kYUV Type::kRGBA() int(0.7 *637)
std::string printf(const char *fmt,...) SK_PRINTF_LIKE(1
list command
Definition valgrind.py:24

◆ print() [2/6]

void Dumper::print ( const SkRecords::DrawPicture &  command,
double  ns 
)
inline

Definition at line 78 of file dump_record.cpp.

78 {
79 this->printNameAndTime(command, ns);
80
81 if (auto bp = SkPicturePriv::AsSkBigPicture(command.picture)) {
82 ++fIndent;
83
84 const SkRecord& record = *bp->record();
85 for (int i = 0; i < record.count(); i++) {
86 record.visit(i, *this);
87 }
88
89 --fIndent;
90 }
91 }
static const SkBigPicture * AsSkBigPicture(const sk_sp< const SkPicture > &picture)
auto visit(int i, F &&f) const -> decltype(f(SkRecords::NoOp()))
Definition SkRecord.h:45
int count() const
Definition SkRecord.h:38

◆ print() [3/6]

void Dumper::print ( const SkRecords::Restore &  command,
double  ns 
)
inline

Definition at line 63 of file dump_record.cpp.

63 {
64 --fIndent;
65 this->printNameAndTime(command, ns);
66 }

◆ print() [4/6]

void Dumper::print ( const SkRecords::Save &  command,
double  ns 
)
inline

Definition at line 68 of file dump_record.cpp.

68 {
69 this->printNameAndTime(command, ns);
70 ++fIndent;
71 }

◆ print() [5/6]

void Dumper::print ( const SkRecords::SaveLayer &  command,
double  ns 
)
inline

Definition at line 73 of file dump_record.cpp.

73 {
74 this->printNameAndTime(command, ns);
75 ++fIndent;
76 }

◆ print() [6/6]

template<typename T >
void Dumper::print ( const T command,
double  ns 
)
inline

Definition at line 59 of file dump_record.cpp.

59 {
60 this->printNameAndTime(command, ns);
61 }

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