Skip to content

Commit 5efd5c1

Browse files
committed
make draw_crit_path_elements more generic, now it doesn't depend on Server module availability
1 parent 0a0d009 commit 5efd5c1

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

vpr/src/draw/draw.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ static void draw_main_canvas(ezgl::renderer* g) {
257257
#ifndef NO_SERVER
258258
if (g_vpr_ctx.server().gateIO().is_running()) {
259259
const ServerContext& server_ctx = g_vpr_ctx.server(); // shortcut
260-
draw_crit_path_elements(server_ctx.crit_paths(), server_ctx.crit_path_element_indexes(), g);
260+
draw_crit_path_elements(server_ctx.crit_paths(), server_ctx.crit_path_element_indexes(), server_ctx.draw_crit_path_contour(), g);
261261
} else {
262262
draw_crit_path(g);
263263
}

vpr/src/draw/draw_basic.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,11 +1109,9 @@ void draw_crit_path(ezgl::renderer* g) {
11091109
* This function draws critical path elements based on the provided timing paths
11101110
* and indexes map. It is primarily used in server mode, where items are drawn upon request.
11111111
*/
1112-
void draw_crit_path_elements(const std::vector<tatum::TimingPath>& paths, const std::map<std::size_t, std::set<std::size_t>>& indexes, ezgl::renderer* g) {
1113-
#ifndef NO_SERVER
1112+
void draw_crit_path_elements(const std::vector<tatum::TimingPath>& paths, const std::map<std::size_t, std::set<std::size_t>>& indexes, bool draw_crit_path_contour, ezgl::renderer* g) {
11141113
t_draw_state* draw_state = get_draw_state_vars();
11151114
const ezgl::color contour_color{0, 0, 0, 40};
1116-
const bool draw_crit_path_contour = g_vpr_ctx.server().draw_crit_path_contour();
11171115

11181116
auto draw_flyline_timing_edge_helper_fn = [](ezgl::renderer* renderer, const ezgl::color& color, ezgl::line_dash line_style, int line_width, float delay,
11191117
const tatum::NodeId& prev_node, const tatum::NodeId& node, bool skip_draw_delays=false) {
@@ -1178,7 +1176,6 @@ void draw_crit_path_elements(const std::vector<tatum::TimingPath>& paths, const
11781176
}
11791177
}
11801178
}
1181-
#endif /* NO_SERVER */
11821179
}
11831180

11841181
int get_timing_path_node_layer_num(tatum::NodeId node) {

vpr/src/draw/draw_basic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ void draw_crit_path(ezgl::renderer* g);
112112
* This function draws critical path elements based on the provided timing paths
113113
* and indexes map. It is primarily used in server mode, where items are drawn upon request.
114114
*/
115-
void draw_crit_path_elements(const std::vector<tatum::TimingPath>& paths, const std::map<std::size_t, std::set<std::size_t>>& indexes, ezgl::renderer* g);
115+
void draw_crit_path_elements(const std::vector<tatum::TimingPath>& paths, const std::map<std::size_t, std::set<std::size_t>>& indexes, bool draw_crit_path_contour, ezgl::renderer* g);
116116

117117
/**
118118
* @brief Checks whether a flyline should be drawn or not based on the layer control settings in the UI

0 commit comments

Comments
 (0)