Flutter Engine
The Flutter Engine
SkSLTraceHook.cpp
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
10
11namespace SkSL {
12
13std::unique_ptr<Tracer> Tracer::Make(std::vector<TraceInfo>* traceInfo) {
14 auto hook = std::make_unique<Tracer>();
15 hook->fTraceInfo = traceInfo;
16 return hook;
17}
18
19void Tracer::line(int lineNum) {
20 fTraceInfo->push_back({TraceInfo::Op::kLine, /*data=*/{lineNum, 0}});
21}
22void Tracer::var(int slot, int32_t val) {
23 fTraceInfo->push_back({TraceInfo::Op::kVar, /*data=*/{slot, val}});
24}
25void Tracer::enter(int fnIdx) {
26 fTraceInfo->push_back({TraceInfo::Op::kEnter, /*data=*/{fnIdx, 0}});
27}
28void Tracer::exit(int fnIdx) {
29 fTraceInfo->push_back({TraceInfo::Op::kExit, /*data=*/{fnIdx, 0}});
30}
32 fTraceInfo->push_back({TraceInfo::Op::kScope, /*data=*/{delta, 0}});
33}
34
35} // namespace SkSL
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