diff --git a/qrenderdoc/Code/Interface/QRDInterface.h b/qrenderdoc/Code/Interface/QRDInterface.h index 22bf31aa0..b2dfc5b20 100644 --- a/qrenderdoc/Code/Interface/QRDInterface.h +++ b/qrenderdoc/Code/Interface/QRDInterface.h @@ -405,6 +405,22 @@ protected: DECLARE_REFLECTION_STRUCT(IStatisticsViewer); +DOCUMENT("The performance counter view window."); +struct IPerformanceCounterViewer +{ + DOCUMENT( + "Retrieves the QWidget for this :class:`PerformanceCounterViewer` if PySide2 is available, " + "or " + "``None``."); + virtual QWidget *Widget() = 0; + +protected: + IPerformanceCounterViewer() = default; + ~IPerformanceCounterViewer() = default; +}; + +DECLARE_REFLECTION_STRUCT(IPerformanceCounterViewer); + DOCUMENT("The interactive python shell."); struct IPythonShell { diff --git a/qrenderdoc/Windows/PerformanceCounterViewer.cpp b/qrenderdoc/Windows/PerformanceCounterViewer.cpp new file mode 100644 index 000000000..81b9db186 --- /dev/null +++ b/qrenderdoc/Windows/PerformanceCounterViewer.cpp @@ -0,0 +1,50 @@ +/****************************************************************************** +* The MIT License (MIT) +* +* Copyright (c) 2017 Baldur Karlsson +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +******************************************************************************/ + +#include "PerformanceCounterViewer.h" +#include "ui_PerformanceCounterViewer.h" + +PerformanceCounterViewer::PerformanceCounterViewer(ICaptureContext &ctx, QWidget *parent) + : QFrame(parent), ui(new Ui::PerformanceCounterViewer), m_Ctx(ctx) +{ + ui->setupUi(this); + + m_Ctx.AddLogViewer(this); +} + +PerformanceCounterViewer::~PerformanceCounterViewer() +{ + m_Ctx.BuiltinWindowClosed(this); + + m_Ctx.RemoveLogViewer(this); + delete ui; +} + +void PerformanceCounterViewer::OnLogfileClosed() +{ +} + +void PerformanceCounterViewer::OnLogfileLoaded() +{ +} \ No newline at end of file diff --git a/qrenderdoc/Windows/PerformanceCounterViewer.h b/qrenderdoc/Windows/PerformanceCounterViewer.h new file mode 100644 index 000000000..0b8ce97f4 --- /dev/null +++ b/qrenderdoc/Windows/PerformanceCounterViewer.h @@ -0,0 +1,53 @@ +/****************************************************************************** +* The MIT License (MIT) +* +* Copyright (c) 2017 Baldur Karlsson +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +******************************************************************************/ + +#pragma once + +#include +#include "Code/CaptureContext.h" + +namespace Ui +{ +class PerformanceCounterViewer; +} + +class PerformanceCounterViewer : public QFrame, public IPerformanceCounterViewer, public ILogViewer +{ + Q_OBJECT + +public: + explicit PerformanceCounterViewer(ICaptureContext &ctx, QWidget *parent = 0); + ~PerformanceCounterViewer(); + + // IStatisticsViewer + QWidget *Widget() override { return this; } + // ILogViewerForm + void OnLogfileLoaded() override; + void OnLogfileClosed() override; + void OnSelectedEventChanged(uint32_t eventID) override {} + void OnEventChanged(uint32_t eventID) override {} +private: + Ui::PerformanceCounterViewer *ui; + ICaptureContext &m_Ctx; +}; diff --git a/qrenderdoc/Windows/PerformanceCounterViewer.ui b/qrenderdoc/Windows/PerformanceCounterViewer.ui new file mode 100644 index 000000000..01afc89bb --- /dev/null +++ b/qrenderdoc/Windows/PerformanceCounterViewer.ui @@ -0,0 +1,68 @@ + + + PerformanceCounterViewer + + + + 0 + 0 + 320 + 240 + + + + Performance Counter viewer + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 3 + + + QLayout::SetDefaultConstraint + + + 6 + + + 6 + + + + + Capture counters + + + + + + + + + + + + + diff --git a/qrenderdoc/qrenderdoc.pro b/qrenderdoc/qrenderdoc.pro index a5a412317..a588af25a 100644 --- a/qrenderdoc/qrenderdoc.pro +++ b/qrenderdoc/qrenderdoc.pro @@ -217,7 +217,8 @@ SOURCES += Code/qrenderdoc.cpp \ Widgets/Extended/RDSplitter.cpp \ Windows/Dialogs/TipsDialog.cpp \ Windows/PythonShell.cpp \ - Windows/Dialogs/PerformanceCounterSelection.cpp + Windows/Dialogs/PerformanceCounterSelection.cpp \ + Windows/PerformanceCounterViewer.cpp HEADERS += Code/CaptureContext.h \ Code/qprocessinfo.h \ Code/ReplayManager.h \ @@ -282,7 +283,8 @@ HEADERS += Code/CaptureContext.h \ Widgets/Extended/RDSplitter.h \ Windows/Dialogs/TipsDialog.h \ Windows/PythonShell.h \ - Windows/Dialogs/PerformanceCounterSelection.h + Windows/Dialogs/PerformanceCounterSelection.h \ + Windows/PerformanceCounterViewer.h FORMS += Windows/Dialogs/AboutDialog.ui \ Windows/MainWindow.ui \ Windows/EventBrowser.ui \ @@ -314,7 +316,8 @@ FORMS += Windows/Dialogs/AboutDialog.ui \ Widgets/FindReplace.ui \ Windows/Dialogs/TipsDialog.ui \ Windows/PythonShell.ui \ - Windows/Dialogs/PerformanceCounterSelection.ui + Windows/Dialogs/PerformanceCounterSelection.ui \ + Windows/PerformanceCounterViewer.ui RESOURCES += Resources/resources.qrc diff --git a/qrenderdoc/qrenderdoc_local.vcxproj b/qrenderdoc/qrenderdoc_local.vcxproj index b1c95cc5c..b95b9f5ff 100644 --- a/qrenderdoc/qrenderdoc_local.vcxproj +++ b/qrenderdoc/qrenderdoc_local.vcxproj @@ -593,6 +593,7 @@ + @@ -709,6 +710,7 @@ + @@ -891,6 +893,7 @@ + @@ -1211,6 +1214,12 @@ MOC %(Filename).h $(IntDir)generated\moc_%(Filename).cpp + + %(Fullpath);$(ProjectDir)3rdparty\qt\$(Platform)\bin\moc.exe;%(AdditionalInputs) + $(ProjectDir)3rdparty\qt\$(Platform)\bin\moc.exe -DUNICODE -DWIN32 -DWIN64 -D_WIN32 -D_WIN64 -DRENDERDOC_PLATFORM_WIN32 -DSCINTILLA_QT=1 -DSCI_LEXER=1 -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -D_MSC_VER=1900 -I$(ProjectDir) -I$(SolutionDir)\renderdoc\api\replay -I$(ProjectDir)3rdparty\qt\$(Platform)\mkspecs/win32-msvc2015 -I$(ProjectDir)3rdparty\qt\$(Platform)\include -I$(ProjectDir)3rdparty\qt\$(Platform)\include\QtWidgets -I$(ProjectDir)3rdparty\qt\$(Platform)\include\QtGui -I$(ProjectDir)3rdparty\qt\$(Platform)\include\QtCore %(Fullpath) -o $(IntDir)generated\moc_%(Filename).cpp + MOC %(Filename).h + $(IntDir)generated\moc_%(Filename).cpp + %(Fullpath);$(ProjectDir)3rdparty\qt\$(Platform)\bin\moc.exe;%(AdditionalInputs) "$(ProjectDir)3rdparty\qt\$(Platform)\bin\moc.exe" -DUNICODE -DWIN32 -DWIN64 -D_WIN32 -D_WIN64 -DRENDERDOC_PLATFORM_WIN32 -DSCINTILLA_QT=1 -DSCI_LEXER=1 -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -D_MSC_VER=1900 -I"$(ProjectDir)." -I"$(SolutionDir)\renderdoc\api\replay" -I"$(ProjectDir)3rdparty\qt\$(Platform)\mkspecs/win32-msvc2015" -I"$(ProjectDir)3rdparty\qt\$(Platform)\include" -I"$(ProjectDir)3rdparty\qt\$(Platform)\include\QtWidgets" -I"$(ProjectDir)3rdparty\qt\$(Platform)\include\QtGui" -I"$(ProjectDir)3rdparty\qt\$(Platform)\include\QtCore" "%(Fullpath)" -o "$(IntDir)generated\moc_%(Filename).cpp" @@ -1417,6 +1426,12 @@ UIC %(Filename).ui $(IntDir)generated\ui_%(Filename).h + + %(Fullpath);$(ProjectDir)3rdparty\qt\$(Platform)\bin\uic.exe;%(AdditionalInputs) + $(ProjectDir)3rdparty\qt\$(Platform)\bin\uic.exe %(Fullpath) -o $(IntDir)generated\ui_%(Filename).h + UIC %(Filename).ui + $(IntDir)generated\ui_%(Filename).h + %(Fullpath);$(ProjectDir)3rdparty\qt\$(Platform)\bin\uic.exe;%(AdditionalInputs) "$(ProjectDir)3rdparty\qt\$(Platform)\bin\uic.exe" "%(Fullpath)" -o "$(IntDir)generated\ui_%(Filename).h" diff --git a/qrenderdoc/qrenderdoc_local.vcxproj.filters b/qrenderdoc/qrenderdoc_local.vcxproj.filters index df2e5b099..070b32956 100644 --- a/qrenderdoc/qrenderdoc_local.vcxproj.filters +++ b/qrenderdoc/qrenderdoc_local.vcxproj.filters @@ -654,6 +654,15 @@ Windows\Dialogs + + Windows + + + Generated Files + + + Generated Files + @@ -971,6 +980,12 @@ Windows\Dialogs + + Generated Files + + + Generated Files + @@ -1153,9 +1168,6 @@ Code\pyrenderdoc - - Windows\Dialogs - @@ -1454,5 +1466,17 @@ Styles\RDTweakedNativeStyle + + Windows\Dialogs + + + Windows\Dialogs + + + Windows + + + Windows + \ No newline at end of file