VirtualBox

Changeset 71030 in vbox


Ignore:
Timestamp:
Feb 15, 2018 3:34:31 PM (7 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8694: Runtime UI: Framebuffer: A bit of cleanup for painting routines.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp

    r70870 r71030  
    13511351    /* Scaled image is NULL by default: */
    13521352    QImage scaledImage;
    1353     /* But if scaled-factor is set and current image is NOT null: */
     1353    /* But if scale-factor is set and current image is NOT null: */
    13541354    if (m_scaledSize.isValid() && !m_image.isNull())
    13551355    {
     
    13571357         * detached during scale process, otherwise we can get a frozen frame-buffer. */
    13581358        scaledImage = m_image.copy();
    1359         /* And scaling the image to predefined scaled-factor: */
     1359        /* And scaling the image to predefined scale-factor: */
    13601360        switch (m_pMachineView->visualStateType())
    13611361        {
     
    13921392
    13931393#ifdef VBOX_WS_MAC
    1394     /* On OSX for Qt5 we need to erase backing store first: */
    1395     QRect eraseRect = paintRect;
    1396     /* Take the device-pixel-ratio into account: */
    1397     if (useUnscaledHiDPIOutput() && devicePixelRatio() > 1.0)
    1398     {
    1399         eraseRect.moveTo(eraseRect.topLeft() / devicePixelRatio());
    1400         eraseRect.setSize(eraseRect.size() / devicePixelRatio());
    1401     }
    1402     /* Replace translucent background with black one: */
     1394    /* On OSX for Qt5 we need to fill the backing store first: */
    14031395    painter.setCompositionMode(QPainter::CompositionMode_Source);
    1404     painter.fillRect(eraseRect, QColor(Qt::black));
     1396    painter.fillRect(pEvent->rect(), QColor(Qt::black));
    14051397    painter.setCompositionMode(QPainter::CompositionMode_SourceAtop);
    14061398#endif /* VBOX_WS_MAC */
     
    14201412    /* Scaled image is NULL by default: */
    14211413    QImage scaledImage;
    1422     /* But if scaled-factor is set and current image is NOT null: */
     1414    /* But if scale-factor is set and current image is NOT null: */
    14231415    if (m_scaledSize.isValid() && !m_image.isNull())
    14241416    {
     
    14261418         * detached during scale process, otherwise we can get a frozen frame-buffer. */
    14271419        scaledImage = m_image.copy();
    1428         /* And scaling the image to predefined scaled-factor: */
     1420        /* And scaling the image to predefined scale-factor: */
    14291421        switch (m_pMachineView->visualStateType())
    14301422        {
     
    14831475    painter.setCompositionMode(QPainter::CompositionMode_SourceOver);
    14841476
    1485 #if defined(VBOX_WITH_TRANSLUCENT_SEAMLESS)
    1486     /* On OSX for Qt5 we need to erase backing store first: */
    1487     QRect eraseRect = paintRect;
    1488     /* Take the device-pixel-ratio into account: */
    1489     if (useUnscaledHiDPIOutput() && devicePixelRatio() > 1.0)
    1490     {
    1491         eraseRect.moveTo(eraseRect.topLeft() / devicePixelRatio());
    1492         eraseRect.setSize(eraseRect.size() / devicePixelRatio());
    1493     }
    1494     /* Replace translucent background with black one: */
     1477#ifdef VBOX_WITH_TRANSLUCENT_SEAMLESS
     1478    /* In case of translucent seamless for Qt5 we need to fill the backing store first: */
    14951479    painter.setCompositionMode(QPainter::CompositionMode_Source);
    1496     painter.fillRect(eraseRect, QColor(Qt::black));
     1480    painter.fillRect(pEvent->rect(), QColor(Qt::black));
    14971481    painter.setCompositionMode(QPainter::CompositionMode_SourceAtop);
    14981482#endif /* VBOX_WITH_TRANSLUCENT_SEAMLESS */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette