Changeset 70680 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Jan 22, 2018 4:41:57 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r70627 r70680 255 255 if (machine().GetAccelerate3DEnabled() && vboxGlobal().is3DAvailable()) 256 256 { 257 double dScaleFactorFor3D = dScaleFactor; 258 #if defined(VBOX_WS_WIN) || defined(VBOX_WS_X11) 259 // WORKAROUND: 260 // On Windows and Linux opposing to macOS it's only Qt which can auto scale up, 261 // not 3D overlay itself, so for auto scale-up mode we have to take that into account. 262 if (!fUseUnscaledHiDPIOutput) 263 dScaleFactorFor3D *= frameBuffer()->devicePixelRatio(); 264 #endif /* VBOX_WS_WIN || VBOX_WS_X11 */ 257 265 display().NotifyScaleFactorChange(m_uScreenId, 258 (uint32_t)(dScaleFactor * VBOX_OGL_SCALE_FACTOR_MULTIPLIER),259 (uint32_t)(dScaleFactor * VBOX_OGL_SCALE_FACTOR_MULTIPLIER));266 (uint32_t)(dScaleFactorFor3D * VBOX_OGL_SCALE_FACTOR_MULTIPLIER), 267 (uint32_t)(dScaleFactorFor3D * VBOX_OGL_SCALE_FACTOR_MULTIPLIER)); 260 268 display().NotifyHiDPIOutputPolicyChange(fUseUnscaledHiDPIOutput); 261 269 } … … 487 495 /* Take the scale-factor into account: */ 488 496 const double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid()); 497 const bool fUseUnscaledHiDPIOutput = gEDataManager->useUnscaledHiDPIOutput(vboxGlobal().managedVMUuid()); 489 498 frameBuffer()->setScaleFactor(dScaleFactor); 490 499 /* Propagate the scale-factor to 3D service if necessary: */ 491 500 if (machine().GetAccelerate3DEnabled() && vboxGlobal().is3DAvailable()) 492 501 { 502 double dScaleFactorFor3D = dScaleFactor; 503 #if defined(VBOX_WS_WIN) || defined(VBOX_WS_X11) 504 // WORKAROUND: 505 // On Windows and Linux opposing to macOS it's only Qt which can auto scale up, 506 // not 3D overlay itself, so for auto scale-up mode we have to take that into account. 507 if (!fUseUnscaledHiDPIOutput) 508 dScaleFactorFor3D *= frameBuffer()->devicePixelRatio(); 509 #endif /* VBOX_WS_WIN || VBOX_WS_X11 */ 493 510 display().NotifyScaleFactorChange(m_uScreenId, 494 (uint32_t)(dScaleFactor * VBOX_OGL_SCALE_FACTOR_MULTIPLIER),495 (uint32_t)(dScaleFactor * VBOX_OGL_SCALE_FACTOR_MULTIPLIER));511 (uint32_t)(dScaleFactorFor3D * VBOX_OGL_SCALE_FACTOR_MULTIPLIER), 512 (uint32_t)(dScaleFactorFor3D * VBOX_OGL_SCALE_FACTOR_MULTIPLIER)); 496 513 } 497 514 … … 705 722 m_pFrameBuffer->setScalingOptimizationType(gEDataManager->scalingOptimizationType(vboxGlobal().managedVMUuid())); 706 723 707 /* Take device-pixel-ratio into account: */708 m_pFrameBuffer->setDevicePixelRatio(gpDesktop->devicePixelRatio(machineWindow()));709 710 724 /* Take the scale-factor related attributes into account: */ 725 const double dDevicePixelRatio = gpDesktop->devicePixelRatio(machineWindow()); 711 726 const double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid()); 712 727 const bool fUseUnscaledHiDPIOutput = gEDataManager->useUnscaledHiDPIOutput(vboxGlobal().managedVMUuid()); 728 m_pFrameBuffer->setDevicePixelRatio(dDevicePixelRatio); 713 729 m_pFrameBuffer->setScaleFactor(dScaleFactor); 714 730 m_pFrameBuffer->setUseUnscaledHiDPIOutput(fUseUnscaledHiDPIOutput); … … 716 732 if (machine().GetAccelerate3DEnabled() && vboxGlobal().is3DAvailable()) 717 733 { 734 double dScaleFactorFor3D = dScaleFactor; 735 #if defined(VBOX_WS_WIN) || defined(VBOX_WS_X11) 736 // WORKAROUND: 737 // On Windows and Linux opposing to macOS it's only Qt which can auto scale up, 738 // not 3D overlay itself, so for auto scale-up mode we have to take that into account. 739 if (!fUseUnscaledHiDPIOutput) 740 dScaleFactorFor3D *= dDevicePixelRatio; 741 #endif /* VBOX_WS_WIN || VBOX_WS_X11 */ 718 742 display().NotifyScaleFactorChange(m_uScreenId, 719 (uint32_t)(dScaleFactor * VBOX_OGL_SCALE_FACTOR_MULTIPLIER),720 (uint32_t)(dScaleFactor * VBOX_OGL_SCALE_FACTOR_MULTIPLIER));743 (uint32_t)(dScaleFactorFor3D * VBOX_OGL_SCALE_FACTOR_MULTIPLIER), 744 (uint32_t)(dScaleFactorFor3D * VBOX_OGL_SCALE_FACTOR_MULTIPLIER)); 721 745 display().NotifyHiDPIOutputPolicyChange(fUseUnscaledHiDPIOutput); 722 746 }
Note:
See TracChangeset
for help on using the changeset viewer.