- Timestamp:
- Sep 2, 2014 7:24:34 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 95843
- Location:
- trunk/src/VBox
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.cpp
r52200 r52574 394 394 } 395 395 396 STDMETHODIMP VBoxSDLFB::COMGETTER(Capabilities)(ComSafeArrayOut(FramebufferCapabilities_T, aCapabilities)) 397 { 398 if (ComSafeArrayOutIsNull(aCapabilities)) 399 return E_POINTER; 400 401 com::SafeArray<FramebufferCapabilities_T> caps; 402 403 if (mfUpdateImage) 404 { 405 caps.resize(1); 406 caps[0] = FramebufferCapabilities_UpdateImage; 407 } 408 else 409 { 410 /* No caps to return. */ 411 } 412 413 caps.detachTo(ComSafeArrayOutArg(aCapabilities)); 414 return S_OK; 415 } 416 396 417 /** 397 418 * Notify framebuffer of an update. … … 666 687 667 688 resizeGuest(); 668 669 if (mfUpdateImage)670 {671 gpDisplay->SetFramebufferUpdateMode(aScreenId, FramebufferUpdateMode_NotifyUpdateImage);672 }673 689 674 690 gpDisplay->InvalidateAndUpdateScreen(aScreenId); -
trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.h
r51677 r52574 80 80 STDMETHOD(COMGETTER(Overlay)) (IFramebufferOverlay **aOverlay); 81 81 STDMETHOD(COMGETTER(WinId)) (int64_t *winId); 82 STDMETHOD(COMGETTER(Capabilities))(ComSafeArrayOut(FramebufferCapabilities_T, aCapabilities)); 82 83 83 84 STDMETHOD(NotifyUpdate)(ULONG x, ULONG y, ULONG w, ULONG h); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp
r52086 r52574 194 194 } 195 195 196 STDMETHODIMP UIFrameBuffer::COMGETTER(Capabilities)(ComSafeArrayOut(FramebufferCapabilities_T, aCapabilities)) 197 { 198 if (ComSafeArrayOutIsNull(aCapabilities)) 199 return E_POINTER; 200 201 com::SafeArray<FramebufferCapabilities_T> caps; 202 caps.resize(2); 203 caps[0] = FramebufferCapabilities_VHWA; 204 caps[1] = FramebufferCapabilities_VisibleRegion; 205 206 caps.detachTo(ComSafeArrayOutArg(aCapabilities)); 207 return S_OK; 208 } 209 196 210 STDMETHODIMP UIFrameBuffer::NotifyChange(ULONG uScreenId, ULONG uX, ULONG uY, ULONG uWidth, ULONG uHeight) 197 211 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.h
r52200 r52574 105 105 STDMETHOD(COMGETTER(Overlay))(IFramebufferOverlay **ppOverlay); 106 106 STDMETHOD(COMGETTER(WinId))(LONG64 *pWinId); 107 STDMETHOD(COMGETTER(Capabilities))(ComSafeArrayOut(FramebufferCapabilities_T, aCapabilities)); 107 108 108 109 /** EMT callback: Notifies frame-buffer about guest-screen size change. -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r52360 r52574 15296 15296 --> 15297 15297 15298 <enum15299 name="FramebufferUpdateMode"15300 uuid="1268d8ab-dd2f-443c-bc56-d93d3ced5cde"15301 >15302 <desc>15303 How a framebuffer is notified about screen updates.15304 </desc>15305 15306 <const name="NotifyUpdate" value="0">15307 <desc>15308 IFramebuffer::NotifyUpdate is called.15309 </desc>15310 </const>15311 <const name="NotifyUpdateImage" value="1">15312 <desc>15313 IFramebuffer::NotifyUpdateImage is called.15314 </desc>15315 </const>15316 </enum>15317 15318 15298 <interface 15319 15299 name="IDisplaySourceBitmap" extends="$unknown" wsmap="suppress" … … 15333 15313 </interface> 15334 15314 15315 <enum 15316 name="FramebufferCapabilities" 15317 uuid="cc395839-30fa-4ca5-ae65-e6360e3edd7a" 15318 > 15319 <desc> 15320 Framebuffer capability flags. 15321 </desc> 15322 15323 <const name="UpdateImage" value="0x01"> 15324 <desc> 15325 Requires NotifyUpdateImage. NotifyUpdate must not be called. 15326 </desc> 15327 </const> 15328 15329 <const name="VHWA" value="0x02"> 15330 <desc> 15331 Supports VHWA interface. If set, then IFramebuffer::processVHWACommand can be called. 15332 </desc> 15333 </const> 15334 15335 <const name="VisibleRegion" value="0x04"> 15336 <desc> 15337 Supports visible region. If set, then IFramebuffer::setVisibleRegion can be called. 15338 </desc> 15339 </const> 15340 </enum> 15341 15335 15342 <interface 15336 15343 name="IFramebuffer" extends="$unknown" 15337 uuid=" 16d73cd3-da84-4a11-a607-ebab57d050d0"15344 uuid="735365aa-544d-415c-a25b-a5ea913d63f3" 15338 15345 wsmap="managed" 15339 15346 > … … 15560 15567 </method> 15561 15568 15569 <attribute name="capabilities" type="FramebufferCapabilities" safearray="yes" readonly="yes"> 15570 <desc> 15571 Capabilities of the framebuffer instance. 15572 15573 For the meaning of individual capability flags see 15574 <link to="FramebufferCapabilities"/>. 15575 </desc> 15576 </attribute> 15577 15562 15578 </interface> 15563 15579 … … 15610 15626 <interface 15611 15627 name="IDisplay" extends="$unknown" 15612 uuid=" 1659de81-24f0-41a9-afd4-abd03dcfbcbc"15628 uuid="fb51010f-eefd-430d-8cd7-3c1bc14740eb" 15613 15629 wsmap="managed" 15614 15630 wrap-hint-server-addinterfaces="IEventListener" … … 15909 15925 <param name="screenId" type="unsigned long" dir="in"/> 15910 15926 <param name="displaySourceBitmap" type="IDisplaySourceBitmap" dir="out"/> 15911 </method>15912 15913 <method name="setFramebufferUpdateMode">15914 <desc>Select how the framebuffer is informed about screen updates.</desc>15915 <param name="screenId" type="unsigned long" dir="in"/>15916 <param name="framebufferUpdateMode" type="FramebufferUpdateMode" dir="in"/>15917 15927 </method> 15918 15928 -
trunk/src/VBox/Main/include/DisplayImpl.h
r52390 r52574 47 47 bool fDisabled; 48 48 49 FramebufferUpdateMode_T enmFramebufferUpdateMode;49 uint32_t u32Caps; 50 50 51 51 struct … … 232 232 virtual HRESULT querySourceBitmap(ULONG aScreenId, 233 233 ComPtr<IDisplaySourceBitmap> &aDisplaySourceBitmap); 234 virtual HRESULT setFramebufferUpdateMode(ULONG aScreenId,235 FramebufferUpdateMode_T aFramebufferUpdateMode);236 234 237 235 // Wrapped IEventListener properties -
trunk/src/VBox/Main/src-client/DisplayImpl.cpp
r52427 r52574 595 595 maFramebuffers[ul].fDisabled = ul > 0; 596 596 597 maFramebuffers[ul]. enmFramebufferUpdateMode = FramebufferUpdateMode_NotifyUpdate;597 maFramebuffers[ul].u32Caps = 0; 598 598 599 599 maFramebuffers[ul].updateImage.pu8Address = NULL; … … 855 855 } 856 856 857 SetFramebufferUpdateMode(uScreenId, FramebufferUpdateMode_NotifyUpdate); 857 DISPLAYFBINFO *pFBInfo = &maFramebuffers[uScreenId]; 858 859 /* Reset the update mode. */ 860 pFBInfo->updateImage.pSourceBitmap.setNull(); 861 pFBInfo->updateImage.pu8Address = NULL; 862 pFBInfo->updateImage.cbLine = 0; 858 863 859 864 if (uScreenId == VBOX_VIDEO_PRIMARY_SCREEN) 860 865 { 861 DISPLAYFBINFO *pFBInfo = &maFramebuffers[uScreenId];862 866 pFBInfo->w = w; 863 867 pFBInfo->h = h; … … 892 896 893 897 i_handleResizeCompletedEMT(uScreenId, TRUE); 898 899 bool fUpdateImage = RT_BOOL(pFBInfo->u32Caps & FramebufferCapabilities_UpdateImage); 900 if (fUpdateImage && !pFBInfo->pFramebuffer.isNull()) 901 { 902 ComPtr<IDisplaySourceBitmap> pSourceBitmap; 903 HRESULT hr = QuerySourceBitmap(uScreenId, pSourceBitmap.asOutParam()); 904 if (SUCCEEDED(hr)) 905 { 906 BYTE *pAddress = NULL; 907 ULONG ulWidth = 0; 908 ULONG ulHeight = 0; 909 ULONG ulBitsPerPixel = 0; 910 ULONG ulBytesPerLine = 0; 911 ULONG ulPixelFormat = 0; 912 913 hr = pSourceBitmap->QueryBitmapInfo(&pAddress, 914 &ulWidth, 915 &ulHeight, 916 &ulBitsPerPixel, 917 &ulBytesPerLine, 918 &ulPixelFormat); 919 if (SUCCEEDED(hr)) 920 { 921 pFBInfo->updateImage.pSourceBitmap = pSourceBitmap; 922 pFBInfo->updateImage.pu8Address = pAddress; 923 pFBInfo->updateImage.cbLine = ulBytesPerLine; 924 } 925 } 926 } 894 927 895 928 return VINF_SUCCESS; … … 1053 1086 if (w != 0 && h != 0) 1054 1087 { 1055 if (RT_LIKELY(maFramebuffers[uScreenId].enmFramebufferUpdateMode == FramebufferUpdateMode_NotifyUpdate)) 1088 bool fUpdateImage = RT_BOOL(maFramebuffers[uScreenId].u32Caps & FramebufferCapabilities_UpdateImage); 1089 if (RT_LIKELY(!fUpdateImage)) 1056 1090 { 1057 1091 pFramebuffer->NotifyUpdate(x, y, w, h); 1058 1092 } 1059 else if (maFramebuffers[uScreenId].enmFramebufferUpdateMode == FramebufferUpdateMode_NotifyUpdateImage)1093 else 1060 1094 { 1061 1095 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); … … 1195 1229 DISPLAYFBINFO *pFBInfo = &maFramebuffers[uScreenId]; 1196 1230 1197 if (!pFBInfo->pFramebuffer.isNull()) 1231 if ( !pFBInfo->pFramebuffer.isNull() 1232 & RT_BOOL(pFBInfo->u32Caps & FramebufferCapabilities_VisibleRegion)) 1198 1233 { 1199 1234 /* Prepare a new array of rectangles which intersect with the framebuffer. … … 2255 2290 2256 2291 pFBInfo->pFramebuffer = aFramebuffer; 2292 2293 SafeArray<FramebufferCapabilities_T> caps; 2294 pFBInfo->pFramebuffer->COMGETTER(Capabilities)(ComSafeArrayAsOutParam(caps)); 2295 pFBInfo->u32Caps = 0; 2296 size_t i; 2297 for (i = 0; i < caps.size(); ++i) 2298 pFBInfo->u32Caps |= caps[i]; 2257 2299 2258 2300 alock.release(); … … 3438 3480 } 3439 3481 3440 HRESULT Display::setFramebufferUpdateMode(ULONG aScreenId, FramebufferUpdateMode_T aFramebufferUpdateMode)3441 {3442 LogRelFlowFunc(("aScreenId %d, aFramebufferUpdateMode %d\n", aScreenId, aFramebufferUpdateMode));3443 3444 HRESULT hr = S_OK;3445 3446 /* Prepare without taking a lock. API has it's own locking. */3447 ComPtr<IDisplaySourceBitmap> pSourceBitmap;3448 if (aFramebufferUpdateMode == FramebufferUpdateMode_NotifyUpdateImage)3449 {3450 /* A source bitmap will be needed. */3451 hr = QuerySourceBitmap(aScreenId, pSourceBitmap.asOutParam());3452 }3453 3454 if (FAILED(hr))3455 return hr;3456 3457 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);3458 3459 if (aScreenId >= mcMonitors)3460 return setError(E_INVALIDARG, tr("SetFramebufferUpdateMode: Invalid screen %d (total %d)"),3461 aScreenId, mcMonitors);3462 3463 DISPLAYFBINFO *pFBInfo = &maFramebuffers[aScreenId];3464 3465 /* Reset the update mode. */3466 pFBInfo->updateImage.pSourceBitmap.setNull();3467 pFBInfo->updateImage.pu8Address = NULL;3468 pFBInfo->updateImage.cbLine = 0;3469 3470 if (aFramebufferUpdateMode == FramebufferUpdateMode_NotifyUpdateImage)3471 {3472 BYTE *pAddress = NULL;3473 ULONG ulWidth = 0;3474 ULONG ulHeight = 0;3475 ULONG ulBitsPerPixel = 0;3476 ULONG ulBytesPerLine = 0;3477 ULONG ulPixelFormat = 0;3478 3479 hr = pSourceBitmap->QueryBitmapInfo(&pAddress,3480 &ulWidth,3481 &ulHeight,3482 &ulBitsPerPixel,3483 &ulBytesPerLine,3484 &ulPixelFormat);3485 if (SUCCEEDED(hr))3486 {3487 pFBInfo->updateImage.pSourceBitmap = pSourceBitmap;3488 pFBInfo->updateImage.pu8Address = pAddress;3489 pFBInfo->updateImage.cbLine = ulBytesPerLine;3490 }3491 }3492 3493 pFBInfo->enmFramebufferUpdateMode = aFramebufferUpdateMode;3494 3495 return S_OK;3496 }3497 3498 3482 // wrapped IEventListener method 3499 3483 HRESULT Display::handleEvent(const ComPtr<IEvent> &aEvent) … … 4111 4095 AutoReadLock arlock(this COMMA_LOCKVAL_SRC_POS); 4112 4096 pFramebuffer = maFramebuffers[id].pFramebuffer; 4097 bool fVHWASupported = RT_BOOL(maFramebuffers[id].u32Caps & FramebufferCapabilities_VHWA); 4113 4098 arlock.release(); 4114 4099 4115 if (pFramebuffer == NULL )4100 if (pFramebuffer == NULL || !fVHWASupported) 4116 4101 return VERR_NOT_IMPLEMENTED; /* Implementation is not available. */ 4117 4102
Note:
See TracChangeset
for help on using the changeset viewer.