13GX_CORE_NAMESPACE_BEGIN()
53class GxToolProfiler :
public GxToolBase
60 class GxGuiFormControlPanel;
61 class GxGuiFormProfilerFunction;
62 class GxGuiFormProfilerTree;
64 class GxGuiFormProfilerUnit;
70 GX_OPERATOR_NEW_DELETE(GxAllocatorList::ALLOCATOR_TYPE::DEVELOP)
88 static GX_CSTR ITEM_NAME[
static_cast<s32
>(ITEM_TYPE::MAX)];
90 static GX_CSTR ITEM_MESSAGE[
static_cast<s32
>(ITEM_TYPE::MAX)];
93 static constexpr u32 BODY_DRAW_WIDTH = 970;
95 static constexpr u32 BODY_DRAW_HEIGHT = 450;
97 static constexpr u32 TREE_DRAW_WIDTH = 180;
99 static constexpr u32 PANEL_DRAW_HEIGHT = 50;
101 static constexpr u32 FUNCTION_DRAW_WIDTH = 210;
103 static constexpr u32 BAR_DRAW_HEIGHT = 16;
105 static constexpr u32 ITEM_DRAW_WIDTH = 80;
107 static constexpr u32 PERCENT_DRAW_WIDTH = 36;
109 static constexpr u32 SPLITTER_WIDTH = 4;
111 static constexpr u32 DETAIL_DRAW_WIDTH = ITEM_DRAW_WIDTH *
static_cast<s32
>(ITEM_TYPE::MAX);
138 void setData(GxProfiler::GxLog* pLog, u32 backBufferIndex);
154 GxProfiler::GxLog* _pLog;
166 GxToolProfiler(
void );
169 void cleanup(
void )
override;
172 b32 initialize(
void )
override;
183 void eventTraceProfile(
b32 isCsv );
189 void toggleProfilerActive(
void );
192 void adjustDataByPrefix(GxProfiler::GxLogData& adjusted);
194 void adjustDataByPrefix(GxFunctionData& adjusted);
198 void update(
void)
override;
201 void onDoubleClick(
const GxPoint2& position, u32 button)
override;
204 void onViewMaxExpand(
void)
override;
207 void onViewMinExpand(
void)
override;
211 void adjustDataByPrefixSub(u32& average, u32& total, u32& min, u32& max);
214 void traceTree(GxProfiler::GxLog* pLog,
const u32 depth,
const u32 backBufferIndex,
b32 isTraceCsv);
217 void traceNode(GxProfiler::GxLog* pLog,
const u32 depth,
const u32 backBufferIndex,
b32 isTraceCsv);
226 GX_FORCE_INLINE
GxArrayClassBase& getArrayFunctionData(
void) {
return _arrayFunctionData; }
228 void addLogDataToArray(GxProfiler::GxLog* pLog, u32 backBufferIndex);
231 constexpr void setSelectItemNumber( s32 num ) { _selectItemNumber = num; }
233 constexpr s32 getSelectItemNumber(
void )
const {
return _selectItemNumber; }
235 constexpr void setTreeScrollOffsetY( s32 offset ) { _treeScrollOffsetYNew = offset; }
237 constexpr s32 getTreeScrollOffsetY(
void )
const {
return _treeScrollOffsetY; }
239 constexpr void setSelectedFunctionData( GxFunctionData* pData ) { _pSelectedFunctionData = pData; }
241 constexpr GxMath::PREFIX getPrefix(
void )
const {
return _prefix; }
243 constexpr GxGuiSplitter* getSplitterMain(
void)
const {
return _pSplitterMain; }
251 GxGuiSplitter* _pSplitterMain;
252 GxGuiFormProfilerFunction* _pProfilerFunction;
253 GxGuiFormProfilerTree* _pProfilerTree;
254 s32 _selectItemNumber;
255 s32 _treeScrollOffsetY;
256 s32 _treeScrollOffsetYNew;
260 GxFunctionData* _pSelectedFunctionData;
270class GxToolProfiler::GxGuiFormControlPanel :
public GxGuiForm
278 GX_RTTI_CLASS( GxToolProfiler::GxGuiFormControlPanel, GxGuiForm )
289 GxGuiFormControlPanel(
void );
292 GxGuiFormControlPanel( GxToolProfiler* pTool );
295 b32 initialize(
void )
override;
304 void update(
void )
override;
312 GxToolProfiler* _pTool;
313 GxGuiButton* _pButtonPlay;
321class GxToolProfiler::GxGuiFormProfilerFunction :
public GxGuiForm
329 GX_RTTI_CLASS( GxToolProfiler::GxGuiFormProfilerFunction, GxGuiForm )
340 GxGuiFormProfilerFunction(
void );
343 GxGuiFormProfilerFunction( GxToolProfiler* pTool );
346 b32 initialize(
void )
override;
355 void eventTraceProfile(
b32 isCsv );
359 void update(
void )
override;
362 void onDoubleClick(
const GxPoint2& position, u32 button )
override;
370 GxToolProfiler* _pTool;
371 GxGuiPropertyTable* _pGuiPropertyTable;
379class GxToolProfiler::GxGuiFormProfilerTree :
public GxGuiForm
386 class GxGuiFormWithHead;
389 class GxGuiDetailHead;
390 class GxGuiDetailBody;
393 GX_RTTI_CLASS( GxToolProfiler::GxGuiFormProfilerTree, GxGuiForm )
404 GxGuiFormProfilerTree(
void );
407 GxGuiFormProfilerTree( GxToolProfiler* pTool );
410 b32 initialize(
void )
override;
419 void showFunctionData( GxFunctionData* pSearchData );
421 b32 showFunctionDataTree( GxFunctionData* pSearchData, GxProfiler::GxLog* pLog );
423 u32 getNodeIndexFromName( GxFunctionData* pSearchData );
425 b32 getNodeIndexFromNameTree( GxFunctionData* pSearchData, GxProfiler::GxLog* pLog, u32& index );
429 void update(
void )
override;
433 GxGuiFormWithHead* createTreeForm(
void );
435 GxGuiFormWithHead* createDetailForm(
void );
443 GxToolProfiler* _pTool;
444 GxGuiSplitter* _pSplitter;
445 GxGuiFormWithHead* _pDetail;
453class GxToolProfiler::GxGuiFormProfilerTree::GxGuiFormWithHead :
public GxGuiForm
461 GX_RTTI_CLASS( GxToolProfiler::GxGuiFormProfilerTree::GxGuiFormWithHead, GxGuiForm )
472 GxGuiFormWithHead(
void );
475 GxGuiFormWithHead( GxGuiForm* pHead, GxGuiForm* pBody );
478 b32 initialize(
void )
override;
487 GxGuiForm* getBody(
void )
const {
return _pBody; }
496 void update(
void )
override;
506 GxGuiSplitter* _pSplitter;
514class GxToolProfiler::GxGuiFormProfilerTree::GxGuiTreeHead :
public GxGuiForm
522 GX_RTTI_CLASS( GxToolProfiler::GxGuiFormProfilerTree::GxGuiTreeHead, GxGuiForm )
533 GxGuiTreeHead( GxToolProfiler* pTool );
537 GxGuiTreeHead(
void ) : _pToolBody(nullptr){}
546 void onDraw(
void )
override;
554 GxToolProfiler* _pToolBody;
562class GxToolProfiler::GxGuiFormProfilerTree::GxGuiTreeBody :
public GxGuiForm
570 GX_RTTI_CLASS( GxToolProfiler::GxGuiFormProfilerTree::GxGuiTreeBody, GxGuiForm )
581 GxGuiTreeBody( GxToolProfiler* pTool );
585 GxGuiTreeBody(
void ) : _pToolBody(nullptr){}
594 void update(
void )
override;
597 void onClick(
const GxPoint2& position, u32 button )
override;
600 void onDraw(
void )
override;
603 void onMouseWheel(
const GxPoint2& position, s32 rotate )
override;
607 void drawTree( GxProfiler::GxLog* pLog,
const u32 depth,
GxRect& rect );
610 void drawNode( GxProfiler::GxLog* pLog,
const u32 depth,
GxRect& rect );
620 GxToolProfiler* _pToolBody;
630class GxToolProfiler::GxGuiFormProfilerTree::GxGuiDetailHead :
public GxGuiForm
638 GX_RTTI_CLASS( GxToolProfiler::GxGuiFormProfilerTree::GxGuiDetailHead, GxGuiForm )
649 GxGuiDetailHead( GxToolProfiler* pTool );
653 GxGuiDetailHead(
void ) : _pToolBody(nullptr){}
662 void onDraw(
void )
override;
665 void onMouseHover(
const GxPoint2& position )
override;
673 GxToolProfiler* _pToolBody;
681class GxToolProfiler::GxGuiFormProfilerTree::GxGuiDetailBody :
public GxGuiForm
689 GX_RTTI_CLASS( GxToolProfiler::GxGuiFormProfilerTree::GxGuiDetailBody, GxGuiForm )
700 GxGuiDetailBody( GxToolProfiler* pTool );
703 b32 initialize(
void )
override;
707 GxGuiDetailBody(
void ) : _pToolBody(nullptr){}
716 void update(
void )
override;
719 void onDraw(
void )
override;
722 void onClick(
const GxPoint2& position, u32 button )
override;
725 void onDoubleClick(
const GxPoint2& position, u32 button )
override;
728 void onKeyDown( GxKeyboard::KEY key )
override;
731 void onMouseWheel(
const GxPoint2& position, s32 rotate )
override;
735 void drawTree( GxProfiler::GxLog* pLog,
const u32 backBufferIndex,
GxRect& rect );
738 void drawNode( GxProfiler::GxLog* pLog,
const u32 backBufferIndex,
GxRect& rect );
741 void drawNodeSub(
const u32 value,
const GxColor& color,
GxRect& rect );
744 void createProfilerGraph( GxProfiler::GxLog* pLog, GxProfiler::GxLog* pTopLog , ITEM_TYPE type );
747 void updateArrayDataTree( GxProfiler::GxLog* pLog,
const u32 backBufferIndex );
755 s32 _oldScrollOffsetY;
757 s32 _doubleClickedIndex;
758 ITEM_TYPE _doubleClickedType;
759 GxToolProfiler* _pToolBody;
769class GxToolProfiler::GxToolGraph :
public GxGuiForm
777 GX_RTTI_CLASS_NAME( GxToolGraph, GxGuiForm,
"プロファイラグラフ" )
784 static constexpr u32 BODY_WIDTH = 220;
786 static constexpr u32 BODY_HEIGHT = 180;
788 static constexpr u32 PROFILE_MAX_COUNT = 2;
797 GxToolGraph( GxProfiler::GxLog* pLog , GxProfiler::GxLog* pTopLog , GxToolProfiler::ITEM_TYPE type );
800 b32 initialize(
void ) override;
804 GxToolGraph(
void ) : _type(ITEM_TYPE::PERCENT_TOTAL){}
813 void update(
void)
override;
817 GxProfiler::GxProfileBase* getProfilerFromLog(
void )
const;
819 u32 getValueFromType(
const GxProfiler::GxLogData* pLogData )
const;
828 GxProfiler::GxLog* _pLog;
829 GxProfiler::GxLog* _pTopLog;
830 GxGuiGraphTime* _pGraph;
832 u32 _plot[PROFILE_MAX_COUNT];
840class GxToolProfiler::GxGuiFormProfilerUnit :
public GxGuiForm
848 GX_RTTI_CLASS( GxToolProfiler::GxGuiFormProfilerUnit, GxGuiForm )
854 class GxGuiPropertyTableForProfilerUnit :
public GxGuiPropertyTable
861 GX_RTTI_CLASS(GxGuiPropertyTableForProfilerUnit, GxGuiPropertyTable)
872 GxGuiPropertyTableForProfilerUnit(
void){}
874 GxGuiPropertyTableForProfilerUnit(
const GxProperty& property,
GxTypedObject* pObject, u32 index = 0,
b32 useFilter =
false, TYPE type = TYPE::HORIZON,
b32 useIndex =
false )
875 : Super( property , pObject,index,useFilter,type,useIndex)
885 void update(
void )
override;
907 GxUnitInformation(
void){}
909 ~GxUnitInformation(
void)
override { initialize(); }
911 void initialize(
void);
922 u32 _totalPreAsyncTime;
924 u32 _totalPostAsyncTime;
925 u32 _totalSequentialTime;
926 u32 _totalForceAsyncTime;
928 u32 _averagePreAsyncTime;
929 u32 _averageAsyncTime;
930 u32 _averagePostAsyncTime;
931 u32 _averageSequentialTime;
932 u32 _averageForceAsyncTime;
934 u32 _convertTotalPreAsyncTime;
935 u32 _convertTotalAsyncTime;
936 u32 _convertTotalPostAsyncTime;
937 u32 _convertTotalSequentialTime;
938 u32 _convertTotalForceAsyncTime;
940 u32 _convertAveragePreAsyncTime;
941 u32 _convertAverageAsyncTime;
942 u32 _convertAveragePostAsyncTime;
943 u32 _convertAverageSequentialTime;
944 u32 _convertAverageForceAsyncTime;
956 GxGuiFormProfilerUnit(
void );
959 GxGuiFormProfilerUnit( GxToolProfiler* pTool );
962 void cleanup(
void )
override;
965 b32 initialize(
void )
override;
974 void update(
void )
override;
978 GxUnitInformation* getUnitInformation(
GxUnitBase* pUnitBase);
980 b32 checkEnableInformation(GxUnitInformation* pUnitInfo);
988 GxToolProfiler* _pTool;
989 GxGuiPropertyTable* _pGuiPropertyTable;
996GX_CORE_NAMESPACE_END()
#define GX_PROHIBIT_CLASS_BASE_REFERENCE(__CLASS__)
GxClassBaseReference継承の禁止宣言(new以外の生成禁止 + コピー禁止)
Definition GxBase.h:244
void GxTypedObject
その他
Definition GxDefine.h:213
メモリアロケータリスト
Definition GxAllocator.h:347
配列クラス
Definition GxArrayClassBase.h:18
オブジェクト基底クラス
Definition GxBase.h:88
PREFIX
単位接頭辞の定義
Definition GxMath.h:96
プロパティクラス
Definition GxProperty.h:48
プロパティテーブルクラス
Definition GxProperty.h:1641
実行時型情報クラス
Definition GxRtti.h:154
ユニット基礎クラス
Definition GxUnitBase.h:45
座標
Definition GxStruct.h:867
矩形
Definition GxStruct.h:951
文字列型クラス
Definition GxString.h:18
32bitブーリアン
Definition GxDefine.h:173