Changeset 22675 in vbox
- Timestamp:
- Sep 1, 2009 2:50:32 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBQGL.cpp
r22652 r22675 2889 2889 new VBoxRepaintEvent (aX, aY, aW, aH)); 2890 2890 #else 2891 vboxWidget()->postCmd(VBOXVHWA_PIPECMD_PAINT, &QRect(aX, aY, aW, aH)); 2891 QRect r(aX, aY, aW, aH); 2892 vboxWidget()->postCmd(VBOXVHWA_PIPECMD_PAINT, &r); 2892 2893 #endif 2893 2894 return S_OK; … … 2949 2950 VBoxGLWidget::VBoxGLWidget (VBoxConsoleView *aView, QWidget *aParent) 2950 2951 : QGLWidget (VBoxGLWidget::vboxGLFormat(), aParent), 2952 mSurfHandleTable(128), /* 128 should be enough */ 2953 mpfnOp(NULL), 2954 mOpContext(NULL), 2951 2955 mPixelFormat(0), 2952 2956 mUsesGuestVRAM(false), … … 2954 2958 mView(aView), 2955 2959 mConstructingList(NULL), 2956 mcRemaining2Contruct(0), 2957 mpfnOp(NULL), 2958 mSurfHandleTable(128) /* 128 should be enough */ 2960 mcRemaining2Contruct(0) 2959 2961 { 2960 2962 cmdPipeInit(); … … 3169 3171 void VBoxGLWidget::vboxDoProcessVHWACommands(void *pContext) 3170 3172 { 3173 Q_UNUSED(pContext); 3171 3174 VBoxVHWACommandElement * pFirst = detachCmdList(NULL, NULL); 3172 3175 do … … 3215 3218 vboxDoVHWACmdExec(cmd); 3216 3219 3217 delete cmd;3220 free(cmd); 3218 3221 } 3219 3222 … … 3472 3475 if(pCmd->SurfInfo.PixelFormat.flags & VBOXVHWA_PF_RGB) 3473 3476 { 3474 3477 VBoxVHWAColorFormat format(pCmd->SurfInfo.PixelFormat.c.rgbBitCount, 3475 3478 pCmd->SurfInfo.PixelFormat.m1.rgbRBitMask, 3476 3479 pCmd->SurfInfo.PixelFormat.m2.rgbGBitMask, 3477 3480 pCmd->SurfInfo.PixelFormat.m3.rgbBBitMask); 3478 surf = new VBoxVHWASurfaceBase(this, &QSize(pCmd->SurfInfo.width, pCmd->SurfInfo.height), 3479 // ((pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_OVERLAY) ? mDisplay.getPrimary()->rect().size() : &QSize(pCmd->SurfInfo.width, pCmd->SurfInfo.height)), 3480 &mDisplay.getPrimary()->rect().size(), 3481 QSize surfSize(pCmd->SurfInfo.width, pCmd->SurfInfo.height); 3482 QSize primarySize = mDisplay.getPrimary()->rect().size(); 3483 surf = new VBoxVHWASurfaceBase(this, &surfSize, 3484 // ((pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_OVERLAY) ? mDisplay.getPrimary()->rect().size() : &surfSize), 3485 &primarySize, 3481 3486 format, 3482 3487 pSrcBltCKey, pDstBltCKey, pSrcOverlayCKey, pDstOverlayCKey, … … 3485 3490 else if(pCmd->SurfInfo.PixelFormat.flags & VBOXVHWA_PF_FOURCC) 3486 3491 { 3492 QSize surfSize(pCmd->SurfInfo.width, pCmd->SurfInfo.height); 3493 QSize primarySize = mDisplay.getPrimary()->rect().size(); 3494 3487 3495 VBoxVHWAColorFormat format(pCmd->SurfInfo.PixelFormat.fourCC); 3488 surf = new VBoxVHWASurfaceBase(this, & QSize(pCmd->SurfInfo.width, pCmd->SurfInfo.height),3496 surf = new VBoxVHWASurfaceBase(this, &surfSize, 3489 3497 // ((pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_OVERLAY) ? mDisplay.getPrimary()->rect().size() : &QSize(pCmd->SurfInfo.width, pCmd->SurfInfo.height)), 3490 & mDisplay.getPrimary()->rect().size(),3498 &primarySize, 3491 3499 format, 3492 3500 pSrcBltCKey, pDstBltCKey, pSrcOverlayCKey, pDstOverlayCKey, … … 3657 3665 { 3658 3666 /**/ 3667 Q_UNUSED(pCmd); 3659 3668 return VERR_NOT_IMPLEMENTED; 3660 3669 // VBoxVHWASurfaceBase *pDstSurf = (VBoxVHWASurfaceBase*)pCmd->u.in.hDstSurf; … … 3754 3763 * i.e. 3755 3764 * 1. indicate the value is overridden (no matter what we write here, bu it should be not NULL)*/ 3756 pSrcSurf->setOverriddenDstOverlayCKey(&VBoxVHWAColorKey(0, 0)); 3765 VBoxVHWAColorKey dummyCKey(0, 0); 3766 pSrcSurf->setOverriddenDstOverlayCKey(&dummyCKey); 3757 3767 /* tell the ckey is disabled */ 3758 3768 pSrcSurf->setDefaultDstOverlayCKey(NULL); … … 3767 3777 { 3768 3778 VBOXQGLLOG((", KEYSRCOVERRIDE")); 3769 pSrcSurf->setOverriddenSrcOverlayCKey(&VBoxVHWAColorKey(pCmd->u.in.desc.SrcCK.high, pCmd->u.in.desc.SrcCK.low)); 3779 VBoxVHWAColorKey ckey(pCmd->u.in.desc.SrcCK.high, pCmd->u.in.desc.SrcCK.low); 3780 pSrcSurf->setOverriddenSrcOverlayCKey(&ckey); 3770 3781 } 3771 3782 else … … 3879 3890 const SurfList & surfaces = pList->surfaces(); 3880 3891 3892 QPoint pos(pCmd->u.in.xPos, pCmd->u.in.yPos); 3893 3881 3894 for (SurfList::const_iterator it = surfaces.begin(); 3882 3895 it != surfaces.end(); ++ it) 3883 3896 { 3884 3897 VBoxVHWASurfaceBase *pCurSrcSurf = (*it); 3885 pCurSrcSurf->setTargetRectPosition(pDstSurf, & QPoint(pCmd->u.in.xPos, pCmd->u.in.yPos));;3898 pCurSrcSurf->setTargetRectPosition(pDstSurf, &pos); 3886 3899 } 3887 3900 … … 3900 3913 if(pCmd->u.in.flags & VBOXVHWA_CKEY_DESTBLT) 3901 3914 { 3902 pSurf->setDstBltCKey(&VBoxVHWAColorKey(pCmd->u.in.CKey.high, pCmd->u.in.CKey.low)); 3915 VBoxVHWAColorKey ckey(pCmd->u.in.CKey.high, pCmd->u.in.CKey.low); 3916 pSurf->setDstBltCKey(&ckey); 3903 3917 } 3904 3918 if(pCmd->u.in.flags & VBOXVHWA_CKEY_DESTOVERLAY) 3905 3919 { 3906 pSurf->setDefaultDstOverlayCKey(&VBoxVHWAColorKey(pCmd->u.in.CKey.high, pCmd->u.in.CKey.low)); 3920 VBoxVHWAColorKey ckey(pCmd->u.in.CKey.high, pCmd->u.in.CKey.low); 3921 pSurf->setDefaultDstOverlayCKey(&ckey); 3907 3922 } 3908 3923 if(pCmd->u.in.flags & VBOXVHWA_CKEY_SRCBLT) 3909 3924 { 3910 pSurf->setSrcBltCKey(&VBoxVHWAColorKey(pCmd->u.in.CKey.high, pCmd->u.in.CKey.low)); 3925 VBoxVHWAColorKey ckey(pCmd->u.in.CKey.high, pCmd->u.in.CKey.low); 3926 pSurf->setSrcBltCKey(&ckey); 3911 3927 } 3912 3928 if(pCmd->u.in.flags & VBOXVHWA_CKEY_SRCOVERLAY) 3913 3929 { 3914 pSurf->setDefaultSrcOverlayCKey(&VBoxVHWAColorKey(pCmd->u.in.CKey.high, pCmd->u.in.CKey.low)); 3930 VBoxVHWAColorKey ckey(pCmd->u.in.CKey.high, pCmd->u.in.CKey.low); 3931 pSurf->setDefaultSrcOverlayCKey(&ckey); 3915 3932 } 3916 3933 … … 4037 4054 static DECLCALLBACK(int) vboxQGLLoadExec(PSSMHANDLE pSSM, void *pvUser, uint32_t u32Version, uint32_t uPhase) 4038 4055 { 4056 Q_UNUSED(uPhase); 4039 4057 VBoxGLWidget * pw = (VBoxGLWidget*)pvUser; 4040 4058 return pw->vhwaLoadExec(pSSM, u32Version); … … 4122 4140 int VBoxGLWidget::vhwaLoadSurface(struct SSMHANDLE * pSSM, uint32_t u32Version) 4123 4141 { 4142 Q_UNUSED(u32Version); 4143 4124 4144 VBOXQGL_LOAD_SURFSTART(pSSM); 4125 4145 4126 char *buf = new char[VBOXVHWACMD_SIZE(VBOXVHWACMD_SURF_CREATE)];4146 char *buf = (char*)malloc(VBOXVHWACMD_SIZE(VBOXVHWACMD_SURF_CREATE)); 4127 4147 memset(buf, 0, sizeof(buf)); 4128 4148 VBOXVHWACMD * pCmd = (VBOXVHWACMD*)buf; … … 4271 4291 int VBoxGLWidget::vhwaLoadOverlayData(struct SSMHANDLE * pSSM, uint32_t u32Version) 4272 4292 { 4293 Q_UNUSED(u32Version); 4294 4273 4295 VBOXQGL_LOAD_OVERLAYSTART(pSSM); 4274 4296 … … 4588 4610 void VBoxGLWidget::vboxDoPaint(void *pe) 4589 4611 { 4612 Q_UNUSED(pe); 4613 4590 4614 #ifdef VBOXQGL_DBG_SURF 4591 4615 vboxDoTestSurfaces(NULL); … … 4718 4742 if (!fallback) 4719 4743 { 4720 ulong virtWdt = bitsPerLine / re->bitsPerPixel();4744 // ulong virtWdt = bitsPerLine / re->bitsPerPixel(); 4721 4745 mPixelFormat = FramebufferPixelFormat_FOURCC_RGB; 4722 4746 mUsesGuestVRAM = true;
Note:
See TracChangeset
for help on using the changeset viewer.