Changeset 24867 in vbox
- Timestamp:
- Nov 23, 2009 1:10:38 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp
r24861 r24867 59 59 60 60 #define VBOXQGL_STATE_NAMEBASE "QGLVHWAData" 61 #define VBOXQGL_STATE_VERSION 161 #define VBOXQGL_STATE_VERSION 2 62 62 63 63 #ifdef DEBUG … … 4156 4156 const SurfList & primaryList = mDisplay.primaries().surfaces(); 4157 4157 uint32_t cPrimary = (uint32_t)primaryList.size(); 4158 Assert(cPrimary >= 1);4159 if(mDisplay.getVGA() == NULL || mDisplay.getVGA()->handle() == VBOXVHWA_SURFHANDLE_INVALID)4158 if(cPrimary && 4159 (mDisplay.getVGA() == NULL || mDisplay.getVGA()->handle() == VBOXVHWA_SURFHANDLE_INVALID)) 4160 4160 { 4161 4161 cPrimary -= 1; 4162 4162 } 4163 4163 4164 int rc = SSMR3PutU32(pSSM, cPrimary); AssertRC(rc); 4164 4165 for (SurfList::const_iterator pr = primaryList.begin(); 4166 pr != primaryList.end(); ++ pr) 4167 { 4168 VBoxVHWASurfaceBase *pSurf = *pr; 4169 // bool bVga = (pSurf == mDisplay.getVGA()); 4170 bool bVisible = (pSurf == mDisplay.getPrimary()); 4171 uint32_t flags = VBOXVHWA_SCAPS_PRIMARYSURFACE; 4172 if(bVisible) 4173 flags |= VBOXVHWA_SCAPS_VISIBLE; 4174 4175 if(pSurf->handle() != VBOXVHWA_SURFHANDLE_INVALID) 4176 { 4177 rc = vhwaSaveSurface(pSSM, *pr, flags); AssertRC(rc); 4165 if(cPrimary) 4166 { 4167 for (SurfList::const_iterator pr = primaryList.begin(); 4168 pr != primaryList.end(); ++ pr) 4169 { 4170 VBoxVHWASurfaceBase *pSurf = *pr; 4171 // bool bVga = (pSurf == mDisplay.getVGA()); 4172 bool bVisible = (pSurf == mDisplay.getPrimary()); 4173 uint32_t flags = VBOXVHWA_SCAPS_PRIMARYSURFACE; 4174 if(bVisible) 4175 flags |= VBOXVHWA_SCAPS_VISIBLE; 4176 4177 if(pSurf->handle() != VBOXVHWA_SURFHANDLE_INVALID) 4178 { 4179 rc = vhwaSaveSurface(pSSM, *pr, flags); AssertRC(rc); 4178 4180 #ifdef DEBUG 4179 --cPrimary;4180 Assert(cPrimary < UINT32_MAX / 2);4181 #endif 4182 }4183 else4184 {4185 Assert(pSurf == mDisplay.getVGA());4186 }4187 }4181 --cPrimary; 4182 Assert(cPrimary < UINT32_MAX / 2); 4183 #endif 4184 } 4185 else 4186 { 4187 Assert(pSurf == mDisplay.getVGA()); 4188 } 4189 } 4188 4190 4189 4191 #ifdef DEBUG 4190 Assert(!cPrimary); 4191 #endif 4192 4193 const OverlayList & overlays = mDisplay.overlays(); 4194 rc = SSMR3PutU32(pSSM, (uint32_t)overlays.size()); AssertRC(rc); 4195 4196 for (OverlayList::const_iterator it = overlays.begin(); 4197 it != overlays.end(); ++ it) 4198 { 4199 VBoxVHWASurfList * pSurfList = *it; 4200 const SurfList & surfaces = pSurfList->surfaces(); 4201 uint32_t cSurfs = (uint32_t)surfaces.size(); 4202 uint32_t flags = VBOXVHWA_SCAPS_OVERLAY; 4203 if(cSurfs > 1) 4204 flags |= VBOXVHWA_SCAPS_COMPLEX; 4205 rc = SSMR3PutU32(pSSM, cSurfs); AssertRC(rc); 4206 for (SurfList::const_iterator sit = surfaces.begin(); 4207 sit != surfaces.end(); ++ sit) 4208 { 4209 rc = vhwaSaveSurface(pSSM, *sit, flags); AssertRC(rc); 4210 } 4211 4212 bool bVisible = true; 4213 VBoxVHWASurfaceBase * pOverlayData = pSurfList->current(); 4214 if(!pOverlayData) 4215 { 4216 pOverlayData = surfaces.front(); 4217 bVisible = false; 4218 } 4219 4220 rc = vhwaSaveOverlayData(pSSM, pOverlayData, bVisible); AssertRC(rc); 4192 Assert(!cPrimary); 4193 #endif 4194 4195 const OverlayList & overlays = mDisplay.overlays(); 4196 rc = SSMR3PutU32(pSSM, (uint32_t)overlays.size()); AssertRC(rc); 4197 4198 for (OverlayList::const_iterator it = overlays.begin(); 4199 it != overlays.end(); ++ it) 4200 { 4201 VBoxVHWASurfList * pSurfList = *it; 4202 const SurfList & surfaces = pSurfList->surfaces(); 4203 uint32_t cSurfs = (uint32_t)surfaces.size(); 4204 uint32_t flags = VBOXVHWA_SCAPS_OVERLAY; 4205 if(cSurfs > 1) 4206 flags |= VBOXVHWA_SCAPS_COMPLEX; 4207 rc = SSMR3PutU32(pSSM, cSurfs); AssertRC(rc); 4208 for (SurfList::const_iterator sit = surfaces.begin(); 4209 sit != surfaces.end(); ++ sit) 4210 { 4211 rc = vhwaSaveSurface(pSSM, *sit, flags); AssertRC(rc); 4212 } 4213 4214 bool bVisible = true; 4215 VBoxVHWASurfaceBase * pOverlayData = pSurfList->current(); 4216 if(!pOverlayData) 4217 { 4218 pOverlayData = surfaces.front(); 4219 bVisible = false; 4220 } 4221 4222 rc = vhwaSaveOverlayData(pSSM, pOverlayData, bVisible); AssertRC(rc); 4223 } 4221 4224 } 4222 4225 … … 4245 4248 VBOXQGL_LOAD_START(pSSM); 4246 4249 4250 if(u32Version > VBOXQGL_STATE_VERSION) 4251 return VERR_VERSION_MISMATCH; 4252 4247 4253 int rc; 4248 4254 uint32_t u32; 4249 4255 4250 rc = SSMR3GetU32(pSSM, &u32); AssertRC(rc);4256 rc = vhwaLoadVHWAEnable(pCmdList); AssertRC(rc); 4251 4257 if(RT_SUCCESS(rc)) 4252 4258 { 4253 if(u32) 4254 { 4255 rc = vhwaLoadVHWAEnable(pCmdList); 4256 AssertRC(rc); 4257 } 4258 4259 for(uint32_t i = 0; i < u32; ++i) 4260 { 4261 rc = vhwaLoadSurface(pCmdList, pSSM, 0, u32Version); AssertRC(rc); 4262 if(RT_FAILURE(rc)) 4263 break; 4264 } 4265 4259 rc = SSMR3GetU32(pSSM, &u32); AssertRC(rc); 4266 4260 if(RT_SUCCESS(rc)) 4267 4261 { 4268 rc = SSMR3GetU32(pSSM, &u32); AssertRC(rc); 4269 if(RT_SUCCESS(rc)) 4262 if(u32Version == 1 && u32 == (~0)) /* work around the v1 bug */ 4263 u32 = 0; 4264 if(u32) 4270 4265 { 4271 4266 for(uint32_t i = 0; i < u32; ++i) 4272 4267 { 4273 uint32_t cSurfs; 4274 rc = SSMR3GetU32(pSSM, &cSurfs); AssertRC(rc); 4275 for(uint32_t j = 0; j < cSurfs; ++j) 4276 { 4277 rc = vhwaLoadSurface(pCmdList, pSSM, cSurfs - 1, u32Version); AssertRC(rc); 4278 if(RT_FAILURE(rc)) 4279 break; 4280 } 4281 4268 rc = vhwaLoadSurface(pCmdList, pSSM, 0, u32Version); AssertRC(rc); 4269 if(RT_FAILURE(rc)) 4270 break; 4271 } 4272 4273 if(RT_SUCCESS(rc)) 4274 { 4275 rc = SSMR3GetU32(pSSM, &u32); AssertRC(rc); 4282 4276 if(RT_SUCCESS(rc)) 4283 4277 { 4284 rc = vhwaLoadOverlayData(pCmdList, pSSM, u32Version); AssertRC(rc); 4285 } 4286 4287 if(RT_FAILURE(rc)) 4288 { 4289 break; 4278 for(uint32_t i = 0; i < u32; ++i) 4279 { 4280 uint32_t cSurfs; 4281 rc = SSMR3GetU32(pSSM, &cSurfs); AssertRC(rc); 4282 for(uint32_t j = 0; j < cSurfs; ++j) 4283 { 4284 rc = vhwaLoadSurface(pCmdList, pSSM, cSurfs - 1, u32Version); AssertRC(rc); 4285 if(RT_FAILURE(rc)) 4286 break; 4287 } 4288 4289 if(RT_SUCCESS(rc)) 4290 { 4291 rc = vhwaLoadOverlayData(pCmdList, pSSM, u32Version); AssertRC(rc); 4292 } 4293 4294 if(RT_FAILURE(rc)) 4295 { 4296 break; 4297 } 4298 } 4290 4299 } 4291 4300 } 4292 4301 } 4302 #ifdef VBOXQGL_STATE_DEBUG 4303 else if(u32Version == 1) /* read the 0 overlay count to ensure the following VBOXQGL_LOAD_STOP succeedes */ 4304 { 4305 rc = SSMR3GetU32(pSSM, &u32); AssertRC(rc); 4306 Assert(u32 == 0); 4307 } 4308 #endif 4293 4309 } 4294 4310 }
Note:
See TracChangeset
for help on using the changeset viewer.