2021-12-11 00:53:57 +00:00
|
|
|
/*
|
2021-12-13 19:42:29 +00:00
|
|
|
* Copyright 2021 Google LLC
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
2021-12-11 00:53:57 +00:00
|
|
|
|
|
|
|
#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();
|
2021-12-14 15:09:07 +00:00
|
|
|
void showStackTraceTable();
|
2021-12-13 19:42:29 +00:00
|
|
|
void showVariableTable();
|
2021-12-14 15:09:07 +00:00
|
|
|
void showCodeTable();
|
|
|
|
|
|
|
|
static constexpr int kNumTopRows = 12;
|
2021-12-11 00:53:57 +00:00
|
|
|
|
|
|
|
sk_sp<SkSL::SkVMDebugTrace> fTrace;
|
|
|
|
SkSL::SkVMDebugTracePlayer fPlayer;
|
2021-12-13 19:42:29 +00:00
|
|
|
bool fRefresh = false;
|
2021-12-11 00:53:57 +00:00
|
|
|
|
|
|
|
char fTraceFile[256] = "SkVMDebugTrace.json";
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|