Changeset 51552 in vbox for trunk/src/VBox/Main
- Timestamp:
- Jun 5, 2014 12:33:13 PM (11 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/DisplayImpl.h
r51551 r51552 193 193 int notifyCroglResize(const PVBVAINFOVIEW pView, const PVBVAINFOSCREEN pScreen, void *pvVRAM); 194 194 195 IFramebuffer *getFramebuffer()196 {197 return maFramebuffers[VBOX_VIDEO_PRIMARY_SCREEN].pFramebuffer;198 }199 195 void getFramebufferDimensions(int32_t *px1, int32_t *py1, int32_t *px2, int32_t *py2); 200 196 int getScreenResolution(uint32_t cScreen, ULONG *pcx, ULONG *pcy, … … 229 225 STDMETHOD(QueryFramebuffer)(ULONG aScreenId, 230 226 IFramebuffer **aFramebuffer); 231 STDMETHOD(GetFramebuffer)(ULONG aScreenId, IFramebuffer **aFramebuffer, LONG *aXOrigin, LONG *aYOrigin);232 227 STDMETHOD(SetVideoModeHint)(ULONG aDisplay, BOOL aEnabled, BOOL aChangeOrigin, LONG aOriginX, LONG aOriginY, ULONG aWidth, ULONG aHeight, ULONG aBitsPerPixel); 233 228 STDMETHOD(TakeScreenShot)(ULONG aScreenId, BYTE *address, ULONG width, ULONG height); … … 250 245 HRESULT querySourceBitmap(ULONG aScreenId, 251 246 IDisplaySourceBitmap **ppDisplaySourceBitmap); 252 int updateDisplayData(void);253 247 254 248 #ifdef VBOX_WITH_CRHGSMI -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r51525 r51552 7366 7366 LogFlowThisFunc(("Stopping VRDP server...\n")); 7367 7367 7368 /* Leave the lock since EMT will call us back as addVMCaller() 7369 * in updateDisplayData(). */ 7368 /* Leave the lock since EMT could call us back as addVMCaller() */ 7370 7369 alock.release(); 7371 7370 -
trunk/src/VBox/Main/src-client/DisplayImpl.cpp
r51551 r51552 2527 2527 if (mpDrv) 2528 2528 { 2529 /* Setup the new framebuffer , the resize will lead to an updateDisplayData call. */2529 /* Setup the new framebuffer. */ 2530 2530 2531 2531 #if defined(VBOX_WITH_CROGL) … … 2624 2624 if (!pFBInfo->pFramebuffer.isNull()) 2625 2625 pFBInfo->pFramebuffer->AddRef(); 2626 2627 return S_OK;2628 }2629 2630 STDMETHODIMP Display::GetFramebuffer(ULONG aScreenId,2631 IFramebuffer **aFramebuffer, LONG *aXOrigin, LONG *aYOrigin)2632 {2633 LogRelFlowFunc(("aScreenId=%ld\n", aScreenId));2634 2635 CheckComArgOutPointerValid(aFramebuffer);2636 2637 AutoCaller autoCaller(this);2638 if (FAILED(autoCaller.rc())) return autoCaller.rc();2639 2640 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);2641 2642 if (aScreenId != 0 && aScreenId >= mcMonitors)2643 return E_INVALIDARG;2644 2645 /** @todo This should be actually done on EMT. */2646 DISPLAYFBINFO *pFBInfo = &maFramebuffers[aScreenId];2647 AssertPtr(pFBInfo);2648 2649 *aFramebuffer = pFBInfo->pFramebuffer; /** @todo r=andy Race prone? Use a ComPtr instead? */2650 if (*aFramebuffer)2651 (*aFramebuffer)->AddRef();2652 if (aXOrigin)2653 *aXOrigin = pFBInfo->xOrigin;2654 if (aYOrigin)2655 *aYOrigin = pFBInfo->yOrigin;2656 2626 2657 2627 return S_OK; … … 3779 3749 } 3780 3750 3781 /**3782 * Helper to update the display information from the framebuffer.3783 *3784 * @thread EMT3785 */3786 int Display::updateDisplayData(void)3787 {3788 LogRelFlowFunc(("\n"));3789 3790 /* the driver might not have been constructed yet */3791 if (!mpDrv)3792 return VINF_SUCCESS;3793 3794 #ifdef VBOX_STRICT3795 /*3796 * Sanity check. Note that this method may be called on EMT after Console3797 * has started the power down procedure (but before our #drvDestruct() is3798 * called, in which case pVM will already be NULL but mpDrv will not). Since3799 * we don't really need pVM to proceed, we avoid this check in the release3800 * build to save some ms (necessary to construct SafeVMPtrQuiet) in this3801 * time-critical method.3802 */3803 Console::SafeVMPtrQuiet ptrVM(mParent);3804 if (ptrVM.isOk())3805 {3806 PVM pVM = VMR3GetVM(ptrVM.rawUVM());3807 Assert(VM_IS_EMT(pVM));3808 }3809 #endif3810 3811 /* The method is only relevant to the primary framebuffer. */3812 IFramebuffer *pFramebuffer = maFramebuffers[VBOX_VIDEO_PRIMARY_SCREEN].pFramebuffer;3813 3814 if (pFramebuffer)3815 {3816 HRESULT rc;3817 BYTE *address = 0;3818 rc = pFramebuffer->COMGETTER(Address) (&address);3819 AssertComRC (rc);3820 ULONG bytesPerLine = 0;3821 rc = pFramebuffer->COMGETTER(BytesPerLine) (&bytesPerLine);3822 AssertComRC (rc);3823 ULONG bitsPerPixel = 0;3824 rc = pFramebuffer->COMGETTER(BitsPerPixel) (&bitsPerPixel);3825 AssertComRC (rc);3826 ULONG width = 0;3827 rc = pFramebuffer->COMGETTER(Width) (&width);3828 AssertComRC (rc);3829 ULONG height = 0;3830 rc = pFramebuffer->COMGETTER(Height) (&height);3831 AssertComRC (rc);3832 3833 if ( (width != mLastWidth && mLastWidth != 0)3834 || (height != mLastHeight && mLastHeight != 0))3835 {3836 LogRel(("updateDisplayData: size mismatch w %d(%d) h %d(%d)\n",3837 width, mLastWidth, height, mLastHeight));3838 return VERR_INVALID_STATE;3839 }3840 3841 mpDrv->IConnector.pu8Data = (uint8_t *) address;3842 mpDrv->IConnector.cbScanline = bytesPerLine;3843 mpDrv->IConnector.cBits = bitsPerPixel;3844 mpDrv->IConnector.cx = width;3845 mpDrv->IConnector.cy = height;3846 }3847 else3848 {3849 /* black hole */3850 mpDrv->IConnector.pu8Data = NULL;3851 mpDrv->IConnector.cbScanline = 0;3852 mpDrv->IConnector.cBits = 0;3853 mpDrv->IConnector.cx = 0;3854 mpDrv->IConnector.cy = 0;3855 }3856 LogRelFlowFunc(("leave\n"));3857 return VINF_SUCCESS;3858 }3859 3860 3751 #if defined(VBOX_WITH_HGCM) && defined(VBOX_WITH_CROGL) 3861 3752 int Display::crViewportNotify(ULONG aScreenId, ULONG x, ULONG y, ULONG width, ULONG height) … … 3969 3860 if (that->mpDrv) 3970 3861 { 3971 /* Setup the new framebuffer , the resize will lead to an updateDisplayData call. */3862 /* Setup the new framebuffer. */ 3972 3863 DISPLAYFBINFO *pFBInfo = &that->maFramebuffers[uScreenId]; 3973 3864
Note:
See TracChangeset
for help on using the changeset viewer.