Changeset 10922 in vbox for trunk/src/VBox/Frontends/VirtualBox4
- Timestamp:
- Jul 28, 2008 8:10:03 PM (16 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox4/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxConsoleView.cpp
r10786 r10922 119 119 UInt32 eventKind = ::GetEventKind (inEvent); 120 120 /* For debugging events */ 121 /* 121 /* 122 122 if (!(eventClass == 'cute')) 123 123 ::darwinDebugPrintEvent ("view: ", inEvent); … … 163 163 164 164 /* For debugging events */ 165 /* 165 /* 166 166 if (!(eventClass == 'cute')) 167 167 ::darwinDebugPrintEvent ("view: ", inEvent); … … 1157 1157 } 1158 1158 1159 #if !defined (Q_WS_WIN) && !defined (Q_WS_PM) 1160 /* see VBox[QImage|SDL]FrameBuffer::NotifyUpdate(). */ 1159 /* See VBox[QImage|SDL]FrameBuffer::NotifyUpdate(). */ 1161 1160 case VBoxDefs::RepaintEventType: 1162 1161 { … … 1168 1167 return true; 1169 1168 } 1170 #endif1171 1169 1172 1170 case VBoxDefs::SetRegionEventType: … … 2684 2682 2685 2683 #ifdef Q_WS_MAC 2686 /* Simulate the right click on 2684 /* Simulate the right click on 2687 2685 * Host+Left Mouse */ 2688 2686 if (mIsHostkeyPressed && -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxFrameBuffer.cpp
r9495 r10922 316 316 BOOL *aFinished) 317 317 { 318 #if !defined (Q_WS_WIN) && !defined (Q_WS_PM) 319 /* we're not on the GUI thread and update() isn't thread safe in Qt 3.3.x320 on the Mac (4.2.x is), on Linux (didn't check Qt 4.x there) and321 probably on othernon-DOS platforms, so post the event instead. */318 /* We're not on the GUI thread and update() isn't thread safe in 319 * Qt 4.3.x on the Win, Qt 3.3.x on the Mac (4.2.x is), 320 * on Linux (didn't check Qt 4.x there) and probably on other 321 * non-DOS platforms, so post the event instead. */ 322 322 QApplication::postEvent (mView, 323 323 new VBoxRepaintEvent (aX, aY, aW, aH)); 324 #else 325 /* we're not on the GUI thread, so update() instead of repaint()! */ 326 mView->viewport()->update (aX - mView->contentsX(), 327 aY - mView->contentsY(), 328 aW, aH); 329 #endif 330 /* the update has been finished, return TRUE */ 324 325 /* The update has been finished, return TRUE */ 331 326 *aFinished = TRUE; 332 327 return S_OK; … … 335 330 void VBoxQImageFrameBuffer::paintEvent (QPaintEvent *pe) 336 331 { 337 const QRect &r = pe->rect().intersect (mView->viewport()->rect());338 339 /* some outdated rectangle during processing VBoxResizeEvent */332 const QRect &r = pe->rect().intersected (mView->viewport()->rect()); 333 334 /* Some outdated rectangle during processing VBoxResizeEvent */ 340 335 if (r.isEmpty()) 341 336 return; … … 349 344 FRAMEBUF_DEBUG_START (xxx); 350 345 351 /* In Qt4 there is not bitblt anymore. So352 * we create a qpainter object and paint on353 * that. Todo: Do some performance test. */354 //#warning port me: do it faster?355 346 QPainter painter (mView->viewport()); 356 painter.drawImage (r.x(), r.y(), mImg, 357 r.x() + mView->contentsX(), 358 r.y() + mView->contentsY(), 359 r.width(), r.height()); 360 // if (r.width() < mWdt * 2 / 3) 361 // { 362 // /* this method is faster for narrow updates */ 363 // mPM.convertFromImage (mImg.copy (r.x() + mView->contentsX(), 364 // r.y() + mView->contentsY(), 365 // r.width(), r.height())); 366 // ::bitBlt (mView->viewport(), r.x(), r.y(), 367 // &mPM, 0, 0, 368 // r.width(), r.height(), 369 // Qt::CopyROP, TRUE); 370 // } 371 // else 372 // { 373 // /* this method is faster for wide updates */ 374 // mPM.convertFromImage (QImage (mImg.scanLine (r.y() + mView->contentsY()), 375 // mImg.width(), r.height(), mImg.depth(), 376 // 0, 0, QImage::LittleEndian)); 377 // ::bitBlt (mView->viewport(), r.x(), r.y(), 378 // &mPM, r.x() + mView->contentsX(), 0, 379 // r.width(), r.height(), 380 // Qt::CopyROP, TRUE); 381 // } 347 348 if (r.width() < mWdt * 2 / 3) 349 { 350 /* This method is faster for narrow updates */ 351 mPM = QPixmap::fromImage (mImg.copy (r.x() + mView->contentsX(), 352 r.y() + mView->contentsY(), 353 r.width(), r.height())); 354 painter.drawPixmap (r.x(), r.y(), mPM); 355 } 356 else 357 { 358 /* This method is faster for wide updates */ 359 mPM = QPixmap::fromImage (QImage (mImg.scanLine (r.y() + mView->contentsY()), 360 mImg.width(), r.height(), mImg.bytesPerLine(), 361 QImage::Format_RGB32)); 362 painter.drawPixmap (r.x() + mView->contentsX(), r.y(), mPM); 363 } 382 364 383 365 FRAMEBUF_DEBUG_STOP (xxx, r.width(), r.height());
Note:
See TracChangeset
for help on using the changeset viewer.