Changeset 22846 in vbox
- Timestamp:
- Sep 8, 2009 7:33:55 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 52082
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/include/VBoxFBOverlay.h
r22836 r22846 431 431 void updatedMem(const QRect * aRect); 432 432 433 void performDisplay(VBoxVHWASurfaceBase *pPrimary);433 bool performDisplay(VBoxVHWASurfaceBase *pPrimary, bool bForce); 434 434 435 435 void setRects(VBoxVHWASurfaceBase *pPrimary, const QRect & aTargRect, const QRect & aSrcRect, const QRect & aVisibleTargRect, bool bForceReinit); … … 583 583 GLuint createDisplay(VBoxVHWASurfaceBase *pPrimary); 584 584 void doDisplay(VBoxVHWASurfaceBase *pPrimary, VBoxVHWAGlProgramVHWA * pProgram, bool bBindDst); 585 voidsynchTexMem(const QRect * aRect);585 bool synchTexMem(const QRect * aRect); 586 586 587 587 int performBlt(const QRect * pDstRect, VBoxVHWASurfaceBase * pSrcSurface, const QRect * pSrcRect, const VBoxVHWAColorKey * pDstCKey, const VBoxVHWAColorKey * pSrcCKey, bool blt); … … 772 772 } 773 773 774 void performDisplay()774 bool performDisplay(bool bForce) 775 775 { 776 776 VBoxVHWASurfaceBase * pPrimary = mPrimary.current(); 777 pPrimary->performDisplay(NULL);777 bForce |= pPrimary->performDisplay(NULL, bForce); 778 778 779 779 for (OverlayList::const_iterator it = mOverlays.begin(); … … 783 783 if(pOverlay) 784 784 { 785 pOverlay->performDisplay(pPrimary);785 bForce |= pOverlay->performDisplay(pPrimary, bForce); 786 786 } 787 787 } 788 return bForce; 788 789 } 789 790 … … 1061 1062 const QRect & vboxViewport() const {return mViewport;} 1062 1063 1063 void performDisplay() { mDisplay.performDisplay(); }1064 bool performDisplay(bool bForce) { return mDisplay.performDisplay(bForce); } 1064 1065 protected: 1065 1066 … … 1073 1074 // else 1074 1075 // { 1075 mDisplay.performDisplay( );1076 mDisplay.performDisplay(true); 1076 1077 // } 1077 1078 } … … 1165 1166 1166 1167 1167 typedef enum1168 {1169 VBOXFBOVERLAY_DONE = 1,1170 VBOXFBOVERLAY_MODIFIED,1171 VBOXFBOVERLAY_UNTOUCHED1172 } VBOXFBOVERLAY_RESUT;1168 //typedef enum 1169 //{ 1170 // VBOXFBOVERLAY_DONE = 1, 1171 // VBOXFBOVERLAY_MODIFIED, 1172 // VBOXFBOVERLAY_UNTOUCHED 1173 //} VBOXFBOVERLAY_RESUT; 1173 1174 1174 1175 class VBoxQGLOverlay … … 1201 1202 } 1202 1203 1203 VBOXFBOVERLAY_RESUT onPaintEvent (const QPaintEvent *pe, QRect *pRect); 1204 // VBOXFBOVERLAY_RESUT onPaintEvent (const QPaintEvent *pe, QRect *pRect); 1205 1204 1206 void onResizeEvent (const class VBoxResizeEvent *re); 1205 1207 void onResizeEventPostprocess (const class VBoxResizeEvent *re); 1206 1208 1207 void viewportResized(QResizeEvent * re)1209 void onViewportResized(QResizeEvent * re) 1208 1210 { 1209 1211 vboxDoCheckUpdateViewport(); … … 1211 1213 } 1212 1214 1213 void viewportScrolled(int dx, int dy)1215 void onViewportScrolled(int dx, int dy) 1214 1216 { 1215 1217 vboxDoCheckUpdateViewport(); … … 1257 1259 #else 1258 1260 makeCurrent(); 1259 mpOverlayWidget->performDisplay( );1261 mpOverlayWidget->performDisplay(false); 1260 1262 mpOverlayWidget->swapBuffers(); 1261 1263 #endif … … 1350 1352 } 1351 1353 1352 void paintEvent (QPaintEvent *pe)1353 {1354 QRect rect;1355 VBOXFBOVERLAY_RESUT res = mOverlay.onPaintEvent(pe, &rect);1356 switch(res)1357 {1358 case VBOXFBOVERLAY_MODIFIED:1359 {1360 QPaintEvent modified(rect);1361 T::paintEvent(&modified);1362 } break;1363 case VBOXFBOVERLAY_UNTOUCHED:1364 T::paintEvent(pe);1365 break;1366 default:1367 break;1368 }1369 }1354 // void paintEvent (QPaintEvent *pe) 1355 // { 1356 // QRect rect; 1357 // VBOXFBOVERLAY_RESUT res = mOverlay.onPaintEvent(pe, &rect); 1358 // switch(res) 1359 // { 1360 // case VBOXFBOVERLAY_MODIFIED: 1361 // { 1362 // QPaintEvent modified(rect); 1363 // T::paintEvent(&modified); 1364 // } break; 1365 // case VBOXFBOVERLAY_UNTOUCHED: 1366 // T::paintEvent(pe); 1367 // break; 1368 // default: 1369 // break; 1370 // } 1371 // } 1370 1372 1371 1373 void resizeEvent (VBoxResizeEvent *re) … … 1378 1380 void viewportResized(QResizeEvent * re) 1379 1381 { 1380 mOverlay. viewportResized(re);1382 mOverlay.onViewportResized(re); 1381 1383 T::viewportResized(re); 1382 1384 } … … 1384 1386 void viewportScrolled(int dx, int dy) 1385 1387 { 1386 mOverlay. viewportScrolled(dx, dy);1388 mOverlay.onViewportScrolled(dx, dy); 1387 1389 T::viewportScrolled(dx, dy); 1388 1390 } -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp
r22842 r22846 2147 2147 GLenum VBoxVHWATextureNP2Rect::texTarget() {return GL_TEXTURE_RECTANGLE; } 2148 2148 2149 voidVBoxVHWASurfaceBase::synchTexMem(const QRect * pRect)2149 bool VBoxVHWASurfaceBase::synchTexMem(const QRect * pRect) 2150 2150 { 2151 2151 if(pRect) … … 2155 2155 2156 2156 if(mUpdateMem2TexRect.isClear()) 2157 return ;2157 return false; 2158 2158 2159 2159 if(pRect && !mUpdateMem2TexRect.rect().intersects(*pRect)) 2160 return ;2160 return false; 2161 2161 2162 2162 mpTex[0]->update(&mUpdateMem2TexRect.rect()); … … 2179 2179 // VBOXPRINTDIF(dbgTime, ("texMem:")); 2180 2180 //#endif 2181 return true; 2181 2182 } 2182 2183 … … 2870 2871 //} 2871 2872 2872 void VBoxVHWASurfaceBase::performDisplay(VBoxVHWASurfaceBase *pPrimary)2873 bool VBoxVHWASurfaceBase::performDisplay(VBoxVHWASurfaceBase *pPrimary, bool bForce) 2873 2874 { 2874 2875 Assert(mVisibleDisplayInitialized); … … 2879 2880 Assert(mVisibleSrcRect.isEmpty()); 2880 2881 Assert(mVisibleTargRect.isEmpty()); 2881 return ;2882 return false; 2882 2883 } 2883 2884 else … … 2887 2888 } 2888 2889 2889 synchTexMem(&mVisibleSrcRect);2890 bForce |= synchTexMem(&mVisibleSrcRect); 2890 2891 if(pPrimary && getActiveDstOverlayCKey(pPrimary)) 2891 2892 { 2892 pPrimary->synchTexMem(&mVisibleTargRect); 2893 } 2893 bForce |= pPrimary->synchTexMem(&mVisibleTargRect); 2894 } 2895 2896 if(!bForce) 2897 return false; 2894 2898 2895 2899 #ifdef DEBUG_misha … … 2924 2928 ); 2925 2929 } 2930 2931 Assert(bForce); 2932 return true; 2926 2933 } 2927 2934 … … 5165 5172 } 5166 5173 5167 VBOXFBOVERLAY_RESUT VBoxQGLOverlay::onPaintEvent (const QPaintEvent *pe, QRect *pRect)5168 {5169 Q_UNUSED(pe);5170 Q_UNUSED(pRect);5171 5172 // if(mOverlayWidgetVisible && !mProcessingCommands)5173 // {5174 // Assert(!mGlCurrent);5175 // vboxDoCheckUpdateViewport();5176 // vboxOpExit();5177 // }5178 return VBOXFBOVERLAY_UNTOUCHED;5179 }5174 //VBOXFBOVERLAY_RESUT VBoxQGLOverlay::onPaintEvent (const QPaintEvent *pe, QRect *pRect) 5175 //{ 5176 // Q_UNUSED(pe); 5177 // Q_UNUSED(pRect); 5178 // 5179 //// if(mOverlayWidgetVisible && !mProcessingCommands) 5180 //// { 5181 //// Assert(!mGlCurrent); 5182 //// vboxDoCheckUpdateViewport(); 5183 //// vboxOpExit(); 5184 //// } 5185 // return VBOXFBOVERLAY_UNTOUCHED; 5186 //} 5180 5187 5181 5188 void VBoxQGLOverlay::onResizeEvent (const VBoxResizeEvent *re) … … 5391 5398 { 5392 5399 mpOverlayWidget->vboxDoUpdateRect(&aRect); 5393 if(aRect.intersects(mpOverlayWidget->vboxViewport())) 5394 { 5395 mNeedOverlayRepaint = true; 5396 } 5400 mNeedOverlayRepaint = true; 5397 5401 } 5398 5402 } … … 5403 5407 VBoxVHWASurfaceBase * pVGA = mpOverlayWidget->vboxGetVGASurface(); 5404 5408 const VBoxVHWADirtyRect & rect = pVGA->getDirtyRect(); 5409 mNeedOverlayRepaint = true; 5405 5410 if(!rect.isClear()) 5406 5411 { … … 5438 5443 } 5439 5444 vboxDoCheckUpdateViewport(); 5445 mNeedOverlayRepaint = true; 5440 5446 } 5441 5447 } break; … … 5456 5462 } 5457 5463 vboxDoCheckUpdateViewport(); 5464 mNeedOverlayRepaint = true; 5458 5465 } 5459 5466 } break; … … 5472 5479 VBOXVHWACMD_SURF_BLT * pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_SURF_BLT); 5473 5480 pCmd->rc = mpOverlayWidget->vhwaSurfaceBlt(pBody); 5481 mNeedOverlayRepaint = true; 5474 5482 } break; 5475 5483 case VBOXVHWACMD_TYPE_SURF_FLIP: … … 5489 5497 } 5490 5498 vboxDoCheckUpdateViewport(); 5499 mNeedOverlayRepaint = true; 5491 5500 } break; 5492 5501 case VBOXVHWACMD_TYPE_SURF_OVERLAY_SETPOSITION: … … 5500 5509 } 5501 5510 vboxDoCheckUpdateViewport(); 5511 mNeedOverlayRepaint = true; 5502 5512 } break; 5503 5513 case VBOXVHWACMD_TYPE_SURF_COLORKEY_SET: -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBQGL.cpp
r22836 r22846 130 130 } 131 131 132 pw->performDisplay( );132 pw->performDisplay(true); 133 133 134 134 pw->swapBuffers();
Note:
See TracChangeset
for help on using the changeset viewer.