Changeset 53521 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Dec 12, 2014 11:00:58 AM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 97262
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp
r53520 r53521 922 922 QRect paintRect = pEvent->rect(); 923 923 924 /* Prepare seamless regions to erase/paint: */ 925 lock(); 926 const QRegion eraseRegion = QRegion(paintRect) - m_syncVisibleRegion; 927 const QRegion paintRegion = QRegion(paintRect) & m_syncVisibleRegion; 928 unlock(); 929 924 930 /* Take the backing-scale-factor into account: */ 925 931 if (useUnscaledHiDPIOutput() && backingScaleFactor() > 1.0) … … 937 943 QPainter painter(m_pMachineView->viewport()); 938 944 939 /* Determine the region to erase: */ 940 lock(); 941 QRegion regionToErase = (QRegion)paintRect - m_syncVisibleRegion; 942 unlock(); 943 if (!regionToErase.isEmpty()) 944 { 945 /* Optimize composition-mode: */ 946 painter.setCompositionMode(QPainter::CompositionMode_Clear); 947 /* Erase required region, slowly, rectangle-by-rectangle: */ 948 foreach (const QRect &rect, regionToErase.rects()) 949 eraseImageRect(painter, rect, 950 useUnscaledHiDPIOutput(), hiDPIOptimizationType(), backingScaleFactor()); 951 /* Restore composition-mode: */ 952 painter.setCompositionMode(QPainter::CompositionMode_SourceOver); 953 } 954 955 /* Determine the region to paint: */ 956 lock(); 957 QRegion regionToPaint = (QRegion)paintRect & m_syncVisibleRegion; 958 unlock(); 959 if (!regionToPaint.isEmpty()) 960 { 961 /* Paint required region, slowly, rectangle-by-rectangle: */ 962 foreach (const QRect &rect, regionToPaint.rects()) 963 { 945 /* Apply painter clipping for erasing: */ 946 painter.setClipRegion(eraseRegion); 947 /* Set composition-mode to erase: */ 948 painter.setCompositionMode(QPainter::CompositionMode_Clear); 949 /* Erase rectangle: */ 950 eraseImageRect(painter, paintRect, 951 useUnscaledHiDPIOutput(), hiDPIOptimizationType(), backingScaleFactor()); 952 953 /* Apply painter clipping for painting: */ 954 painter.setClipRegion(paintRegion); 955 /* Set composition-mode to paint: */ 956 painter.setCompositionMode(QPainter::CompositionMode_SourceOver); 964 957 #if defined(VBOX_WITH_TRANSLUCENT_SEAMLESS) 965 958 # if defined(Q_WS_WIN) || defined(Q_WS_X11) 966 967 968 969 970 painter.fillRect(rect, QColor(Qt::black));971 959 /* Replace translucent background with black one, 960 * that is necessary for window with Qt::WA_TranslucentBackground 961 * and no native backing store support like Mac OS X has: */ 962 painter.setCompositionMode(QPainter::CompositionMode_Source); 963 painter.fillRect(paintRect, QColor(Qt::black)); 964 painter.setCompositionMode(QPainter::CompositionMode_SourceAtop); 972 965 # endif /* Q_WS_WIN || Q_WS_X11 */ 973 966 #endif /* VBOX_WITH_TRANSLUCENT_SEAMLESS */ 974 975 /* Draw image rectangle: */ 976 drawImageRect(painter, sourceImage, rect, 977 m_pMachineView->contentsX(), m_pMachineView->contentsY(), 978 useUnscaledHiDPIOutput(), hiDPIOptimizationType(), backingScaleFactor()); 979 } 980 } 967 /* Paint rectangle: */ 968 drawImageRect(painter, sourceImage, paintRect, 969 m_pMachineView->contentsX(), m_pMachineView->contentsY(), 970 useUnscaledHiDPIOutput(), hiDPIOptimizationType(), backingScaleFactor()); 981 971 } 982 972
Note:
See TracChangeset
for help on using the changeset viewer.