- Timestamp:
- Aug 27, 2013 12:30:57 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 88452
- Location:
- trunk/src/VBox
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/include/chromium.h
r46783 r48079 724 724 /* guest requests host whether e debug break is needed*/ 725 725 #define GL_DBG_CHECK_BREAK_CR 0x8B2C 726 /* Tells renderspu the default context id being used by the crserver */ 727 #define GL_HH_SET_DEFAULT_SHARED_CTX 0x8B2D 726 728 727 729 /**********************************************************************/ -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_context.c
r47566 r48079 63 63 cr_server.firstCallCreateContext = GL_FALSE; 64 64 fFirst = GL_TRUE; 65 66 cr_server.head_spu->dispatch_table.ChromiumParameteriCR(GL_HH_SET_DEFAULT_SHARED_CTX, cr_server.MainContextInfo.SpuContext); 65 67 } 66 68 else { … … 71 73 /* the new context needs new visual attributes */ 72 74 cr_server.MainContextInfo.CreateInfo.visualBits |= visualBits; 73 cr Debug("crServerDispatchCreateContext requires new visual (0x%x).",75 crWarning("crServerDispatchCreateContext requires new visual (0x%x).", 74 76 cr_server.MainContextInfo.CreateInfo.visualBits); 75 77 … … 95 97 return -1; 96 98 } 99 100 /* we do not need to clean up the old default context explicitly, since the above cr_server.head_spu->dispatch_table.DestroyContext call 101 * will do that for us */ 102 cr_server.head_spu->dispatch_table.ChromiumParameteriCR(GL_HH_SET_DEFAULT_SHARED_CTX, cr_server.MainContextInfo.SpuContext); 97 103 } 98 104 } -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_misc.c
r46783 r48079 274 274 case GL_HOST_WND_CREATED_HIDDEN_CR: 275 275 cr_server.bWindowsInitiallyHidden = value ? 1 : 0; 276 break; 277 case GL_HH_SET_DEFAULT_SHARED_CTX: 278 crWarning("Recieved GL_HH_SET_DEFAULT_SHARED_CTX from guest, ignoring"); 276 279 break; 277 280 default: -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.c
r47566 r48079 16 16 #include <iprt/asm.h> 17 17 18 uint32_t renderspuContextRelease(ContextInfo *context); 19 uint32_t renderspuContextRetain(ContextInfo *context); 18 20 19 21 static void … … 183 185 184 186 if (sharedContext) 185 ASMAtomicIncU32(&sharedContext->cRefs); 187 renderspuContextRetain(sharedContext); 188 186 189 context->cRefs = 1; 187 190 … … 215 218 } 216 219 217 static uint32_t renderspuContextRelease( ContextInfo *context );218 220 static void renderspuDestroyContextTerminate( ContextInfo *context ) 219 221 { … … 231 233 } 232 234 233 static uint32_t renderspuContextRelease( ContextInfo *context ) 235 uint32_t renderspuContextRetain( ContextInfo *context ) 236 { 237 Assert(context->cRefs); 238 return ASMAtomicIncU32(&context->cRefs); 239 } 240 241 uint32_t renderspuContextRelease( ContextInfo *context ) 234 242 { 235 243 uint32_t cRefs = ASMAtomicDecU32(&context->cRefs); … … 251 259 } 252 260 261 ContextInfo * renderspuDefaultSharedContextAcquire() 262 { 263 ContextInfo * pCtx = render_spu.defaultSharedContext; 264 if (!pCtx) 265 return NULL; 266 267 renderspuContextRetain(pCtx); 268 return pCtx; 269 } 270 271 void renderspuDefaultSharedContextRelease(ContextInfo * pCtx) 272 { 273 renderspuContextRelease(pCtx); 274 } 275 276 253 277 static void RENDER_APIENTRY 254 278 renderspuDestroyContext( GLint ctx ) … … 265 289 266 290 context = (ContextInfo *) crHashtableSearch(render_spu.contextTable, ctx); 267 CRASSERT(context); 268 { 269 if (!context) 270 { 271 crWarning("request to delete inexistent context"); 272 return; 273 } 291 292 if (!context) 293 { 294 crWarning("request to delete inexistent context"); 295 return; 296 } 297 298 if (render_spu.defaultSharedContext == context) 299 { 300 renderspuContextRelease(render_spu.defaultSharedContext); 301 render_spu.defaultSharedContext = NULL; 274 302 } 275 303 … … 748 776 { 749 777 int rc; 750 CR_BLITTER_CONTEXT ctx; 778 ContextInfo * pDefaultCtxInfo; 779 751 780 pBlitter = (PCR_BLITTER)crCalloc(sizeof (*pBlitter)); 752 781 if (!pBlitter) … … 756 785 } 757 786 758 /* @todo: this is the assumption that crserverlib uses context 1 as a default one 759 * need to do it in a more proper way */ 760 ctx.Base.id = 1; 761 ctx.Base.visualBits = window->visual->visAttribs; 762 rc = CrBltInit(pBlitter, &ctx, true, true, render_spu.blitterDispatch); 787 pDefaultCtxInfo = renderspuDefaultSharedContextAcquire(); 788 if (!pDefaultCtxInfo) 789 { 790 crWarning("no default ctx info!"); 791 crFree(pBlitter); 792 return NULL; 793 } 794 795 rc = CrBltInit(pBlitter, &pDefaultCtxInfo->BltInfo, true, true, render_spu.blitterDispatch); 796 797 /* we can release it either way, since it will be retained when used as a shared context */ 798 renderspuDefaultSharedContextRelease(pDefaultCtxInfo); 799 763 800 if (!RT_SUCCESS(rc)) 764 801 { … … 1231 1268 switch (target) 1232 1269 { 1270 case GL_HH_SET_DEFAULT_SHARED_CTX: 1271 if (render_spu.defaultSharedContext) 1272 { 1273 renderspuContextRelease(render_spu.defaultSharedContext); 1274 render_spu.defaultSharedContext = NULL; 1275 } 1276 1277 if (value) 1278 { 1279 render_spu.defaultSharedContext = (ContextInfo *) crHashtableSearch(render_spu.contextTable, value); 1280 if (render_spu.defaultSharedContext) 1281 renderspuContextRetain(render_spu.defaultSharedContext); 1282 else 1283 crWarning("invalid default shared context id %d", value); 1284 } 1285 1286 break; 1233 1287 default: 1234 1288 // crWarning("Unhandled target in renderspuChromiumParameteriCR()"); -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.h
r45577 r48079 258 258 CRHashTable *windowTable; 259 259 CRHashTable *contextTable; 260 261 ContextInfo *defaultSharedContext; 260 262 261 263 #ifndef CHROMIUM_THREADSAFE … … 418 420 extern uint32_t renderspuContextMarkDeletedAndRelease( ContextInfo *context ); 419 421 422 ContextInfo * renderspuDefaultSharedContextAcquire(); 423 void renderspuDefaultSharedContextRelease(ContextInfo * pCtx); 424 uint32_t renderspuContextRelease(ContextInfo *context); 425 uint32_t renderspuContextRetain(ContextInfo *context); 426 420 427 #ifdef __cplusplus 421 428 extern "C" { -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.m
r47566 r48079 1781 1781 { 1782 1782 NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init]; 1783 1784 /* view should not necesserily have a context set 1785 * @todo: check and set default shared one */ 1783 1786 1784 1787 [(OverlayView*)pView presentComposition:pChangedEntry]; -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_init.c
r45132 r48079 446 446 } 447 447 448 if (render_spu.defaultSharedContext) 449 { 450 renderspuContextRelease(render_spu.defaultSharedContext); 451 render_spu.defaultSharedContext = NULL; 452 } 453 448 454 crFreeHashtable(render_spu.contextTable, DeleteContextCallback); 449 455 render_spu.contextTable = NULL;
Note:
See TracChangeset
for help on using the changeset viewer.