Flutter Engine
The Flutter Engine
SkSLTraceHook.h
Go to the documentation of this file.
1/*
2 * Copyright 2023 Google LLC
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef SKSLTRACEHOOK
9#define SKSLTRACEHOOK
10
11#include <cstdint>
12#include <memory>
13#include <vector>
14
15namespace SkSL {
16
17struct TraceInfo;
18
19class TraceHook {
20public:
21 virtual ~TraceHook() = default;
22 virtual void line(int lineNum) = 0;
23 virtual void var(int slot, int32_t val) = 0;
24 virtual void enter(int fnIdx) = 0;
25 virtual void exit(int fnIdx) = 0;
26 virtual void scope(int delta) = 0;
27};
28
29class Tracer : public TraceHook {
30public:
31 static std::unique_ptr<Tracer> Make(std::vector<TraceInfo>* traceInfo);
32
33 void line(int lineNum) override;
34 void var(int slot, int32_t val) override;
35 void enter(int fnIdx) override;
36 void exit(int fnIdx) override;
37 void scope(int delta) override;
38
39private:
40 std::vector<TraceInfo>* fTraceInfo;
41};
42
43} // namespace SkSL
44
45#endif
virtual void var(int slot, int32_t val)=0
virtual void scope(int delta)=0
virtual void enter(int fnIdx)=0
virtual ~TraceHook()=default
virtual void exit(int fnIdx)=0
virtual void line(int lineNum)=0
void exit(int fnIdx) override
void var(int slot, int32_t val) override
void enter(int fnIdx) override
void scope(int delta) override
static std::unique_ptr< Tracer > Make(std::vector< TraceInfo > *traceInfo)
void line(int lineNum) override