Skip to content
Merged
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
1 change: 0 additions & 1 deletion dive_core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ add_library(
command_hierarchy.h
common.cpp
common.h
context.h
conversions.h
cross_ref.h
data_core.cpp
Expand Down
4 changes: 4 additions & 0 deletions src/dive/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ add_subdirectory(os)
add_subdirectory(plugin)
add_subdirectory(utils)
add_subdirectory(common)

if(NOT ANDROID)
add_subdirectory(ui)
endif()
File renamed without changes.
46 changes: 46 additions & 0 deletions src/dive/ui/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)

find_package(Qt5 COMPONENTS Core Gui Widgets REQUIRED)

add_library(
dive_lib_ui
# Header Only:
forward.h
types/context.h
types/file_path.h
types/impl_pointer.h
utils/debug_utils.h
# Sources:
components/overlay/overlay.cpp
components/overlay/overlay.h
components/settings/settings.cpp
components/settings/settings.h
)

target_link_libraries(
dive_lib_ui
PUBLIC
# Dive dependencies
dive_src_includes
# External dependencies
absl::core_headers
Qt5::Widgets
)
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
limitations under the License.
*/

#include "overlay.h"
#include "dive/ui/components/overlay/overlay.h"

#include <QDateTime>
#include <QElapsedTimer>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
#include "settings.h"
#include "dive/ui/components/settings/settings.h"

#include <QCoreApplication>
#include <QDir>
#include <QSettings>

#include "dive_core/common.h"
#include "dive/ui/macros.h"

