equal
deleted
inserted
replaced
247 RWindow* window; |
247 RWindow* window; |
248 window = (RWindow*) aNativeWindow; |
248 window = (RWindow*) aNativeWindow; |
249 TSize size = window->Size(); |
249 TSize size = window->Size(); |
250 |
250 |
251 TSurfaceInfo* surfaceInfo = NULL; |
251 TSurfaceInfo* surfaceInfo = NULL; |
252 TSurfaceId surfaceId; |
|
253 |
252 |
254 RSurfaceManager::TSurfaceCreationAttributesBuf buf; |
253 RSurfaceManager::TSurfaceCreationAttributesBuf buf; |
255 RSurfaceManager::TSurfaceCreationAttributes& attributes = buf(); |
254 RSurfaceManager::TSurfaceCreationAttributes& attributes = buf(); |
256 |
255 |
257 attributes.iSize = size; |
256 attributes.iSize = size; |
279 if (surfaceInfo) |
278 if (surfaceInfo) |
280 { |
279 { |
281 surfaceInfo->iNativeWindow = (RWindow*)aNativeWindow; |
280 surfaceInfo->iNativeWindow = (RWindow*)aNativeWindow; |
282 surfaceInfo->iConfigId = aConfig; |
281 surfaceInfo->iConfigId = aConfig; |
283 surfaceInfo->iSurfaceManager.Open(); |
282 surfaceInfo->iSurfaceManager.Open(); |
284 surfaceInfo->iSurfaceManager.CreateSurface(buf, surfaceId); |
283 surfaceInfo->iSurfaceManager.CreateSurface(buf, surfaceInfo->iSurfaceId); |
285 TInt err = surfaceInfo->iSurfaceManager.MapSurface(surfaceId, surfaceInfo->iChunk); |
284 TInt err = surfaceInfo->iSurfaceManager.MapSurface(surfaceInfo->iSurfaceId, surfaceInfo->iChunk); |
286 EGL_TRACE("CGuestEGL::eglCreateWindowSurface surface manager returned chunk %x and ret val %d", surfaceInfo->iChunk, err); |
285 EGL_TRACE("CGuestEGL::eglCreateWindowSurface surface manager returned chunk %x and ret val %d", surfaceInfo->iChunk, err); |
287 RemoteFunctionCallData rfcdata; |
286 RemoteFunctionCallData rfcdata; |
288 EglRFC eglApiData( rfcdata ); |
287 EglRFC eglApiData( rfcdata ); |
289 eglApiData.Init( EglRFC::EeglCreateWindowSurface); |
288 eglApiData.Init( EglRFC::EeglCreateWindowSurface); |
290 eglApiData.AppendEGLDisplay(aDisplay); |
289 eglApiData.AppendEGLDisplay(aDisplay); |
298 surfaceInfo->iHostSurfaceId = aThreadState.ExecEglSurfaceCmd(eglApiData); // todo check if is valid |
297 surfaceInfo->iHostSurfaceId = aThreadState.ExecEglSurfaceCmd(eglApiData); // todo check if is valid |
299 (*pDispInfo)->iSurfaceMap.Insert(surfaceInfo->iHostSurfaceId, surfaceInfo); |
298 (*pDispInfo)->iSurfaceMap.Insert(surfaceInfo->iHostSurfaceId, surfaceInfo); |
300 EglInternalFunction_CreateSurface(aThreadState, aDisplay, surfaceInfo->iHostSurfaceId, aConfig, window, *surfaceInfo); |
299 EglInternalFunction_CreateSurface(aThreadState, aDisplay, surfaceInfo->iHostSurfaceId, aConfig, window, *surfaceInfo); |
301 surfaceInfo->iSurfaceUpdateSession.Connect(); |
300 surfaceInfo->iSurfaceUpdateSession.Connect(); |
302 TSurfaceConfiguration surfaceConfig; |
301 TSurfaceConfiguration surfaceConfig; |
303 surfaceConfig.SetSurfaceId(surfaceId); |
302 surfaceConfig.SetSurfaceId(surfaceInfo->iSurfaceId); |
304 window->SetBackgroundSurface(surfaceConfig, ETrue); |
303 window->SetBackgroundSurface(surfaceConfig, ETrue); |
305 } |
304 } |
306 CVghwUtils::SwitchFromVghwHeap(threadHeap); |
305 CVghwUtils::SwitchFromVghwHeap(threadHeap); |
307 } |
306 } |
308 |
307 |
1232 TBool CGuestEGL::EglInternalFunction_CreateSurface(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLSurface aSurface, EGLConfig aConfig, RWindow* aNativeWindow, |
1231 TBool CGuestEGL::EglInternalFunction_CreateSurface(TEglThreadState& aThreadState, EGLDisplay aDisplay, EGLSurface aSurface, EGLConfig aConfig, RWindow* aNativeWindow, |
1233 TSurfaceInfo& aSurfaceInfo) |
1232 TSurfaceInfo& aSurfaceInfo) |
1234 { |
1233 { |
1235 RSurfaceManager::TSurfaceCreationAttributesBuf attributes; |
1234 RSurfaceManager::TSurfaceCreationAttributesBuf attributes; |
1236 RSurfaceManager::TInfoBuf info; |
1235 RSurfaceManager::TInfoBuf info; |
|
1236 TInt r; |
1237 |
1237 |
1238 aSurfaceInfo.iNativeWindow = aNativeWindow; |
1238 aSurfaceInfo.iNativeWindow = aNativeWindow; |
1239 aSurfaceInfo.iSurfaceType = ESurfaceTypeWindow; |
1239 aSurfaceInfo.iSurfaceType = ESurfaceTypeWindow; |
1240 aSurfaceInfo.iSize = aNativeWindow->Size(); |
1240 aSurfaceInfo.iSize = aNativeWindow->Size(); |
1241 aSurfaceInfo.iConfigId = aConfig; |
1241 aSurfaceInfo.iConfigId = aConfig; |
1260 TSize size; |
1260 TSize size; |
1261 |
1261 |
1262 // FAISALMEMON HOLE 1 |
1262 // FAISALMEMON HOLE 1 |
1263 |
1263 |
1264 // FAISALMEMON STUB CODE |
1264 // FAISALMEMON STUB CODE |
1265 TUint8 offsetToFirstBuffer = 0; // This is wrong; just stub code |
1265 |
1266 TUint8 offsetToSecondBuffer = 0; // This is wrong; just stub code |
1266 TInt offsetToFirstBuffer = -1; |
1267 // FAISALMEMON END OF STUB CODE |
1267 TInt offsetToSecondBuffer = -1; |
|
1268 r = aSurfaceInfo.iSurfaceManager.GetBufferOffset(aSurfaceInfo.iSurfaceId,0,offsetToFirstBuffer); |
|
1269 if(r!=KErrNone) |
|
1270 return EGL_FALSE; |
|
1271 r = aSurfaceInfo.iSurfaceManager.GetBufferOffset(aSurfaceInfo.iSurfaceId,1,offsetToSecondBuffer); |
|
1272 if(r!=KErrNone) |
|
1273 return EGL_FALSE; |
|
1274 EGL_TRACE("CGuestEGL::EglInternalFunction_CreateSurface offsetToFirstBuffer=0x%x offsetToSecondBuffer=0x%x",offsetToFirstBuffer,offsetToSecondBuffer); |
|
1275 |
|
1276 // FAISALMEMON END OF STUB CODE |
1268 |
1277 |
1269 TUint32 chunkHWBase = 0; |
1278 TUint32 chunkHWBase = 0; |
1270 TInt err = CVghwUtils::MapToHWAddress(aSurfaceInfo.iChunk.Handle(), chunkHWBase); |
1279 TInt err = CVghwUtils::MapToHWAddress(aSurfaceInfo.iChunk.Handle(), chunkHWBase); |
1271 EGL_TRACE("CGuestEGL::EglInternalFunction_CreateSurface MapToHWAddress returned %d", err); |
1280 EGL_TRACE("CGuestEGL::EglInternalFunction_CreateSurface MapToHWAddress returned %d", err); |
1272 // FAISALMEMON write code to handle errors in the above function |
1281 // FAISALMEMON write code to handle errors in the above function |