Flutter Engine
The 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
10#include "flutter/flow/layers/layer.h"
11#include "flutter/flow/stopwatch.h"
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 sk_sp<SkTextBlob> MakeStatisticsText(const Stopwatch& stopwatch,
26 const std::string& label_prefix,
27 const std::string& font_path);
28
29 bool IsReplacing(DiffContext* context, const Layer* layer) const override {
30 return layer->as_performance_overlay_layer() != nullptr;
31 }
32
33 void Diff(DiffContext* context, const Layer* old_layer) override;
34
36 return this;
37 }
38
39 explicit PerformanceOverlayLayer(uint64_t options,
40 const char* font_path = nullptr);
41
42 void Preroll(PrerollContext* context) override {}
43 void Paint(PaintContext& context) const override;
44
45 private:
46 int options_;
47 std::string font_path_;
48
50};
51
52} // namespace flutter
53
54#endif // FLUTTER_FLOW_LAYERS_PERFORMANCE_OVERLAY_LAYER_H_
const char * options
virtual const PerformanceOverlayLayer * as_performance_overlay_layer() const
Definition layer.h:260
void Diff(DiffContext *context, const Layer *old_layer) override
const PerformanceOverlayLayer * as_performance_overlay_layer() const override
static sk_sp< SkTextBlob > MakeStatisticsText(const Stopwatch &stopwatch, const std::string &label_prefix, const std::string &font_path)
bool IsReplacing(DiffContext *context, const Layer *layer) const override
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