Changeset 28279 in vbox for trunk/src/VBox/HostServices/SharedOpenGL/render
- Timestamp:
- Apr 14, 2010 12:52:05 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 60022
- Location:
- trunk/src/VBox/HostServices/SharedOpenGL/render
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.c
r27889 r28279 347 347 { 348 348 renderspuMakeCurrent(0, 0, pCtx->id); 349 } 349 } 350 350 } 351 351 … … 372 372 if (pNewCtx!=pOldCtx) 373 373 { 374 renderspuMakeCurrent(pOldCtx&&pOldCtx->currentWindow ? pOldCtx->currentWindow->id:0, 0, 374 renderspuMakeCurrent(pOldCtx&&pOldCtx->currentWindow ? pOldCtx->currentWindow->id:0, 0, 375 375 pOldCtx ? pOldCtx->id:0); 376 376 } … … 1054 1054 } 1055 1055 1056 #if defined(WINDOWS) || defined(GLX)1057 1056 renderspu_SystemReparentWindow(pWindow); 1058 #endif1059 1057 } 1060 1058 -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.h
r27708 r28279 311 311 312 312 extern GLint RENDER_APIENTRY renderspuWindowCreate( const char *dpyName, GLint visBits ); 313 extern void RENDER_APIENTRY renderspu_SystemReparentWindow(WindowInfo *window); 313 314 extern GLint RENDER_APIENTRY renderspuCreateContext( const char *dpyname, GLint visBits, GLint shareCtx ); 314 315 extern void RENDER_APIENTRY renderspuMakeCurrent(GLint crWindow, GLint nativeWindow, GLint ctx); 315 316 extern void RENDER_APIENTRY renderspuSwapBuffers( GLint window, GLint flags ); 316 317 #if defined(WINDOWS) || defined(GLX)318 extern void renderspu_SystemReparentWindow(WindowInfo *window);319 #endif320 317 321 318 #ifdef __cplusplus -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_agl.c
r24378 r28279 428 428 } 429 429 430 void renderspu_SystemReparentWindow(WindowInfo *) 431 { 432 /* stub only */ 433 } 434 430 435 void 431 436 renderspu_SystemDestroyWindow(WindowInfo *window) -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa.c
r26229 r28279 96 96 } 97 97 98 void renderspu_SystemDestroyWindow(WindowInfo *pWinInfo) 99 { 100 CRASSERT(pWinInfo); 101 102 cocoaViewDestroy(pWinInfo->window); 103 } 104 105 void renderspu_SystemWindowPosition(WindowInfo *pWinInfo, GLint x, GLint y) 106 { 107 CRASSERT(pWinInfo); 108 98 void renderspu_SystemReparentWindow(WindowInfo *pWinInfo) 99 { 109 100 #ifdef __LP64__ 110 101 NativeViewRef pParentWin = (NativeViewRef)render_spu_parent_window_id; … … 112 103 NativeViewRef pParentWin = (NativeViewRef)(uint32_t)render_spu_parent_window_id; 113 104 #endif /* __LP64__ */ 105 cocoaViewReparent(pWinInfo->window, pParentWin); 106 } 107 108 void renderspu_SystemDestroyWindow(WindowInfo *pWinInfo) 109 { 110 CRASSERT(pWinInfo); 111 112 cocoaViewDestroy(pWinInfo->window); 113 } 114 115 void renderspu_SystemWindowPosition(WindowInfo *pWinInfo, GLint x, GLint y) 116 { 117 CRASSERT(pWinInfo); 118 119 #ifdef __LP64__ 120 NativeViewRef pParentWin = (NativeViewRef)render_spu_parent_window_id; 121 #else /* __LP64__ */ 122 NativeViewRef pParentWin = (NativeViewRef)(uint32_t)render_spu_parent_window_id; 123 #endif /* __LP64__ */ 114 124 115 125 cocoaViewSetPosition(pWinInfo->window, pParentWin, x, y); -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.h
r23491 r28279 43 43 /* View management */ 44 44 void cocoaViewCreate(NativeViewRef *ppView, NativeViewRef pParentView, GLbitfield fVisParams); 45 void cocoaViewReparent(NativeViewRef pView, NativeViewRef pParentView); 45 46 void cocoaViewDestroy(NativeViewRef pView); 46 47 void cocoaViewDisplay(NativeViewRef pView); -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.m
r25293 r28279 138 138 @private 139 139 NSView *m_pParentView; 140 NSWindow *m_pOverlayWin; 140 141 141 142 NSOpenGLContext *m_pGLCtx; … … 172 173 - (void)setGLCtx:(NSOpenGLContext*)pCtx; 173 174 - (NSOpenGLContext*)glCtx; 175 176 - (void)setParentView: (NSView*)view; 177 - (NSView*)parentView; 178 - (void)setOverlayWin: (NSWindow*)win; 179 - (NSWindow*)overlayWin; 174 180 175 181 - (void)setPos:(NSPoint)pos; … … 299 305 [self cleanup]; 300 306 301 /* Create a buffer for our thumbnail image. Its in the size of this view. */ 302 m_ThumbBitmap = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL 303 pixelsWide:frame.size.width 304 pixelsHigh:frame.size.height 305 bitsPerSample:8 306 samplesPerPixel:4 307 hasAlpha:YES 308 isPlanar:NO 309 colorSpaceName:NSDeviceRGBColorSpace 310 bytesPerRow:frame.size.width * 4 311 bitsPerPixel:8 * 4]; 312 m_ThumbImage = [[NSImage alloc] initWithSize:[m_ThumbBitmap size]]; 313 [m_ThumbImage addRepresentation:m_ThumbBitmap]; 307 if ( frame.size.width > 0 308 && frame.size.height > 0) 309 { 310 /* Create a buffer for our thumbnail image. Its in the size of this view. */ 311 m_ThumbBitmap = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL 312 pixelsWide:frame.size.width 313 pixelsHigh:frame.size.height 314 bitsPerSample:8 315 samplesPerPixel:4 316 hasAlpha:YES 317 isPlanar:NO 318 colorSpaceName:NSDeviceRGBColorSpace 319 bytesPerRow:frame.size.width * 4 320 bitsPerPixel:8 * 4]; 321 m_ThumbImage = [[NSImage alloc] initWithSize:[m_ThumbBitmap size]]; 322 [m_ThumbImage addRepresentation:m_ThumbBitmap]; 323 } 314 324 [self unlock]; 315 325 } … … 447 457 m_pOverlayView = pOverlayView; 448 458 m_Thread = [NSThread currentThread]; 459 460 [m_pOverlayView setOverlayWin: self]; 449 461 450 462 m_pOverlayHelperView = [[OverlayHelperView alloc] initWithOverlayWindow:self]; … … 606 618 } 607 619 620 - (NSView*)parentView 621 { 622 return m_pParentView; 623 } 624 625 - (void)setParentView: (NSView*)view 626 { 627 m_pParentView = view; 628 } 629 630 - (void)setOverlayWin: (NSWindow*)win 631 { 632 m_pOverlayWin = win; 633 } 634 635 - (NSWindow*)overlayWin 636 { 637 return m_pOverlayWin; 638 } 639 608 640 - (void)setPos:(NSPoint)pos 609 641 { … … 1026 1058 [m_DockTileView thumbBitmap] != nil) 1027 1059 { 1028 /* Only update after at least 200 ms, cause glReadPixels is1060 /* Only update after at least 200 ms, cause glReadPixels is 1029 1061 * heavy performance wise. */ 1030 1062 uint64_t uiNewTime = RTTimeMilliTS(); … … 1306 1338 } 1307 1339 1340 void cocoaViewReparent(NativeViewRef pView, NativeViewRef pParentView) 1341 { 1342 NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init]; 1343 1344 OverlayView* pOView = (OverlayView*)pView; 1345 1346 if (pOView) 1347 { 1348 /* Make sure the window is removed from any previous parent window. */ 1349 [[[pOView overlayWin] parentWindow] removeChildWindow:[pOView overlayWin]]; 1350 /* Set the new parent view */ 1351 [pOView setParentView: pParentView]; 1352 /* Add the overlay window as a child to the new parent window */ 1353 [[pParentView window] addChildWindow:[pOView overlayWin] ordered:NSWindowAbove]; 1354 } 1355 1356 [pPool release]; 1357 } 1358 1308 1359 void cocoaViewDestroy(NativeViewRef pView) 1309 1360 {
Note:
See TracChangeset
for help on using the changeset viewer.