Changeset 14056 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Nov 10, 2008 10:58:05 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 39112
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/Makefile.kmk
r13806 r14056 150 150 151 151 VirtualBox4_DEFS = VBOX_GUI_SEPARATE_VM_PROCESS 152 VirtualBox4_DEFS.debug = VBOX_ GUI_DEBUG VBOX_CHECK_STATE # QT_FATAL_ASSERT152 VirtualBox4_DEFS.debug = VBOX_CHECK_STATE # QT_FATAL_ASSERT 153 153 VirtualBox4_DEFS.darwin = VBOX_GUI_USE_QUARTZ2D VBOX_GUI_USE_QIMAGE VBOX_WITHOUT_QHTTP 154 154 VirtualBox4_DEFS.freebsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxDefs.h
r14046 r14056 33 33 #include <iprt/alloc.h> 34 34 35 #ifdef VBOX_GUI_DEBUG35 #ifdef DEBUG 36 36 37 37 #define AssertWrapperOk(w) \ … … 40 40 AssertMsg (w.isOk(), (#w ": " m " (RC=0x%08X)", w.lastRC())) 41 41 42 #else / / !VBOX_GUI_DEBUG42 #else /* #ifdef DEBUG */ 43 43 44 44 #define AssertWrapperOk(w) do {} while (0) 45 45 #define AssertWrapperOkMsg(w, m) do {} while (0) 46 46 47 #endif / / !VBOX_GUI_DEBUG47 #endif /* #ifdef DEBUG */ 48 48 49 49 #ifndef SIZEOF_ARRAY … … 62 62 #endif 63 63 #endif 64 65 /////////////////////////////////////////////////////////////////////////////66 67 #if defined (VBOX_GUI_DEBUG)68 69 #include <QThread>70 #include <QDateTime>71 72 #include <VBox/types.h> // for uint64_t type73 74 /**75 * A class to measure intervals using rdtsc instruction.76 */77 class VMCPUTimer : public QThread // for crossplatform msleep()78 {79 public:80 /* don't inline this function to not depend on iprt/asm.h here */81 static uint64_t ticks();82 inline static uint64_t msecs( uint64_t tcks ) {83 return tcks / ticks_per_msec;84 }85 inline static uint64_t msecsSince( uint64_t tcks ) {86 tcks = ticks() - tcks;87 return tcks / ticks_per_msec;88 }89 inline static void calibrate( int ms )90 {91 QTime t;92 uint64_t tcks = ticks();93 t.start();94 msleep( ms );95 tcks = ticks() - tcks;96 int msecs = t.elapsed();97 ticks_per_msec = tcks / msecs;98 }99 inline static uint64_t ticksPerMsec() {100 return ticks_per_msec;101 }102 private:103 static uint64_t ticks_per_msec;104 };105 106 #endif // VBOX_GUI_DEBUG107 64 108 65 /** Null UUID constant to be used as a default value for reference parameters */ -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxFrameBuffer.h
r12449 r14056 46 46 47 47 class VBoxConsoleView; 48 49 //#define VBOX_GUI_FRAMEBUF_STAT50 51 #if defined (VBOX_GUI_DEBUG) && defined (VBOX_GUI_FRAMEBUF_STAT)52 #define FRAMEBUF_DEBUG_START(prefix) \53 uint64_t prefix##elapsed = VMCPUTimer::ticks();54 #define FRAMEBUF_DEBUG_STOP(prefix,w,h) { \55 prefix##elapsed = VMCPUTimer::ticks() - prefix##elapsed; \56 V_DEBUG(( "Last update: %04d x %04d px, %03.3f ms, %.0f ticks", \57 (w), (h), \58 (double) prefix##elapsed / (double) VMCPUTimer::ticksPerMsec(), \59 (double) prefix##elapsed \60 )); \61 }62 #else63 #define FRAMEBUF_DEBUG_START(prefix) {}64 #define FRAMEBUF_DEBUG_STOP(prefix,w,h) {}65 #endif66 48 67 49 ///////////////////////////////////////////////////////////////////////////// -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxConsoleView.cpp
r14044 r14056 813 813 connect (QApplication::desktop(), SIGNAL (resized (int)), 814 814 this, SLOT (doResizeDesktop (int))); 815 816 #if defined (VBOX_GUI_DEBUG) && defined (VBOX_GUI_FRAMEBUF_STAT)817 VMCPUTimer::calibrate (200);818 #endif819 815 820 816 #if defined (Q_WS_WIN) -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxFrameBuffer.cpp
r12449 r14056 350 350 #endif 351 351 352 FRAMEBUF_DEBUG_START (xxx);353 354 352 QPainter painter (mView->viewport()); 355 353 … … 371 369 r.x() + mView->contentsX(), 0, 0, 0); 372 370 } 373 374 FRAMEBUF_DEBUG_STOP (xxx, r.width(), r.height());375 371 } 376 372 -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp
r13950 r14056 101 101 typedef long Q_LONG; /* word up to 64 bit signed */ 102 102 typedef unsigned long Q_ULONG; /* word up to 64 bit unsigned */ 103 #endif104 105 #if defined (VBOX_GUI_DEBUG)106 uint64_t VMCPUTimer::ticks_per_msec = (uint64_t) -1LL; // declared in VBoxDefs.h107 uint64_t VMCPUTimer::ticks()108 {109 return ASMReadTSC();110 }111 103 #endif 112 104
Note:
See TracChangeset
for help on using the changeset viewer.