- Timestamp:
- Jun 17, 2015 7:12:16 AM (10 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/DisplayImpl.h
r55133 r56468 179 179 int i_notifyCroglResize(const PVBVAINFOVIEW pView, const PVBVAINFOSCREEN pScreen, void *pvVRAM); 180 180 181 int i_saveVisibleRegion(uint32_t cRect, PRTRECT pRect); 181 182 int i_handleSetVisibleRegion(uint32_t cRect, PRTRECT pRect); 182 183 int i_handleQueryVisibleRegion(uint32_t *pcRect, PRTRECT pRect); … … 397 398 bool volatile fVGAResizing; 398 399 400 /** Are we in seamless mode? Not saved, as we exit seamless on saving. */ 401 bool mfSeamlessEnabled; 402 /** Last set seamless visible region, number of rectangles. */ 403 uint32_t mcRectVisibleRegion; 404 /** Last set seamless visible region, data. Freed on final clean-up. */ 405 PRTRECT mpRectVisibleRegion; 406 399 407 bool mfVideoAccelVRDP; 400 408 uint32_t mfu32SupportedOrders; -
trunk/src/VBox/Main/src-client/DisplayImpl.cpp
r55837 r56468 109 109 mfu32SupportedOrders = 0; 110 110 mcVideoAccelVRDPRefs = 0; 111 112 mfSeamlessEnabled = false; 113 mpRectVisibleRegion = NULL; 111 114 112 115 #ifdef VBOX_WITH_CROGL … … 157 160 158 161 videoAccelDestroy(&mVideoAccelLegacy); 162 i_saveVisibleRegion(0, NULL); 159 163 160 164 if (RTCritSectIsInitialized(&mVideoAccelLock)) … … 954 958 mParent->i_consoleVRDPServer()->SendResize(); 955 959 960 /* And re-send the seamless rectangles if necessary. */ 961 if (mfSeamlessEnabled) 962 i_handleSetVisibleRegion(mcRectVisibleRegion, mpRectVisibleRegion); 963 956 964 LogRelFlowFunc(("[%d]: default format %d\n", uScreenId, pFBInfo->fDefaultFormat)); 957 965 … … 1125 1133 cxInputMapping = cx; 1126 1134 cyInputMapping = cy; 1135 1136 /* Re-send the seamless rectangles if necessary. */ 1137 if (mfSeamlessEnabled) 1138 i_handleSetVisibleRegion(mcRectVisibleRegion, mpRectVisibleRegion); 1127 1139 } 1128 1140 … … 1249 1261 } 1250 1262 1263 int Display::i_saveVisibleRegion(uint32_t cRect, PRTRECT pRect) 1264 { 1265 RTRECT *pRectVisibleRegion = NULL; 1266 1267 if (pRect == mpRectVisibleRegion) 1268 return VINF_SUCCESS; 1269 if (cRect != 0) 1270 { 1271 pRectVisibleRegion = (RTRECT *)RTMemAlloc(cRect * sizeof(RTRECT)); 1272 if (!pRectVisibleRegion) 1273 { 1274 return VERR_NO_MEMORY; 1275 } 1276 memcpy(pRectVisibleRegion, pRect, cRect * sizeof(RTRECT)); 1277 } 1278 if (mpRectVisibleRegion) 1279 RTMemFree(mpRectVisibleRegion); 1280 mcRectVisibleRegion = cRect; 1281 mpRectVisibleRegion = pRectVisibleRegion; 1282 return VINF_SUCCESS; 1283 } 1284 1251 1285 int Display::i_handleSetVisibleRegion(uint32_t cRect, PRTRECT pRect) 1252 1286 { … … 1257 1291 return VERR_NO_TMP_MEMORY; 1258 1292 } 1293 int rc = i_saveVisibleRegion(cRect, pRect); 1294 if (RT_FAILURE(rc)) 1295 { 1296 RTMemTmpFree(pVisibleRegion); 1297 return rc; 1298 } 1259 1299 1260 1300 unsigned uScreenId; … … 1269 1309 */ 1270 1310 RTRECT rectFramebuffer; 1271 rectFramebuffer.xLeft = pFBInfo->xOrigin ;1272 rectFramebuffer.yTop = pFBInfo->yOrigin ;1273 rectFramebuffer.xRight = pFBInfo->xOrigin+ pFBInfo->w;1274 rectFramebuffer.yBottom = pFBInfo->yOrigin+ pFBInfo->h;1311 rectFramebuffer.xLeft = pFBInfo->xOrigin - xInputMappingOrigin; 1312 rectFramebuffer.yTop = pFBInfo->yOrigin - yInputMappingOrigin; 1313 rectFramebuffer.xRight = rectFramebuffer.xLeft + pFBInfo->w; 1314 rectFramebuffer.yBottom = rectFramebuffer.yTop + pFBInfo->h; 1275 1315 1276 1316 uint32_t cRectVisibleRegion = 0; … … 1281 1321 if (displayIntersectRect(&pVisibleRegion[cRectVisibleRegion], &pRect[i], &rectFramebuffer)) 1282 1322 { 1283 pVisibleRegion[cRectVisibleRegion].xLeft -= pFBInfo->xOrigin;1284 pVisibleRegion[cRectVisibleRegion].yTop -= pFBInfo->yOrigin;1285 pVisibleRegion[cRectVisibleRegion].xRight -= pFBInfo->xOrigin;1286 pVisibleRegion[cRectVisibleRegion].yBottom -= pFBInfo->yOrigin;1323 pVisibleRegion[cRectVisibleRegion].xLeft -= rectFramebuffer.xLeft; 1324 pVisibleRegion[cRectVisibleRegion].yTop -= rectFramebuffer.yTop; 1325 pVisibleRegion[cRectVisibleRegion].xRight -= rectFramebuffer.xLeft; 1326 pVisibleRegion[cRectVisibleRegion].yBottom -= rectFramebuffer.yTop; 1287 1327 1288 1328 cRectVisibleRegion++; … … 1313 1353 pCtl->aParms[0].u.pointer.size = cRect * sizeof(RTRECT); 1314 1354 1315 intrc = i_crCtlSubmit(&pCtl->Hdr, sizeof(*pCtl), i_displayCrCmdFree, pCtl);1355 rc = i_crCtlSubmit(&pCtl->Hdr, sizeof(*pCtl), i_displayCrCmdFree, pCtl); 1316 1356 if (!RT_SUCCESS(rc)) 1317 1357 { … … 1766 1806 pVMMDevPort->pfnRequestSeamlessChange(pVMMDevPort, !!enabled); 1767 1807 } 1808 mfSeamlessEnabled = enabled; 1768 1809 1769 1810 #if defined(VBOX_WITH_HGCM) && defined(VBOX_WITH_CROGL)
Note:
See TracChangeset
for help on using the changeset viewer.