Changeset 53803 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Jan 14, 2015 1:53:30 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 97611
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp
r52805 r53803 3859 3859 3860 3860 ulong bytesPerPixel = bitsPerPixel/8; 3861 ulong displayWidth = bytesPerLine/bytesPerPixel; 3862 ulong displayHeight = size.height(); 3861 const QSize scaledSize = size.scaledSize(); 3862 const ulong displayWidth = scaledSize.isValid() ? scaledSize.width() : bytesPerLine / bytesPerPixel; 3863 const ulong displayHeight = scaledSize.isValid() ? scaledSize.height() : size.height(); 3863 3864 3864 3865 #ifdef VBOXQGL_DBG_SURF … … 4406 4407 } 4407 4408 4408 bool VBoxQGLOverlay::onNotifyUpdate(ULONG aX, ULONG aY, 4409 ULONG aW, ULONG aH) 4410 { 4409 bool VBoxQGLOverlay::onNotifyUpdate(ULONG uX, ULONG uY, 4410 ULONG uW, ULONG uH) 4411 { 4412 /* Prepare corresponding viewport part: */ 4413 QRect rect; 4414 4415 /* Take the scale-factor into account: */ 4416 const double dScaleFactor = mSizeInfo.scaleFactor(); 4417 if (dScaleFactor == 1.0) 4418 { 4419 /* Adjust corresponding viewport part: */ 4420 rect.moveTo(uX, uY); 4421 rect.setSize(QSize(uW, uH)); 4422 } 4423 else 4424 { 4425 /* Adjust corresponding viewport part: */ 4426 rect.moveTo(uX * dScaleFactor - 1, 4427 uY * dScaleFactor - 1); 4428 rect.setSize(QSize(uW * dScaleFactor + 2 * dScaleFactor + 1, 4429 uH * dScaleFactor + 2 * dScaleFactor + 1)); 4430 } 4431 4411 4432 /* we do not to miss notify updates, because we have to update bg textures for it, 4412 4433 * so no not check for m_fUnused here, 4413 4434 * mOverlay will store the required info for us */ 4414 QRect r(aX, aY, aW, aH);4415 mCmdPipe.postCmd(VBOXVHWA_PIPECMD_PAINT, &r); 4435 mCmdPipe.postCmd(VBOXVHWA_PIPECMD_PAINT, &rect); 4436 4416 4437 return true; 4417 4438 } -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.h
r52722 r53803 1341 1341 { 1342 1342 public: 1343 1343 1344 VBoxFBSizeInfo() {} 1344 template<class T> VBoxFBSizeInfo(T * fb) : 1345 mPixelFormat(fb->pixelFormat()), mVRAM(fb->address()), mBitsPerPixel(fb->bitsPerPixel()), 1346 mBytesPerLine(fb->bytesPerLine()), mWidth(fb->width()), mHeight(fb->height()), 1345 template<class T> VBoxFBSizeInfo(T *pFb) : 1346 mPixelFormat(pFb->pixelFormat()), mVRAM(pFb->address()), mBitsPerPixel(pFb->bitsPerPixel()), 1347 mBytesPerLine(pFb->bytesPerLine()), mWidth(pFb->width()), mHeight(pFb->height()), 1348 m_dScaleFactor(pFb->scaleFactor()), m_scaledSize(pFb->scaledSize()), 1347 1349 mUsesGuestVram(true) {} 1348 1350 1349 1351 VBoxFBSizeInfo(ulong aPixelFormat, uchar *aVRAM, 1350 1351 1352 1353 mPixelFormat (aPixelFormat), mVRAM (aVRAM), mBitsPerPixel(aBitsPerPixel),1354 mBytesPerLine (aBytesPerLine), mWidth (aWidth), mHeight(aHeight),1352 ulong aBitsPerPixel, ulong aBytesPerLine, 1353 ulong aWidth, ulong aHeight, 1354 bool bUsesGuestVram) : 1355 mPixelFormat(aPixelFormat), mVRAM(aVRAM), mBitsPerPixel(aBitsPerPixel), 1356 mBytesPerLine(aBytesPerLine), mWidth(aWidth), mHeight(aHeight), 1355 1357 mUsesGuestVram(bUsesGuestVram) {} 1358 1356 1359 ulong pixelFormat() const { return mPixelFormat; } 1357 1360 uchar *VRAM() const { return mVRAM; } … … 1360 1363 ulong width() const { return mWidth; } 1361 1364 ulong height() const { return mHeight; } 1365 double scaleFactor() const { return m_dScaleFactor; } 1366 QSize scaledSize() const { return m_scaledSize; } 1362 1367 bool usesGuestVram() const {return mUsesGuestVram;} 1363 1368 1364 1369 private: 1370 1365 1371 ulong mPixelFormat; 1366 1372 uchar *mVRAM; … … 1369 1375 ulong mWidth; 1370 1376 ulong mHeight; 1377 double m_dScaleFactor; 1378 QSize m_scaledSize; 1371 1379 bool mUsesGuestVram; 1372 1380 }; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.h
r53520 r53803 183 183 void unlock() const { RTCritSectLeave(&m_critSect); } 184 184 185 /** Returns host-to-guest scale ratio. */ 185 /** Returns the scale-factor used by the scaled-size. */ 186 double scaleFactor() const { return m_dScaleFactor; } 187 /** Returns the frame-buffer's scaled-size. */ 186 188 QSize scaledSize() const { return m_scaledSize; } 187 189 /** Defines host-to-guest scale ratio as @a size. */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r53499 r53803 357 357 /* Adjust frame-buffer, machine-window and guest-screen size if necessary: */ 358 358 sltHandleNotifyChange(frameBuffer()->width(), frameBuffer()->height()); 359 frameBuffer()->resizeEvent(frameBuffer()->width(), frameBuffer()->height()); 359 360 machineWindow()->normalizeGeometry(true /* adjust position */); 360 361 adjustGuestScreenSize(); … … 370 371 /* Adjust frame-buffer, machine-window and guest-screen size if necessary: */ 371 372 sltHandleNotifyChange(frameBuffer()->width(), frameBuffer()->height()); 373 frameBuffer()->resizeEvent(frameBuffer()->width(), frameBuffer()->height()); 372 374 machineWindow()->normalizeGeometry(true /* adjust position */); 373 375 adjustGuestScreenSize();
Note:
See TracChangeset
for help on using the changeset viewer.