升级
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
#include "Plottable_Real_Time_Data.h"
|
||||
#include "../renderable/Render_Partition.h"
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <deque>
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
@@ -98,17 +97,23 @@ void Waterfall_Control::publish() {
|
||||
}
|
||||
|
||||
void Waterfall_Control::build_paint_task_graph(Renderable_Task_Graph& graph) {
|
||||
const auto prepare = graph.emplace([this](const Scene_Render_Context&) {
|
||||
prepare_render_frame(render_state_view());
|
||||
auto& output = impl_->render_frame;
|
||||
const int partition_count = output.partitioner.graph_partition_count(
|
||||
render_properties(render_state_view()).partition_count.get(),
|
||||
static_cast<int>(Scene_Base::task_executor_worker_count()));
|
||||
const auto prepare = graph.emplace([this, partition_count](const Scene_Render_Context&) {
|
||||
prepare_render_frame(render_state_view(), partition_count);
|
||||
}, "prepare waterfall");
|
||||
std::array<Renderable_Task_Graph::Task, maximum_render_partitions> partitions;
|
||||
for (int index = 0; index < maximum_render_partitions; ++index) {
|
||||
partitions[static_cast<std::size_t>(index)] = graph.emplace(
|
||||
std::vector<Renderable_Task_Graph::Task> partitions;
|
||||
partitions.reserve(static_cast<std::size_t>(partition_count));
|
||||
for (int index = 0; index < partition_count; ++index) {
|
||||
const auto partition = graph.emplace(
|
||||
[this, index](const Scene_Render_Context&) {
|
||||
render_partition(render_state_view(), index);
|
||||
},
|
||||
"raster waterfall partition");
|
||||
graph.precede(prepare, partitions[static_cast<std::size_t>(index)]);
|
||||
"raster waterfall partition " + std::to_string(index + 1));
|
||||
graph.precede(prepare, partition);
|
||||
partitions.push_back(partition);
|
||||
}
|
||||
const auto compose = add_paint_task(
|
||||
graph, "compose waterfall",
|
||||
@@ -117,7 +122,8 @@ void Waterfall_Control::build_paint_task_graph(Renderable_Task_Graph& graph) {
|
||||
graph.precede(partition, compose);
|
||||
}
|
||||
|
||||
void Waterfall_Control::prepare_render_frame(const Render_State_View& view) {
|
||||
void Waterfall_Control::prepare_render_frame(const Render_State_View& view,
|
||||
int graph_partition_count) {
|
||||
const auto& state = render_properties(view);
|
||||
const auto& rows = view.get(impl_->rows);
|
||||
auto& output = impl_->render_frame;
|
||||
@@ -150,8 +156,8 @@ void Waterfall_Control::prepare_render_frame(const Render_State_View& view) {
|
||||
output.source_height = height;
|
||||
output.work_size = static_cast<std::size_t>(width) * height;
|
||||
output.pixels.resize(output.work_size);
|
||||
output.active_partitions =
|
||||
output.partitioner.begin(state.partition_count.get(), output.work_size);
|
||||
output.active_partitions = output.partitioner.begin(graph_partition_count,
|
||||
output.work_size);
|
||||
output.valid = true;
|
||||
}
|
||||
|
||||
@@ -181,7 +187,11 @@ void Waterfall_Control::paint(Painter& painter, const Render_State_View& view) {
|
||||
return;
|
||||
painter.heatmap(output.layout.target, output.layout.width, output.layout.height,
|
||||
output.pixels, state.interpolation_mode);
|
||||
output.partitioner.finish(output.work_size);
|
||||
if (output.partitioner.finish(
|
||||
state.partition_count.get(), output.active_partitions,
|
||||
static_cast<int>(Scene_Base::task_executor_worker_count()),
|
||||
output.work_size))
|
||||
task_graph_changed();
|
||||
if(state.tooltip_enabled && interaction.tooltip.active && output.layout.target.contains(interaction.tooltip.position)) {
|
||||
const Axis_Transform frequency_axis = impl_->frequency_axis->transform(view);
|
||||
const double frequency = frequency_axis.point_to_coord(interaction.tooltip.position);
|
||||
|
||||
Reference in New Issue
Block a user