skia2/tools/viewer/SkSLDebuggerSlide.h
John Stiles 708f28f4b1 Show the stack trace in the Debugger slide.
Right now it is non-interactible, but it's still useful for keeping
track of the flow of execution.

http://screen/4b6WMGdw6j32AGc

Change-Id: I978d9b441c15674c6cae508b123579021c2ecc46
Bug: skia:12666
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/484076
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-12-14 15:56:44 +00:00

49 lines
1.2 KiB
C++

/*
* Copyright 2021 Google LLC
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkSLDebuggerSlide_DEFINED
#define SkSLDebuggerSlide_DEFINED
#include "src/sksl/tracing/SkVMDebugTrace.h"
#include "src/sksl/tracing/SkVMDebugTracePlayer.h"
#include "tools/viewer/Slide.h"
class SkSLDebuggerSlide : public Slide {
public:
SkSLDebuggerSlide();
SkISize getDimensions() const override { return SkISize::MakeEmpty(); }
void draw(SkCanvas* canvas) override;
bool animate(double nanos) override;
void resize(SkScalar winWidth, SkScalar winHeight) override {}
void load(SkScalar winWidth, SkScalar winHeight) override;
void unload() override;
bool onMouse(SkScalar x, SkScalar y, skui::InputState state,
skui::ModifierKey modifiers) override { return true; }
private:
void showRootGUI();
void showLoadTraceGUI();
void showDebuggerGUI();
void showStackTraceTable();
void showVariableTable();
void showCodeTable();
static constexpr int kNumTopRows = 12;
sk_sp<SkSL::SkVMDebugTrace> fTrace;
SkSL::SkVMDebugTracePlayer fPlayer;
bool fRefresh = false;
char fTraceFile[256] = "SkVMDebugTrace.json";
};
#endif