Changeset 46283 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- May 27, 2013 11:22:29 AM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 86027
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp
r46129 r46283 264 264 } 265 265 lock(); /* See comment in setView(). */ 266 m_syncVisibleRegion = reg; 266 267 if (m_pMachineView) 267 268 QApplication::postEvent(m_pMachineView, new UISetRegionEvent(reg)); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.h
r46255 r46283 237 237 ulong m_width; 238 238 ulong m_height; 239 QRegion m_visibleRegion;240 239 QSize m_scaledSize; 241 240 int64_t m_WinId; 242 241 bool m_fIsDeleted; 243 242 243 /* To avoid a seamless flicker, 244 * which caused by the latency between the 245 * initial visible-region arriving from EMT thread 246 * and actual visible-region application on GUI thread 247 * it was decided to use two visible-region instances: 248 * 1. 'Sync-one' which being updated synchronously by locking EMT thread, 249 * and used for immediate manual clipping of the painting operations. 250 * 2. 'Async-one' which updated asynchronously by posting async-event from EMT to GUI thread, 251 which is used to update viewport parts for visible-region changes, 252 because NotifyUpdate doesn't take into account these changes. */ 253 QRegion m_syncVisibleRegion; 254 QRegion m_asyncVisibleRegion; 255 244 256 #if defined (Q_OS_WIN32) 245 257 private: -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBufferQImage.cpp
r46255 r46283 56 56 { 57 57 /* Invalidate visible-region if necessary: */ 58 if (m_width != pEvent->width() || 59 m_height != pEvent->height()) 60 m_visibleRegion = QRegion(); 58 if (m_pMachineView->machineLogic()->visualStateType() == UIVisualStateType_Seamless && 59 (m_width != pEvent->width() || m_height != pEvent->height())) 60 { 61 lock(); 62 m_syncVisibleRegion = QRegion(); 63 m_asyncVisibleRegion = QRegion(); 64 unlock(); 65 } 61 66 62 67 /* Remember new width/height: */ … … 175 180 void UIFrameBufferQImage::applyVisibleRegionEvent(UISetRegionEvent *pEvent) 176 181 { 177 /* Make sure visible-region changed: */ 178 if (m_visibleRegion == pEvent->region()) 179 return; 180 181 /* Compose viewport region to update: */ 182 QRegion toUpdate = pEvent->region() + m_visibleRegion; 183 /* Remember new visible-region: */ 184 m_visibleRegion = pEvent->region(); 185 /* Update viewport region finally: */ 186 m_pMachineView->viewport()->update(toUpdate); 182 /* Make sure async visible-region changed: */ 183 if (m_asyncVisibleRegion == pEvent->region()) 184 return; 185 186 /* We are accounting async visible-regions one-by-one 187 * to keep corresponding viewport area always updated! */ 188 m_pMachineView->viewport()->update(pEvent->region() + m_asyncVisibleRegion); 189 m_asyncVisibleRegion = pEvent->region(); 190 187 191 #ifdef Q_WS_X11 188 192 /* Qt 4.8.3 under X11 has Qt::WA_TranslucentBackground window attribute broken, 189 * so we are still have to use old one known Xshape extension wrapped by the widget setMask API: */ 190 m_pMachineView->machineWindow()->setMask(m_visibleRegion); 193 * so we are also have to use async visible-region to apply to [Q]Widget [set]Mask 194 * which internally wraps old one known (approved) Xshape extension: */ 195 m_pMachineView->machineWindow()->setMask(m_asyncVisibleRegion); 191 196 #endif /* Q_WS_X11 */ 192 197 } … … 226 231 painter.setCompositionMode(QPainter::CompositionMode_SourceOver); 227 232 233 /* Manually clip paint rectangle using visible-region: */ 234 lock(); 235 QRegion visiblePaintRegion = m_syncVisibleRegion & paintRect; 236 unlock(); 237 228 238 /* Repaint all the rectangles of visible-region: */ 229 QRegion visiblePaintRegion = m_visibleRegion & paintRect;230 239 foreach (const QRect &rect, visiblePaintRegion.rects()) 231 240 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBufferQuartz2D.cpp
r46255 r46283 465 465 void UIFrameBufferQuartz2D::applyVisibleRegionEvent(UISetRegionEvent *pEvent) 466 466 { 467 /* Make sure visible-region changed: */468 if (m_ visibleRegion == pEvent->region())467 /* Make sure async visible-region changed: */ 468 if (m_asyncVisibleRegion == pEvent->region()) 469 469 return; 470 470 471 /* Remember new visible-region: */ 472 m_visibleRegion = pEvent->region(); 473 /* Invalidate whole the viewport: */ 471 /* We are handling the fact of async visible-region change 472 * to invalidate whole the viewport area! */ 474 473 ::darwinWindowInvalidateShape(m_pMachineView->viewport()); 474 m_asyncVisibleRegion = pEvent->region(); 475 475 } 476 476
Note:
See TracChangeset
for help on using the changeset viewer.