Changeset 53964 in vbox
- Timestamp:
- Jan 26, 2015 7:04:59 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 97863
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp
r53823 r53964 53 53 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ 54 54 55 /* Other VBox includes: */ 55 56 #include <iprt/memcache.h> 56 57 #include <VBox/err.h> 57 58 58 59 59 #ifdef VBOX_WITH_VIDEOHWACCEL … … 61 61 # include <VBox/vmm/ssm.h> 62 62 #endif /* VBOX_WITH_VIDEOHWACCEL */ 63 64 /* Other includes: */ 65 #include <math.h> 66 63 67 64 68 #ifdef VBOXQGL_PROF_BASE … … 4415 4419 { 4416 4420 /* Prepare corresponding viewport part: */ 4417 QRect rect ;4418 4419 /* Take the scal e-factorinto account: */4421 QRect rect(uX, uY, uW, uH); 4422 4423 /* Take the scaling into account: */ 4420 4424 const double dScaleFactor = mSizeInfo.scaleFactor(); 4421 if (dScaleFactor == 1.0) 4422 { 4425 const QSize scaledSize = mSizeInfo.scaledSize(); 4426 if (scaledSize.isValid()) 4427 { 4428 /* Calculate corresponding scale-factors: */ 4429 const double xScaleFactor = mSizeInfo.visualState() == UIVisualStateType_Scale ? 4430 (double)scaledSize.width() / mSizeInfo.width() : dScaleFactor; 4431 const double yScaleFactor = mSizeInfo.visualState() == UIVisualStateType_Scale ? 4432 (double)scaledSize.height() / mSizeInfo.height() : dScaleFactor; 4423 4433 /* Adjust corresponding viewport part: */ 4424 rect.moveTo(uX, uY); 4425 rect.setSize(QSize(uW, uH)); 4426 } 4427 else 4428 { 4429 /* Adjust corresponding viewport part: */ 4430 rect.moveTo(uX * dScaleFactor - 1, 4431 uY * dScaleFactor - 1); 4432 rect.setSize(QSize(uW * dScaleFactor + 2 * dScaleFactor + 1, 4433 uH * dScaleFactor + 2 * dScaleFactor + 1)); 4434 rect.moveTo(floor((double)rect.x() * xScaleFactor) - 1, 4435 floor((double)rect.y() * yScaleFactor) - 1); 4436 rect.setSize(QSize(ceil((double)rect.width() * xScaleFactor) + 2, 4437 ceil((double)rect.height() * yScaleFactor) + 2)); 4434 4438 } 4435 4439 … … 4441 4445 if (dBackingScaleFactor > 1.0) 4442 4446 { 4443 rect.moveTo(rect.topLeft() / dBackingScaleFactor - QPoint(1, 1)); 4444 rect.setSize(rect.size() / dBackingScaleFactor + QSize(2, 2)); 4447 rect.moveTo(floor((double)rect.x() / dBackingScaleFactor) - 1, 4448 floor((double)rect.y() / dBackingScaleFactor) - 1); 4449 rect.setSize(QSize(ceil((double)rect.width() / dBackingScaleFactor) + 2, 4450 ceil((double)rect.height() / dBackingScaleFactor) + 2)); 4445 4451 } 4446 4452 } -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.h
r53823 r53964 1344 1344 VBoxFBSizeInfo() {} 1345 1345 template<class T> VBoxFBSizeInfo(T *pFb) : 1346 m_visualState(pFb->visualState()), 1346 1347 mPixelFormat(pFb->pixelFormat()), mVRAM(pFb->address()), mBitsPerPixel(pFb->bitsPerPixel()), 1347 1348 mBytesPerLine(pFb->bytesPerLine()), mWidth(pFb->width()), mHeight(pFb->height()), … … 1353 1354 ulong aWidth, ulong aHeight, 1354 1355 bool bUsesGuestVram) : 1356 m_visualState(UIVisualStateType_Invalid), 1355 1357 mPixelFormat(aPixelFormat), mVRAM(aVRAM), mBitsPerPixel(aBitsPerPixel), 1356 1358 mBytesPerLine(aBytesPerLine), mWidth(aWidth), mHeight(aHeight), … … 1358 1360 mUsesGuestVram(bUsesGuestVram) {} 1359 1361 1362 UIVisualStateType visualState() const { return m_visualState; } 1360 1363 ulong pixelFormat() const { return mPixelFormat; } 1361 1364 uchar *VRAM() const { return mVRAM; } … … 1371 1374 private: 1372 1375 1376 UIVisualStateType m_visualState; 1373 1377 ulong mPixelFormat; 1374 1378 uchar *mVRAM; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp
r53959 r53964 56 56 57 57 UIFrameBuffer::UIFrameBuffer() 58 : m_iWidth(0), m_iHeight(0) 58 : m_visualState(UIVisualStateType_Invalid) 59 , m_iWidth(0), m_iHeight(0) 59 60 , m_pMachineView(NULL) 60 61 , m_iWinId(0) … … 74 75 { 75 76 LogRel2(("UIFrameBuffer::init %p\n", this)); 77 78 /* Fetch visual-state: */ 79 m_visualState = pMachineView->visualStateType(); 76 80 77 81 /* Assign mahine-view: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.h
r53861 r53964 76 76 * @note Calls to this and any other EMT callback are synchronized (from GUI side). */ 77 77 void setMarkAsUnused(bool fUnused); 78 79 /** Returns the visual-state this frame-buffer created for. */ 80 UIVisualStateType visualState() const { return m_visualState; } 78 81 79 82 /** Returns whether frame-buffer is <b>auto-enabled</b>. … … 260 263 HiDPIOptimizationType hiDPIOptimizationType, 261 264 double dBackingScaleFactor); 265 266 /** Holds the visual-state this frame-buffer created for. */ 267 UIVisualStateType m_visualState; 262 268 263 269 /** Holds the QImage buffer. */
Note:
See TracChangeset
for help on using the changeset viewer.