Flutter Engine
 
Loading...
Searching...
No Matches
performance_overlay_layer.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef FLUTTER_FLOW_LAYERS_PERFORMANCE_OVERLAY_LAYER_H_
6#define FLUTTER_FLOW_LAYERS_PERFORMANCE_OVERLAY_LAYER_H_
7
8#include <string>
9
12#include "flutter/fml/macros.h"
13
14class SkTextBlob;
15
16namespace flutter {
17
20const int kDisplayEngineStatistics = 1 << 2;
21const int kVisualizeEngineStatistics = 1 << 3;
22
24 public:
25 static SkFont MakeStatisticsFont(std::string_view font_path);
26
27 static sk_sp<SkTextBlob> MakeStatisticsText(const Stopwatch& stopwatch,
28 const SkFont& font,
29 std::string_view label_prefix);
30
31 bool IsReplacing(DiffContext* context, const Layer* layer) const override {
32 return layer->as_performance_overlay_layer() != nullptr;
33 }
34
35 void Diff(DiffContext* context, const Layer* old_layer) override;
36
38 return this;
39 }
40
41 explicit PerformanceOverlayLayer(uint64_t options,
42 const char* font_path = nullptr);
43
44 void Preroll(PrerollContext* context) override {}
45 void Paint(PaintContext& context) const override;
46
47 private:
48 int options_;
49 std::string font_path_;
50
52};
53
54} // namespace flutter
55
56#endif // FLUTTER_FLOW_LAYERS_PERFORMANCE_OVERLAY_LAYER_H_
virtual const PerformanceOverlayLayer * as_performance_overlay_layer() const
Definition layer.h:249
void Diff(DiffContext *context, const Layer *old_layer) override
const PerformanceOverlayLayer * as_performance_overlay_layer() const override
bool IsReplacing(DiffContext *context, const Layer *layer) const override
static sk_sp< SkTextBlob > MakeStatisticsText(const Stopwatch &stopwatch, const SkFont &font, std::string_view label_prefix)
static SkFont MakeStatisticsFont(std::string_view font_path)
void Preroll(PrerollContext *context) override
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition macros.h:27
const int kVisualizeEngineStatistics
const int kDisplayEngineStatistics
const int kVisualizeRasterizerStatistics
const int kDisplayRasterizerStatistics