5#include "flutter/flow/layers/performance_overlay_layer.h"
20#ifdef IMPELLER_SUPPORTS_RENDERING
27void VisualizeStopWatch(
DlCanvas* canvas,
28 const bool impeller_enabled,
29 const Stopwatch& stopwatch,
36 const std::string& label_prefix,
37 const std::string& font_path) {
38 const int label_x = 8;
39 const int label_y = -10;
43 std::unique_ptr<StopwatchVisualizer> visualizer;
45 if (impeller_enabled) {
46 visualizer = std::make_unique<DlStopwatchVisualizer>(stopwatch);
48 visualizer = std::make_unique<SkStopwatchVisualizer>(stopwatch);
51 visualizer->Visualize(canvas, visualization_rect);
56 stopwatch, label_prefix, font_path);
59#ifdef IMPELLER_SUPPORTS_RENDERING
60 if (impeller_enabled) {
74 const std::string& label_prefix,
75 const std::string& font_path) {
78 if (font_path ==
"") {
96 stream.setf(std::ios::fixed | std::ios::showpoint);
97 stream << std::setprecision(1);
98 stream << label_prefix <<
" " <<
"max " << max_ms_per_frame <<
" ms/frame, "
99 <<
"avg " << average_ms_per_frame <<
" ms/frame";
106 const char* font_path)
108 if (font_path !=
nullptr) {
109 font_path_ = font_path;
114 const Layer* old_layer) {
126 const int padding = 8;
static float prev(float f)
@ kUTF8
uses bytes to represent UTF-8 or ASCII
sk_sp< SkTypeface > makeFromFile(const char path[], int ttcIndex=0) const
sk_sp< SkTypeface > legacyMakeTypeface(const char familyName[], SkFontStyle style) const
sk_sp< SkTypeface > matchFamilyStyle(const char familyName[], const SkFontStyle &) const
static sk_sp< SkTextBlob > MakeFromText(const void *text, size_t byteLength, const SkFont &font, SkTextEncoding encoding=SkTextEncoding::kUTF8)
void AddLayerBounds(const SkRect &rect)
void SetLayerPaintRegion(const Layer *layer, const PaintRegion ®ion)
void MarkSubtreeDirty(const PaintRegion &previous_paint_region=PaintRegion())
PaintRegion CurrentSubtreeRegion() const
PaintRegion GetOldLayerPaintRegion(const Layer *layer) const
bool IsSubtreeDirty() const
const SkRect & paint_bounds() const
virtual const PerformanceOverlayLayer * as_performance_overlay_layer() const
fml::TimeDelta MaxDelta() const
fml::TimeDelta AverageDelta() const
constexpr double ToMillisecondsF() const
#define FML_DCHECK(condition)
const int kVisualizeEngineStatistics
const int kDisplayEngineStatistics
const int kVisualizeRasterizerStatistics
const int kDisplayRasterizerStatistics
font
Font Metadata and Metrics.
std::shared_ptr< TextFrame > MakeTextFrameFromTextBlobSkia(const sk_sp< SkTextBlob > &blob)
flutter::DlCanvas DlCanvas
sk_sp< SkFontMgr > GetDefaultFontManager(uint32_t font_initialization_data)
constexpr float x() const
constexpr float y() const
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
constexpr float height() const
constexpr float width() const
const Stopwatch & raster_time
const Stopwatch & ui_time
LayerStateStack & state_stack