Ver código fonte

pstats for windows

David Rose 22 anos atrás
pai
commit
5ede98f8d4

+ 3 - 0
panda/src/dxgsg7/wdxGraphicsWindow7.cxx

@@ -21,6 +21,7 @@
 #include "config_windisplay.h"
 #include "wdxGraphicsPipe7.h"
 #include "dxGraphicsStateGuardian7.h"
+#include "pStatTimer.h"
 
 #include <wingdi.h>
 
@@ -135,6 +136,8 @@ wdxGraphicsWindow7::
 
 void wdxGraphicsWindow7::
 make_current(void) {
+  PStatTimer timer(_make_current_pcollector);
+
   DXGraphicsStateGuardian7 *dxgsg;
   DCAST_INTO_V(dxgsg, _gsg);
   //wglMakeCurrent(_hdc, wdxgsg->_context);

+ 2 - 3
panda/src/dxgsg8/wdxGraphicsWindow8.cxx

@@ -28,10 +28,7 @@
 #include "keyboardButton.h"
 #include "mouseButton.h"
 #include "throw_event.h"
-
-#ifdef DO_PSTATS
 #include "pStatTimer.h"
-#endif
 
 #include <ddraw.h>
 #include <map>
@@ -98,6 +95,8 @@ wdxGraphicsWindow8::
 
 void wdxGraphicsWindow8::
 make_current(void) {
+  PStatTimer timer(_make_current_pcollector);
+
   DXGraphicsStateGuardian8 *dxgsg;
   DCAST_INTO_V(dxgsg, _gsg);
   //wglMakeCurrent(_hdc, wdxgsg->_context);

+ 3 - 3
panda/src/dxgsg9/wdxGraphicsWindow9.cxx

@@ -28,10 +28,8 @@
 #include "keyboardButton.h"
 #include "mouseButton.h"
 #include "throw_event.h"
-
-#ifdef DO_PSTATS
 #include "pStatTimer.h"
-#endif
+
 
 #include <ddraw.h>
 #include <map>
@@ -98,6 +96,8 @@ wdxGraphicsWindow9::
 
 void wdxGraphicsWindow9::
 make_current(void) {
+  PStatTimer timer(_make_current_pcollector);
+
   DXGraphicsStateGuardian9 *dxgsg;
   DCAST_INTO_V(dxgsg, _gsg);
   //wglMakeCurrent(_hdc, wdxgsg->_context);

+ 3 - 2
panda/src/wgldisplay/wglGraphicsBuffer.cxx

@@ -18,9 +18,8 @@
 
 #include "wglGraphicsBuffer.h"
 #include "config_wgldisplay.h"
-#include "wglGraphicsPipe.h"
 #include "glgsg.h"
-#include "frameBufferProperties.h"
+#include "pStatTimer.h"
 
 #include <wingdi.h>
 
@@ -94,6 +93,8 @@ begin_frame() {
 ////////////////////////////////////////////////////////////////////
 void wglGraphicsBuffer::
 make_current() {
+  PStatTimer timer(_make_current_pcollector);
+
   wglGraphicsStateGuardian *wglgsg;
   DCAST_INTO_V(wglgsg, _gsg);
 

+ 3 - 0
panda/src/wgldisplay/wglGraphicsWindow.cxx

@@ -20,6 +20,7 @@
 #include "config_wgldisplay.h"
 #include "config_windisplay.h"
 #include "wglGraphicsPipe.h"
+#include "pStatTimer.h"
 #include "glgsg.h"
 
 #include <wingdi.h>
@@ -155,6 +156,8 @@ wglGraphicsWindow::
 ////////////////////////////////////////////////////////////////////
 void wglGraphicsWindow::
 make_current() {
+  PStatTimer timer(_make_current_pcollector);
+
   wglGraphicsStateGuardian *wglgsg;
   DCAST_INTO_V(wglgsg, _gsg);
   wglMakeCurrent(_hdc, wglgsg->get_context(_hdc));