Changeset 54603 in vbox for trunk/src/VBox
- Timestamp:
- Mar 3, 2015 5:30:55 PM (10 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r54590 r54603 173 173 void UIMachineView::applyMachineViewScaleFactor() 174 174 { 175 /* Take the scale-factor into account: */175 /* Take the scale-factor related attributes into account: */ 176 176 const double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid()); 177 const bool fUseUnscaledHiDPIOutput = gEDataManager->useUnscaledHiDPIOutput(vboxGlobal().managedVMUuid()); 177 178 frameBuffer()->setScaleFactor(dScaleFactor); 178 /* Propagate scale-factor to 3D service if necessary: */ 179 frameBuffer()->setUseUnscaledHiDPIOutput(fUseUnscaledHiDPIOutput); 180 /* Propagate the scale-factor related attributes to 3D service if necessary: */ 179 181 if (machine().GetAccelerate3DEnabled() && vboxGlobal().is3DAvailable()) 180 182 { … … 182 184 (uint32_t)(dScaleFactor * VBOX_OGL_SCALE_FACTOR_MULTIPLIER), 183 185 (uint32_t)(dScaleFactor * VBOX_OGL_SCALE_FACTOR_MULTIPLIER)); 184 } 185 186 /* Take unscaled HiDPI output mode into account: */ 187 const bool fUseUnscaledHiDPIOutput = gEDataManager->useUnscaledHiDPIOutput(vboxGlobal().managedVMUuid()); 188 frameBuffer()->setUseUnscaledHiDPIOutput(fUseUnscaledHiDPIOutput); 186 display().NotifyHiDPIOutputPolicyChange(fUseUnscaledHiDPIOutput); 187 } 189 188 190 189 /* Perform frame-buffer rescaling: */ 191 190 frameBuffer()->performRescale(); 191 192 // TODO: How to make it work? 193 display().ViewportChanged(screenId(), contentsX(), contentsY(), visibleWidth(), visibleHeight()); 192 194 } 193 195 … … 367 369 const double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid()); 368 370 frameBuffer()->setScaleFactor(dScaleFactor); 369 /* Propagate scale-factor to 3D service if necessary: */371 /* Propagate the scale-factor to 3D service if necessary: */ 370 372 if (machine().GetAccelerate3DEnabled() && vboxGlobal().is3DAvailable()) 371 373 { … … 383 385 updateScaledPausePixmap(); 384 386 viewport()->update(); 387 388 // TODO: How to make it work? 389 display().ViewportChanged(screenId(), contentsX(), contentsY(), visibleWidth(), visibleHeight()); 385 390 } 386 391 … … 391 396 return; 392 397 393 /* Take unscaled HiDPI output mode into account: */398 /* Take the unscaled HiDPI output mode into account: */ 394 399 const bool fUseUnscaledHiDPIOutput = gEDataManager->useUnscaledHiDPIOutput(vboxGlobal().managedVMUuid()); 395 400 frameBuffer()->setUseUnscaledHiDPIOutput(fUseUnscaledHiDPIOutput); 401 /* Propagate the unscaled HiDPI output mode to 3D service if necessary: */ 402 if (machine().GetAccelerate3DEnabled() && vboxGlobal().is3DAvailable()) 403 { 404 display().NotifyHiDPIOutputPolicyChange(fUseUnscaledHiDPIOutput); 405 } 396 406 397 407 /* Handle scale attributes change: */ … … 403 413 updateScaledPausePixmap(); 404 414 viewport()->update(); 415 416 // TODO: How to make it work? 417 display().ViewportChanged(screenId(), contentsX(), contentsY(), visibleWidth(), visibleHeight()); 405 418 } 406 419 … … 539 552 m_pFrameBuffer->setHiDPIOptimizationType(uisession()->hiDPIOptimizationType()); 540 553 541 /* Take scale-factor into account: */542 const double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid());543 m_pFrameBuffer->setScaleFactor(dScaleFactor);544 /* Propagate scale-factor to 3D service if necessary: */545 if (machine().GetAccelerate3DEnabled() && vboxGlobal().is3DAvailable())546 {547 display().NotifyScaleFactorChange(m_uScreenId,548 (uint32_t)(dScaleFactor * VBOX_OGL_SCALE_FACTOR_MULTIPLIER),549 (uint32_t)(dScaleFactor * VBOX_OGL_SCALE_FACTOR_MULTIPLIER));550 }551 552 554 #ifdef Q_WS_MAC 553 555 /* Take backing scale-factor into account: */ … … 555 557 #endif /* Q_WS_MAC */ 556 558 557 /* Take unscaled HiDPI output mode into account: */ 559 /* Take the scale-factor related attributes into account: */ 560 const double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid()); 558 561 const bool fUseUnscaledHiDPIOutput = gEDataManager->useUnscaledHiDPIOutput(vboxGlobal().managedVMUuid()); 562 m_pFrameBuffer->setScaleFactor(dScaleFactor); 559 563 m_pFrameBuffer->setUseUnscaledHiDPIOutput(fUseUnscaledHiDPIOutput); 564 /* Propagate the scale-factor related attributes to 3D service if necessary: */ 565 if (machine().GetAccelerate3DEnabled() && vboxGlobal().is3DAvailable()) 566 { 567 display().NotifyScaleFactorChange(m_uScreenId, 568 (uint32_t)(dScaleFactor * VBOX_OGL_SCALE_FACTOR_MULTIPLIER), 569 (uint32_t)(dScaleFactor * VBOX_OGL_SCALE_FACTOR_MULTIPLIER)); 570 display().NotifyHiDPIOutputPolicyChange(fUseUnscaledHiDPIOutput); 571 } 560 572 561 573 /* Perform frame-buffer rescaling: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp
r54104 r54603 148 148 const bool fUseUnscaledHiDPIOutput = gEDataManager->useUnscaledHiDPIOutput(vboxGlobal().managedVMUuid()); 149 149 frameBuffer()->setUseUnscaledHiDPIOutput(fUseUnscaledHiDPIOutput); 150 /* Propagate unscaled-hidpi-output feature to 3D service if necessary: */ 151 if (machine().GetAccelerate3DEnabled() && vboxGlobal().is3DAvailable()) 152 { 153 display().NotifyHiDPIOutputPolicyChange(fUseUnscaledHiDPIOutput); 154 } 150 155 151 156 /* Perform frame-buffer rescaling: */ 152 157 frameBuffer()->performRescale(); 158 159 // TODO: How to make it work? 160 display().ViewportChanged(screenId(), contentsX(), contentsY(), visibleWidth(), visibleHeight()); 153 161 } 154 162
Note:
See TracChangeset
for help on using the changeset viewer.