Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion frontend/app/components/trace_viewer_v2/application.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <stdlib.h>

#include <memory>
#include <tuple>

#include "absl/time/clock.h"
#include "absl/time/time.h"
Expand All @@ -27,6 +28,15 @@ const char* const kWindowTarget = EMSCRIPTEN_EVENT_TARGET_WINDOW;
const char* const kCanvasTarget = "#canvas";
constexpr float kScrollbarSize = 10.0f;

void ApplyDefaultTraceViewerStyles() {
ImGuiStyle& style = ImGui::GetStyle();
style.ScrollbarSize = kScrollbarSize;
style.WindowRounding = 0.0f;
style.WindowPadding = ImVec2(0.0f, 0.0f);
style.CellPadding = ImVec2(0.0f, 0.0f);
style.ItemSpacing = ImVec2(0.0f, 0.0f);
}

void ApplyLightTheme() {
ImGui::StyleColorsLight();
ImGuiStyle& style = ImGui::GetStyle();
Expand Down Expand Up @@ -57,7 +67,7 @@ void Application::Initialize() {
fonts::LoadFonts(initial_canvas_state.device_pixel_ratio());
// TODO: b/450584482 - Add a dark theme for the timeline.
ApplyLightTheme();
ImGui::GetStyle().ScrollbarSize = kScrollbarSize;
ApplyDefaultTraceViewerStyles();

// Initialize the platform
platform_ = std::make_unique<WGPURenderPlatform>();
Expand Down
8 changes: 0 additions & 8 deletions frontend/app/components/trace_viewer_v2/color/colors.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,6 @@ inline constexpr ImU32 kPurple70 = 0xFFFF97C5;
inline constexpr ImU32 kYellow90 = 0xFF7CE0FF;
// go/keep-sorted end

// Baseline palette:
// go/keep-sorted start
// Baseline Primary: #0B57D0
inline constexpr ImU32 kPrimary40 = 0xFFD0570B;
// Baseline Secondary: #C2E7FF
inline constexpr ImU32 kSecondary90 = 0xFFFFE7C2;
// go/keep-sorted end

} // namespace traceviewer

#endif // THIRD_PARTY_XPROF_FRONTEND_APP_COMPONENTS_TRACE_VIEWER_V2_COLOR_COLORS_H_
13 changes: 0 additions & 13 deletions frontend/app/components/trace_viewer_v2/timeline/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ cc_library(
],
deps = [
":constants",
":draw_utils",
":time_range",
"//third_party/dear_imgui",
"@com_google_absl//absl/base:nullability",
Expand Down Expand Up @@ -94,18 +93,6 @@ cc_library(
],
)

cc_library(
name = "draw_utils",
srcs = ["draw_utils.cc"],
hdrs = ["draw_utils.h"],
deps = [
":constants",
"//third_party/dear_imgui",
"@com_google_absl//absl/strings:string_view",
"@org_xprof//frontend/app/components/trace_viewer_v2/color:colors",
],
)

cc_test(
name = "data_provider_test",
srcs = ["data_provider_test.cc"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ void DataProvider::ProcessTraceEvents(const ParsedTraceEvents& parsed_events,
Timeline& timeline) {
if (parsed_events.flame_events.empty() &&
parsed_events.counter_events.empty()) {
timeline.set_timeline_data({});
timeline.SetTimelineData({});
timeline.set_data_time_range(TimeRange::Zero());
timeline.SetVisibleRange(TimeRange::Zero());
return;
Expand Down Expand Up @@ -372,7 +372,7 @@ void DataProvider::ProcessTraceEvents(const ParsedTraceEvents& parsed_events,
}
}

timeline.set_timeline_data(CreateTimelineData(trace_info, time_bounds));
timeline.SetTimelineData(CreateTimelineData(trace_info, time_bounds));

// Don't need to check for max_time because the TimeRange constructor will
// handle any potential issues with max_time.
Expand Down
138 changes: 0 additions & 138 deletions frontend/app/components/trace_viewer_v2/timeline/draw_utils.cc

This file was deleted.

13 changes: 0 additions & 13 deletions frontend/app/components/trace_viewer_v2/timeline/draw_utils.h

This file was deleted.

Loading