Files
Renderive/Core/architecture/Plot_Render_Context.h
T
2026-08-02 14:20:27 +08:00

51 lines
1.4 KiB
C++

#pragma once
#include "Frame_Scheduler.h"
#include <atomic>
#include <cstdint>
#include <functional>
#include <memory>
#include <memory_resource>
#include <mutex>
#include <vector>
namespace renderive {
class Plot_Core;
class Timeline_Stream;
struct Frame_Lifecycle_Observer {
virtual ~Frame_Lifecycle_Observer() = default;
virtual bool enabled() const = 0;
virtual void collect_frame(std::shared_ptr<const Frame_Lifecycle_Record> frame) = 0;
};
struct Timeline_Stream_Snapshot;
struct Timeline_Stream_Cache_Item {
std::weak_ptr<Timeline_Stream> stream;
int time_point_size = 1;
int tick_space = 1;
bool start_coord_to_end_coord = false;
std::shared_ptr<const Timeline_Stream_Snapshot> snapshot;
};
struct Timeline_Stream_Frame_Cache {
std::vector<Timeline_Stream_Cache_Item> items;
};
struct Plot_Render_Context {
std::atomic_bool destroying{false};
std::atomic_bool first_resize{true};
std::atomic_bool first_prepare_data{true};
std::atomic_int render_width{0};
std::atomic_int render_height{0};
std::atomic<std::uint64_t> viewport_version{0};
std::atomic<std::uint32_t> background_rgba{0xff000000u};
std::shared_ptr<Frame_Lifecycle_Observer> frame_lifecycle_observer;
std::mutex performance_update_callback_mutex;
std::function<void()> performance_update_callback;
std::atomic<Plot_Core*> owner{};
};
} // namespace renderive
#include "../render/Render_Frame_Snapshot.h"