Flutter Engine
The Flutter Engine
stopwatch_sk.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_STOPWATCH_SK_H_
6#define FLUTTER_FLOW_STOPWATCH_SK_H_
7
8#include "flow/stopwatch.h"
10
11namespace flutter {
12
13//------------------------------------------------------------------------------
14/// A stopwatch visualizer that uses Skia (|SkCanvas|) to draw the stopwatch.
15///
16/// @see DlStopwatchVisualizer for the newer non-backend specific version.
18 public:
19 explicit SkStopwatchVisualizer(const Stopwatch& stopwatch)
20 : StopwatchVisualizer(stopwatch) {}
21
22 void Visualize(DlCanvas* canvas, const SkRect& rect) const override;
23
24 private:
25 /// Initializes the |SkSurface| used for drawing the stopwatch.
26 ///
27 /// Draws the base background and any timing data from before the initial
28 /// call to |Visualize|.
29 void InitVisualizeSurface(SkISize size) const;
30
31 // Mutable data cache for performance optimization of the graphs.
32 // Prevents expensive redrawing of old data.
33 mutable bool cache_dirty_ = true;
34 mutable sk_sp<SkSurface> visualize_cache_surface_;
35 mutable size_t prev_drawn_sample_index_ = 0;
36};
37
38} // namespace flutter
39
40#endif // FLUTTER_FLOW_STOPWATCH_SK_H_
Developer-facing API for rendering anything within the engine.
Definition: dl_canvas.h:38
SkStopwatchVisualizer(const Stopwatch &stopwatch)
Definition: stopwatch_sk.h:19
void Visualize(DlCanvas *canvas, const SkRect &rect) const override
Renders the stopwatch as a graph.
Definition: stopwatch_sk.cc:88
Abstract class for visualizing (i.e. drawing) a stopwatch.
Definition: stopwatch.h:93
sk_sp< SkBlender > blender SkRect rect
Definition: SkRecords.h:350
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259
Definition: SkSize.h:16