//--------------------------------------------------------------------------------------------------
Settings* Settings::Get()
Expand Down Expand Up @@ -115,4 +115,4 @@ void Settings::WriteEventListDisplayUnit(DisplayUnit display_unit)
{
QSettings settings;
settings.setValue("eventListDisplayUnit", display_unit);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

#pragma once

#include <stdint.h>

#include <QString>
Expand Down
23 changes: 23 additions & 0 deletions src/dive/ui/macros.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
Copyright 2025 Google LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

#pragma once

#include "absl/base/macros.h"

#ifndef DIVE_ASSERT
#define DIVE_ASSERT(x) ABSL_ASSERT(x)
#endif
2 changes: 1 addition & 1 deletion ui/context.h → src/dive/ui/types/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include <QMetaType>

#include "dive_core/context.h" // IWYU pragma: export
#include "dive/types/context.h" // IWYU pragma: export

// qRegisterMetaType in custom_metatypes.cpp
Q_DECLARE_METATYPE(Dive::Context)
2 changes: 1 addition & 1 deletion ui/file_path.h → src/dive/ui/types/file_path.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <QString>
#include <filesystem>

#include "utils/component_files.h"
#include "dive/utils/component_files.h"

namespace Dive
{
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion trace_stats/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

add_library(dive_lib_trace_stats "trace_stats.cpp" "trace_stats.h")
target_link_libraries(dive_lib_trace_stats PUBLIC dive_core)
target_link_libraries(dive_lib_trace_stats PUBLIC dive_core dive_src_includes)
target_include_directories(
dive_lib_trace_stats
PUBLIC ${THIRDPARTY_DIRECTORY}/Vulkan-Headers/include ${CMAKE_SOURCE_DIR}
Expand Down
2 changes: 1 addition & 1 deletion trace_stats/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <sstream>
#include <vector>

#include "dive_core/context.h"
#include "dive/types/context.h"
#include "dive_core/data_core.h"
#include "pm4_info.h"
#include "trace_stats.h"
Expand Down
2 changes: 1 addition & 1 deletion trace_stats/trace_stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#include <set>
#include <vector>

#include "dive/types/context.h"
#include "dive_core/capture_event_info.h"
#include "dive_core/context.h"
#include "dive_core/data_core.h"
#include "vulkan/vulkan_core.h"

Expand Down
9 changes: 1 addition & 8 deletions ui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,8 @@ add_executable(
command_model.h
command_tab_view.cpp
command_tab_view.h
context.h
custom_metatypes.cpp
custom_metatypes.h
debug_utils.h
dive_tree_view.cpp
dive_tree_view.h
draw_dispatch_stats_model.cpp
Expand All @@ -102,7 +100,6 @@ add_executable(
event_selection_model.h
event_state_view.cpp
event_state_view.h
file_path.h
frame_tab_view.cpp
frame_tab_view.h
gfxr_capture_worker.cpp
Expand All @@ -124,7 +121,6 @@ add_executable(
gui_constants.h
hover_help_model.cpp
hover_help_model.h
impl_pointer.h
main_window.cpp
main_window.h
misc_stats_model.cpp
Expand All @@ -134,8 +130,6 @@ add_executable(
most_expensive_events_view.cpp
most_expensive_events_view.h
object_names.h
overlay.cpp
overlay.h
overview_tab_view.cpp
overview_tab_view.h
package_filter.cpp
Expand All @@ -154,8 +148,6 @@ add_executable(
search_bar.h
search_dialog.cpp
search_dialog.h
settings.cpp
settings.h
shader_text_view.cpp
shader_text_view.h
shader_view.cpp
Expand Down Expand Up @@ -233,6 +225,7 @@ target_link_libraries(
network
dive_core
dive_lib_os
dive_lib_ui
device_mgr
dive_plugin_loader
component_files
Expand Down
12 changes: 6 additions & 6 deletions ui/analyze_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@

#include "analyze_window.h"

#include <qapplication.h>
#include <qtemporarydir.h>

#include <QApplication>
#include <QCheckBox>
#include <QComboBox>
#include <QDebug>
Expand All @@ -34,6 +32,7 @@
#include <QSpinBox>
#include <QStandardItem>
#include <QStandardItemModel>
#include <QTemporaryDir>
#include <QTextEdit>
#include <QVBoxLayout>
#include <filesystem>
Expand All @@ -46,9 +45,10 @@
#include "application_controller.h"
#include "capture_service/constants.h"
#include "capture_service/device_mgr.h"
#include "common/macros.h"
#include "overlay.h"
#include "settings.h"
#include "dive/common/macros.h"
#include "dive/ui/components/overlay/overlay.h"
#include "dive/ui/components/settings/settings.h"
#include "ui/application_controller.h"

//--------------------------------------------------------------------------------------------------
void AttemptDeletingTemporaryLocalFile(const std::filesystem::path& file_path)
Expand Down
2 changes: 1 addition & 1 deletion ui/application_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include <QObject>

#include "impl_pointer.h"
#include "dive/ui/types/impl_pointer.h"

class MainWindow;

Expand Down
6 changes: 3 additions & 3 deletions ui/capture_file_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
#include <memory>
#include <optional>

#include "debug_utils.h"
#include "dive_core/context.h"
#include "dive/ui/types/context.h"
#include "dive/ui/types/file_path.h"
#include "dive/ui/utils/debug_utils.h"
#include "dive_core/data_core.h"
#include "file_path.h"
#include "trace_stats/trace_stats.h"

namespace
Expand Down
4 changes: 2 additions & 2 deletions ui/capture_file_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#include <QReadWriteLock>
#include <memory>

#include "context.h"
#include "file_path.h"
#include "dive/ui/types/context.h"
#include "dive/ui/types/file_path.h"

class QThread;
namespace Dive
Expand Down
6 changes: 3 additions & 3 deletions ui/custom_metatypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

#include <QMetaType>

#include "capture_file_manager.h"
#include "context.h"
#include "file_path.h"
#include "dive/ui/types/context.h"
#include "dive/ui/types/file_path.h"
#include "ui/capture_file_manager.h"

namespace Dive
{
Expand Down
6 changes: 3 additions & 3 deletions ui/main_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@
#include "absl/status/statusor.h"
#include "absl/types/span.h"
#include "capture_service/constants.h"
#include "dive/ui/components/overlay/overlay.h"
#include "dive/ui/components/settings/settings.h"
#include "dive/ui/types/file_path.h"
#include "dive/utils/device_resources.h"
#include "dive/utils/device_resources_constants.h"
#include "dive_core/command_hierarchy.h"
Expand All @@ -74,7 +77,6 @@
#include "ui/error_dialog.h"
#include "ui/event_selection_model.h"
#include "ui/event_state_view.h"
#include "ui/file_path.h"
#include "ui/frame_tab_view.h"
#include "ui/gfxr_vulkan_command_arguments_filter_proxy_model.h"
#include "ui/gfxr_vulkan_command_arguments_tab_view.h"
Expand All @@ -85,13 +87,11 @@
#include "ui/gpu_timing_tab_view.h"
#include "ui/hover_help_model.h"
#include "ui/object_names.h"
#include "ui/overlay.h"
#include "ui/overview_tab_view.h"
#include "ui/perf_counter_model.h"
#include "ui/perf_counter_tab_view.h"
#include "ui/property_panel.h"
#include "ui/search_bar.h"
#include "ui/settings.h"
#include "ui/shader_view.h"
#include "ui/shortcuts.h"
#include "ui/shortcuts_window.h"
Expand Down
8 changes: 4 additions & 4 deletions ui/most_expensive_events_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
#include "most_expensive_events_view.h"
#include "ui/most_expensive_events_view.h"

#include <QAction>
#include <QHeaderView>
Expand All @@ -25,11 +25,11 @@
#include <QTreeWidget>
#include <QVBoxLayout>

#include "dive/ui/components/settings/settings.h"
#include "dive_core/conversions.h"
#include "dive_core/data_core.h"
#include "gui_constants.h"
#include "hover_help_model.h"
#include "settings.h"
#include "ui/gui_constants.h"
#include "ui/hover_help_model.h"

const uint32_t kDurationColumn = 2;
const uint32_t kOccupancyDurationColumn = 3;
Expand Down
3 changes: 2 additions & 1 deletion ui/sqtt/ruler_graphics_item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@
limitations under the License.
*/

#include "ruler_graphics_item.h"
#include "ui/sqtt/ruler_graphics_item.h"

#include <QGraphicsSceneContextMenuEvent>
#include <QMenu>
#include <QPainter>
#include <QTextStream>
#include <QTransform>

#include "dive/ui/components/settings/settings.h"
#include "dive_core/common.h"
#include "dive_core/conversions.h"

Expand Down
4 changes: 1 addition & 3 deletions ui/sqtt/ruler_graphics_item.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
#pragma once
#include <QGraphicsItem>

#include "settings.h"

#define RULER_FONT_HEIGHT 9

class RulerGraphicsItem : public QGraphicsItem
Expand Down Expand Up @@ -73,4 +71,4 @@ class RulerGraphicsItem : public QGraphicsItem

// Each major tick step, in whatever unit is enabled
double m_text_step;
};
};
Loading