summaryrefslogtreecommitdiff
path: root/bench/core_widget.hpp
diff options
context:
space:
mode:
authorBenji Dial <benji@benjidial.net>2023-05-29 16:36:19 -0400
committerBenji Dial <benji@benjidial.net>2023-05-29 16:36:19 -0400
commit97c79ff771d4993e322d0d6c44f265180797b2eb (patch)
tree5513cf25721cf21c06efd913ed2f82b980e3cb24 /bench/core_widget.hpp
parent338549f9cd49fa0f3001826c6605663fa6dd019b (diff)
downloadlib94-97c79ff771d4993e322d0d6c44f265180797b2eb.tar.gz
a whole lot more
Diffstat (limited to 'bench/core_widget.hpp')
-rw-r--r--bench/core_widget.hpp46
1 files changed, 46 insertions, 0 deletions
diff --git a/bench/core_widget.hpp b/bench/core_widget.hpp
new file mode 100644
index 0000000..78797c9
--- /dev/null
+++ b/bench/core_widget.hpp
@@ -0,0 +1,46 @@
+#ifndef LIB94_BENCH_CORE_WIDGET_HPP
+#define LIB94_BENCH_CORE_WIDGET_HPP
+
+#include <lib94/lib94.hpp>
+#include <gtkmm.h>
+
+class core_widget : public Gtk::Widget {
+public:
+ core_widget();
+ void clear_all();
+ void age_all();
+ void add_new_writes(const std::set<lib94::number_t> &writes);
+ void add_new_reads(const std::set<lib94::number_t> &reads);
+ void add_new_executions(const std::set<lib94::number_t> &executions);
+
+ void measure_vfunc(Gtk::Orientation orientation, int for_size, int &minimum, int &natural, int &minimum_baseline, int &natural_baseline) const override;
+ void snapshot_vfunc(const Glib::RefPtr<Gtk::Snapshot> &snapshot);
+
+ float age_scale;
+
+ std::chrono::nanoseconds last_draw_time;
+
+ std::mutex mut;
+
+private:
+ uint8_t write_values[LIB94_CORE_SIZE];
+ uint8_t read_values[LIB94_CORE_SIZE];
+ uint8_t execute_values[LIB94_CORE_SIZE];
+
+ std::set<lib94::number_t> to_draw_write;
+ std::set<lib94::number_t> to_draw_read;
+ std::set<lib94::number_t> to_draw_execute;
+
+ Glib::RefPtr<Gdk::Pixbuf> pixbuf;
+
+ int last_width;
+ int last_height;
+ int scale;
+ int cpr;
+ int xpad;
+ int ypad;
+
+ void draw(int width, int height);
+};
+
+#endif