- Timestamp:
- Jan 22, 2009 5:34:15 PM (16 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/DisplayImpl.cpp
r16181 r16185 158 158 159 159 memset (&maFramebuffers[ul].dirtyRect, 0 , sizeof (maFramebuffers[ul].dirtyRect)); 160 memset (&maFramebuffers[ul].pendingResize, 0 , sizeof (maFramebuffers[ul].pendingResize)); 160 161 } 161 162 … … 295 296 bool f = ASMAtomicCmpXchgU32 (&maFramebuffers[uScreenId].u32ResizeStatus, 296 297 ResizeStatus_InProgress, ResizeStatus_Void); 297 AssertReleaseMsg(f, ("s = %d, id = %d, f = %d\n", maFramebuffers[uScreenId].u32ResizeStatus, uScreenId, f));NOREF(f); 298 if (!f) 299 { 300 /* This could be a result of the screenshot taking call Display::TakeScreenShot: 301 * if the framebuffer is processing the resize request and GUI calls the TakeScreenShot 302 * and the guest has reprogrammed the virtual VGA devices again so a new resize is required. 303 * 304 * Save the resize information and return. 305 * 306 * Note: the resize information is only accessed on EMT so no serialization is required. 307 */ 308 LogRel (("Display::handleDisplayResize(): Warning: resize postponed.\n")); 309 310 maFramebuffers[uScreenId].pendingResize.fPending = true; 311 maFramebuffers[uScreenId].pendingResize.pixelFormat = pixelFormat; 312 maFramebuffers[uScreenId].pendingResize.pvVRAM = pvVRAM; 313 maFramebuffers[uScreenId].pendingResize.bpp = bpp; 314 maFramebuffers[uScreenId].pendingResize.cbLine = cbLine; 315 maFramebuffers[uScreenId].pendingResize.w = w; 316 maFramebuffers[uScreenId].pendingResize.h = h; 317 318 return VINF_SUCCESS; 319 } 298 320 299 321 /* The framebuffer is locked in the state. … … 319 341 AssertRelease(f);NOREF(f); 320 342 343 AssertRelease(!maFramebuffers[uScreenId].pendingResize.fPending); 344 321 345 /* The method also unlocks the framebuffer. */ 322 346 handleResizeCompletedEMT(); … … 346 370 { 347 371 /* This is not the display that has completed resizing. */ 372 continue; 373 } 374 375 /* Check whether a resize is pending for this framebuffer. */ 376 if (pFBInfo->pendingResize.fPending) 377 { 378 /* Reset the condition, call the display resize with saved data and continue. 379 * 380 * Note: handleDisplayResize can call handleResizeCompletedEMT back, 381 * but infinite recursion is not possible, because when the handleResizeCompletedEMT 382 * is called, the pFBInfo->pendingResize.fPending is equal to false. 383 */ 384 pFBInfo->pendingResize.fPending = false; 385 handleDisplayResize (uScreenId, pFBInfo->pendingResize.bpp, pFBInfo->pendingResize.pvVRAM, 386 pFBInfo->pendingResize.cbLine, pFBInfo->pendingResize.w, pFBInfo->pendingResize.h); 348 387 continue; 349 388 } -
trunk/src/VBox/Main/include/DisplayImpl.h
r15051 r16185 70 70 } dirtyRect; 71 71 72 struct { 73 bool fPending; 74 ULONG pixelFormat; 75 void *pvVRAM; 76 uint32_t bpp; 77 uint32_t cbLine; 78 int w; 79 int h; 80 } pendingResize; 81 72 82 } DISPLAYFBINFO; 73 83
Note:
See TracChangeset
for help on using the changeset viewer.