[Bf-blender-cvs] [3734e0f7f9a] profiler-editor: add initial draw file

Jacques Lucke noreply at git.blender.org
Thu Apr 29 11:30:48 CEST 2021


Commit: 3734e0f7f9a8bf43ddd3d56f93f44b4175241b7d
Author: Jacques Lucke
Date:   Tue Apr 27 16:29:39 2021 +0200
Branches: profiler-editor
https://developer.blender.org/rB3734e0f7f9a8bf43ddd3d56f93f44b4175241b7d

add initial draw file

===================================================================

M	source/blender/editors/space_profiler/CMakeLists.txt
A	source/blender/editors/space_profiler/profiler_draw.cc
A	source/blender/editors/space_profiler/profiler_draw.hh
M	source/blender/editors/space_profiler/space_profiler.cc

===================================================================

diff --git a/source/blender/editors/space_profiler/CMakeLists.txt b/source/blender/editors/space_profiler/CMakeLists.txt
index 54c68917513..2d1962ae3ee 100644
--- a/source/blender/editors/space_profiler/CMakeLists.txt
+++ b/source/blender/editors/space_profiler/CMakeLists.txt
@@ -19,6 +19,7 @@ set(INC
   ../include
   ../../blenkernel
   ../../blenlib
+  ../../gpu
   ../../makesdna
   ../../makesrna
   ../../windowmanager
@@ -27,11 +28,13 @@ set(INC
 )
 
 set(SRC
+  profiler_draw.cc
   profiler_layout.cc
   profiler_profile.cc
   profiler_runtime.cc
   space_profiler.cc
 
+  profiler_draw.hh
   profiler_layout.hh
   profiler_runtime.hh
 )
diff --git a/source/blender/editors/space_profiler/profiler_draw.cc b/source/blender/editors/space_profiler/profiler_draw.cc
new file mode 100644
index 00000000000..8a496026092
--- /dev/null
+++ b/source/blender/editors/space_profiler/profiler_draw.cc
@@ -0,0 +1,43 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+#include "GPU_immediate.h"
+
+#include "DNA_screen_types.h"
+#include "DNA_space_types.h"
+#include "DNA_userdef_types.h"
+
+#include "BKE_context.h"
+
+#include "BLI_rect.h"
+
+#include "profiler_draw.hh"
+#include "profiler_runtime.hh"
+
+namespace blender::ed::profiler {
+
+void draw_profiler(const bContext *C, ARegion *region)
+{
+  SpaceProfiler *sprofiler = CTX_wm_space_profiler(C);
+
+  UI_ThemeClearColor(TH_BACK);
+}
+
+}  // namespace blender::ed::profiler
diff --git a/source/blender/editors/space_profiler/profiler_draw.hh b/source/blender/editors/space_profiler/profiler_draw.hh
new file mode 100644
index 00000000000..539dd0ab0dd
--- /dev/null
+++ b/source/blender/editors/space_profiler/profiler_draw.hh
@@ -0,0 +1,26 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#pragma once
+
+struct bContext;
+struct ARegion;
+
+namespace blender::ed::profiler {
+
+void draw_profiler(const struct bContext *C, struct ARegion *region);
+
+}
diff --git a/source/blender/editors/space_profiler/space_profiler.cc b/source/blender/editors/space_profiler/space_profiler.cc
index b540424f22e..7e736b464ca 100644
--- a/source/blender/editors/space_profiler/space_profiler.cc
+++ b/source/blender/editors/space_profiler/space_profiler.cc
@@ -37,6 +37,7 @@
 #include "WM_api.h"
 #include "WM_types.h"
 
+#include "profiler_draw.hh"
 #include "profiler_runtime.hh"
 
 static SpaceLink *profiler_create(const ScrArea *UNUSED(area), const Scene *UNUSED(scene))
@@ -90,9 +91,9 @@ static void profiler_main_region_init(wmWindowManager *UNUSED(wm), ARegion *UNUS
 {
 }
 
-static void profiler_main_region_draw(const bContext *UNUSED(C), ARegion *UNUSED(region))
+static void profiler_main_region_draw(const bContext *C, ARegion *region)
 {
-  UI_ThemeClearColor(TH_BACK);
+  blender::ed::profiler::draw_profiler(C, region);
 }
 
 static void profiler_main_region_listener(const wmRegionListenerParams *UNUSED(params))



More information about the Bf-blender-cvs mailing list