VirtualBox

source: vbox/trunk/src/VBox/Additions/common/crOpenGL/context.c@ 51255

最後變更 在這個檔案從51255是 49214,由 vboxsync 提交於 11 年 前

Additions/linux/3d: do not use a separate display connection to get damage information - thank you Sam Spilsbury.

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id
檔案大小: 40.8 KB
 
1/* Copyright (c) 2001, Stanford University
2 * All rights reserved
3 *
4 * See the file LICENSE.txt for information on redistributing this software.
5 */
6
7/**
8 * \mainpage OpenGL_stub
9 *
10 * \section OpenGL_stubIntroduction Introduction
11 *
12 * Chromium consists of all the top-level files in the cr
13 * directory. The OpenGL_stub module basically takes care of API dispatch,
14 * and OpenGL state management.
15 *
16 */
17
18/**
19 * This file manages OpenGL rendering contexts in the faker library.
20 * The big issue is switching between Chromium and native GL context
21 * management. This is where we support multiple client OpenGL
22 * windows. Typically, one window is handled by Chromium while any
23 * other windows are handled by the native OpenGL library.
24 */
25
26#include "chromium.h"
27#include "cr_error.h"
28#include "cr_spu.h"
29#include "cr_mem.h"
30#include "cr_string.h"
31#include "cr_environment.h"
32#include "stub.h"
33
34/**
35 * This function should be called from MakeCurrent(). It'll detect if
36 * we're in a multi-thread situation, and do the right thing for dispatch.
37 */
38#ifdef CHROMIUM_THREADSAFE
39 static void
40stubCheckMultithread( void )
41{
42 static unsigned long knownID;
43 static GLboolean firstCall = GL_TRUE;
44
45 if (stub.threadSafe)
46 return; /* nothing new, nothing to do */
47
48 if (firstCall) {
49 knownID = crThreadID();
50 firstCall = GL_FALSE;
51 }
52 else if (knownID != crThreadID()) {
53 /* going thread-safe now! */
54 stub.threadSafe = GL_TRUE;
55 crSPUCopyDispatchTable(&glim, &stubThreadsafeDispatch);
56 }
57}
58#endif
59
60
61/**
62 * Install the given dispatch table as the table used for all gl* calls.
63 */
64 static void
65stubSetDispatch( SPUDispatchTable *table )
66{
67 CRASSERT(table);
68
69#ifdef CHROMIUM_THREADSAFE
70 /* always set the per-thread dispatch pointer */
71 crSetTSD(&stub.dispatchTSD, (void *) table);
72 if (stub.threadSafe) {
73 /* Do nothing - the thread-safe dispatch functions will call GetTSD()
74 * to get a pointer to the dispatch table, and jump through it.
75 */
76 }
77 else
78#endif
79 {
80 /* Single thread mode - just install the caller's dispatch table */
81 /* This conditional is an optimization to try to avoid unnecessary
82 * copying. It seems to work with atlantis, multiwin, etc. but
83 * _could_ be a problem. (Brian)
84 */
85 if (glim.copy_of != table->copy_of)
86 crSPUCopyDispatchTable(&glim, table);
87 }
88}
89
90void stubForcedFlush(GLint con)
91{
92#if 0
93 GLint buffer;
94 stub.spu->dispatch_table.GetIntegerv(GL_DRAW_BUFFER, &buffer);
95 stub.spu->dispatch_table.DrawBuffer(GL_FRONT);
96 stub.spu->dispatch_table.Flush();
97 stub.spu->dispatch_table.DrawBuffer(buffer);
98#else
99 if (con)
100 {
101 stub.spu->dispatch_table.VBoxConFlush(con);
102 }
103 else
104 {
105 stub.spu->dispatch_table.Flush();
106 }
107#endif
108}
109
110void stubConChromiumParameteriCR(GLint con, GLenum param, GLint value)
111{
112 if (con)
113 stub.spu->dispatch_table.VBoxConChromiumParameteriCR(con, param, value);
114 else
115 crError("VBoxConChromiumParameteriCR called with null connection");
116}
117
118void stubConFlush(GLint con)
119{
120 if (con)
121 stub.spu->dispatch_table.VBoxConFlush(con);
122 else
123 crError("stubConFlush called with null connection");
124}
125
126static void stubWindowCleanupForContextsCB(unsigned long key, void *data1, void *data2)
127{
128 ContextInfo *context = (ContextInfo *) data1;
129
130 CRASSERT(context);
131
132 if (context->currentDrawable == data2)
133 context->currentDrawable = NULL;
134}
135
136void stubDestroyWindow( GLint con, GLint window )
137{
138 WindowInfo *winInfo = (WindowInfo *)
139 crHashtableSearch(stub.windowTable, (unsigned int) window);
140 if (winInfo && winInfo->type == CHROMIUM && stub.spu)
141 {
142 crHashtableLock(stub.windowTable);
143
144 stub.spu->dispatch_table.VBoxWindowDestroy(con, winInfo->spuWindow );
145
146#ifdef WINDOWS
147 if (winInfo->hVisibleRegion != INVALID_HANDLE_VALUE)
148 {
149 DeleteObject(winInfo->hVisibleRegion);
150 }
151#elif defined(GLX)
152 if (winInfo->pVisibleRegions)
153 {
154 XFree(winInfo->pVisibleRegions);
155 }
156# ifdef CR_NEWWINTRACK
157 if (winInfo->syncDpy)
158 {
159 XCloseDisplay(winInfo->syncDpy);
160 }
161# endif
162#endif
163
164 stubForcedFlush(con);
165
166 crHashtableWalk(stub.contextTable, stubWindowCleanupForContextsCB, winInfo);
167
168 crHashtableDelete(stub.windowTable, window, crFree);
169
170 crHashtableUnlock(stub.windowTable);
171 }
172}
173
174/**
175 * Create a new _Chromium_ window, not GLX, WGL or CGL.
176 * Called by crWindowCreate() only.
177 */
178 GLint
179stubNewWindow( const char *dpyName, GLint visBits )
180{
181 WindowInfo *winInfo;
182 GLint spuWin, size[2];
183
184 spuWin = stub.spu->dispatch_table.WindowCreate( dpyName, visBits );
185 if (spuWin < 0) {
186 return -1;
187 }
188
189 winInfo = (WindowInfo *) crCalloc(sizeof(WindowInfo));
190 if (!winInfo) {
191 stub.spu->dispatch_table.WindowDestroy(spuWin);
192 return -1;
193 }
194
195 winInfo->type = CHROMIUM;
196
197 /* Ask the head SPU for the initial window size */
198 size[0] = size[1] = 0;
199 stub.spu->dispatch_table.GetChromiumParametervCR(GL_WINDOW_SIZE_CR, 0, GL_INT, 2, size);
200 if (size[0] == 0 && size[1] == 0) {
201 /* use some reasonable defaults */
202 size[0] = size[1] = 512;
203 }
204 winInfo->width = size[0];
205 winInfo->height = size[1];
206#ifdef VBOX_WITH_WDDM
207 if (stub.bRunningUnderWDDM)
208 {
209 crError("Should not be here: WindowCreate/Destroy & VBoxPackGetInjectID require connection id!");
210 winInfo->mapped = 0;
211 }
212 else
213#endif
214 {
215 winInfo->mapped = 1;
216 }
217
218 if (!dpyName)
219 dpyName = "";
220
221 crStrncpy(winInfo->dpyName, dpyName, MAX_DPY_NAME);
222 winInfo->dpyName[MAX_DPY_NAME-1] = 0;
223
224 /* Use spuWin as the hash table index and GLX/WGL handle */
225#ifdef WINDOWS
226 winInfo->drawable = (HDC) spuWin;
227 winInfo->hVisibleRegion = INVALID_HANDLE_VALUE;
228#elif defined(Darwin)
229 winInfo->drawable = (CGSWindowID) spuWin;
230#elif defined(GLX)
231 winInfo->drawable = (GLXDrawable) spuWin;
232 winInfo->pVisibleRegions = NULL;
233 winInfo->cVisibleRegions = 0;
234#endif
235#ifdef CR_NEWWINTRACK
236 winInfo->u32ClientID = stub.spu->dispatch_table.VBoxPackGetInjectID(0);
237#endif
238 winInfo->spuWindow = spuWin;
239
240 crHashtableAdd(stub.windowTable, (unsigned int) spuWin, winInfo);
241
242 return spuWin;
243}
244
245#ifdef GLX
246static XErrorHandler oldErrorHandler;
247static unsigned char lastXError = Success;
248
249static int
250errorHandler (Display *dpy, XErrorEvent *e)
251{
252 lastXError = e->error_code;
253 return 0;
254}
255#endif
256
257GLboolean
258stubIsWindowVisible(WindowInfo *win)
259{
260#if defined(WINDOWS)
261# ifdef VBOX_WITH_WDDM
262 if (stub.bRunningUnderWDDM)
263 return win->mapped;
264# endif
265 return GL_TRUE;
266#elif defined(Darwin)
267 return GL_TRUE;
268#elif defined(GLX)
269 Display *dpy = stubGetWindowDisplay(win);
270 if (dpy)
271 {
272 XWindowAttributes attr;
273 XLOCK(dpy);
274 XGetWindowAttributes(dpy, win->drawable, &attr);
275 XUNLOCK(dpy);
276
277 if (attr.map_state == IsUnmapped)
278 {
279 return GL_FALSE;
280 }
281# if 1
282 return GL_TRUE;
283# else
284 if (attr.override_redirect)
285 {
286 return GL_TRUE;
287 }
288
289 if (!stub.bXExtensionsChecked)
290 {
291 stubCheckXExtensions(win);
292 }
293
294 if (!stub.bHaveXComposite)
295 {
296 return GL_TRUE;
297 }
298 else
299 {
300 Pixmap p;
301
302 crLockMutex(&stub.mutex);
303
304 XLOCK(dpy);
305 XSync(dpy, false);
306 oldErrorHandler = XSetErrorHandler(errorHandler);
307 /*@todo this will create new pixmap for window every call*/
308 p = XCompositeNameWindowPixmap(dpy, win->drawable);
309 XSync(dpy, false);
310 XSetErrorHandler(oldErrorHandler);
311 XUNLOCK(dpy);
312
313 switch (lastXError)
314 {
315 case Success:
316 XFreePixmap(dpy, p);
317 crUnlockMutex(&stub.mutex);
318 return GL_FALSE;
319 break;
320 case BadMatch:
321 /*Window isn't redirected*/
322 lastXError = Success;
323 break;
324 default:
325 crWarning("Unexpected XError %i", (int)lastXError);
326 lastXError = Success;
327 }
328
329 crUnlockMutex(&stub.mutex);
330
331 return GL_TRUE;
332 }
333# endif
334 }
335 else {
336 /* probably created by crWindowCreate() */
337 return win->mapped;
338 }
339#endif
340}
341
342
343/**
344 * Given a Windows HDC or GLX Drawable, return the corresponding
345 * WindowInfo structure. Create a new one if needed.
346 */
347WindowInfo *
348#ifdef WINDOWS
349 stubGetWindowInfo( HDC drawable )
350#elif defined(Darwin)
351 stubGetWindowInfo( CGSWindowID drawable )
352#elif defined(GLX)
353stubGetWindowInfo( Display *dpy, GLXDrawable drawable )
354#endif
355{
356#ifndef WINDOWS
357 WindowInfo *winInfo = (WindowInfo *) crHashtableSearch(stub.windowTable, (unsigned int) drawable);
358#else
359 WindowInfo *winInfo;
360 HWND hwnd;
361 hwnd = WindowFromDC(drawable);
362
363 if (!hwnd)
364 {
365 return NULL;
366 }
367
368 winInfo = (WindowInfo *) crHashtableSearch(stub.windowTable, (unsigned int) hwnd);
369#endif
370 if (!winInfo) {
371 winInfo = (WindowInfo *) crCalloc(sizeof(WindowInfo));
372 if (!winInfo)
373 return NULL;
374#ifdef GLX
375 crStrncpy(winInfo->dpyName, DisplayString(dpy), MAX_DPY_NAME);
376 winInfo->dpyName[MAX_DPY_NAME-1] = 0;
377 winInfo->dpy = dpy;
378 winInfo->pVisibleRegions = NULL;
379#elif defined(Darwin)
380 winInfo->connection = _CGSDefaultConnection(); // store our connection as default
381#elif defined(WINDOWS)
382 winInfo->hVisibleRegion = INVALID_HANDLE_VALUE;
383 winInfo->hWnd = hwnd;
384#endif
385 winInfo->drawable = drawable;
386 winInfo->type = UNDECIDED;
387 winInfo->spuWindow = -1;
388#ifdef VBOX_WITH_WDDM
389 if (stub.bRunningUnderWDDM)
390 winInfo->mapped = 0;
391 else
392#endif
393 {
394 winInfo->mapped = -1; /* don't know */
395 }
396 winInfo->pOwner = NULL;
397#ifdef CR_NEWWINTRACK
398 winInfo->u32ClientID = -1;
399#endif
400#ifndef WINDOWS
401 crHashtableAdd(stub.windowTable, (unsigned int) drawable, winInfo);
402#else
403 crHashtableAdd(stub.windowTable, (unsigned int) hwnd, winInfo);
404#endif
405 }
406#ifdef WINDOWS
407 else
408 {
409 winInfo->drawable = drawable;
410 }
411#endif
412 return winInfo;
413}
414
415static void stubWindowCheckOwnerCB(unsigned long key, void *data1, void *data2);
416
417static void
418stubContextFree( ContextInfo *context )
419{
420 crMemZero(context, sizeof(ContextInfo)); /* just to be safe */
421 crFree(context);
422}
423
424static void
425stubDestroyContextLocked( ContextInfo *context )
426{
427 unsigned long contextId = context->id;
428 if (context->type == NATIVE) {
429#ifdef WINDOWS
430 stub.wsInterface.wglDeleteContext( context->hglrc );
431#elif defined(Darwin)
432 stub.wsInterface.CGLDestroyContext( context->cglc );
433#elif defined(GLX)
434 stub.wsInterface.glXDestroyContext( context->dpy, context->glxContext );
435#endif
436 }
437 else if (context->type == CHROMIUM) {
438 /* Have pack SPU or tilesort SPU, etc. destroy the context */
439 CRASSERT(context->spuContext >= 0);
440 stub.spu->dispatch_table.DestroyContext( context->spuContext );
441 crHashtableWalk(stub.windowTable, stubWindowCheckOwnerCB, context);
442#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
443 if (context->spuConnection)
444 {
445 stub.spu->dispatch_table.VBoxConDestroy(context->spuConnection);
446 context->spuConnection = 0;
447 }
448#endif
449 }
450
451#ifdef GLX
452 crFreeHashtable(context->pGLXPixmapsHash, crFree);
453#endif
454
455 crHashtableDelete(stub.contextTable, contextId, NULL);
456}
457
458#ifdef CHROMIUM_THREADSAFE
459static DECLCALLBACK(void) stubContextDtor(void*pvContext)
460{
461 stubContextFree((ContextInfo*)pvContext);
462}
463#endif
464
465/**
466 * Allocate a new ContextInfo object, initialize it, put it into the
467 * context hash table. If type==CHROMIUM, call the head SPU's
468 * CreateContext() function too.
469 */
470 ContextInfo *
471stubNewContext( const char *dpyName, GLint visBits, ContextType type,
472 unsigned long shareCtx
473#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
474 , struct VBOXUHGSMI *pHgsmi
475#endif
476 )
477{
478 GLint spuContext = -1, spuShareCtx = 0, spuConnection = 0;
479 ContextInfo *context;
480
481 if (shareCtx > 0) {
482 /* translate shareCtx to a SPU context ID */
483 context = (ContextInfo *)
484 crHashtableSearch(stub.contextTable, shareCtx);
485 if (context)
486 spuShareCtx = context->spuContext;
487 }
488
489 if (type == CHROMIUM) {
490#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
491 if (pHgsmi)
492 {
493 spuConnection = stub.spu->dispatch_table.VBoxConCreate(pHgsmi);
494 if (!spuConnection)
495 {
496 crWarning("VBoxConCreate failed");
497 return NULL;
498 }
499 }
500#endif
501 spuContext
502 = stub.spu->dispatch_table.VBoxCreateContext(spuConnection, dpyName, visBits, spuShareCtx);
503 if (spuContext < 0)
504 {
505 crWarning("VBoxCreateContext failed");
506#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
507 if (spuConnection)
508 stub.spu->dispatch_table.VBoxConDestroy(spuConnection);
509#endif
510 return NULL;
511 }
512 }
513
514 context = crCalloc(sizeof(ContextInfo));
515 if (!context) {
516 stub.spu->dispatch_table.DestroyContext(spuContext);
517#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
518 if (spuConnection)
519 stub.spu->dispatch_table.VBoxConDestroy(spuConnection);
520#endif
521 return NULL;
522 }
523
524 if (!dpyName)
525 dpyName = "";
526
527 context->id = stub.freeContextNumber++;
528 context->type = type;
529 context->spuContext = spuContext;
530 context->visBits = visBits;
531 context->currentDrawable = NULL;
532 crStrncpy(context->dpyName, dpyName, MAX_DPY_NAME);
533 context->dpyName[MAX_DPY_NAME-1] = 0;
534
535#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
536 context->spuConnection = spuConnection;
537 context->pHgsmi = pHgsmi;
538#endif
539
540#ifdef CHROMIUM_THREADSAFE
541 VBoxTlsRefInit(context, stubContextDtor);
542#endif
543
544#if defined(GLX) || defined(DARWIN)
545 context->share = (ContextInfo *)
546 crHashtableSearch(stub.contextTable, (unsigned long) shareCtx);
547#endif
548
549#ifdef GLX
550 context->pGLXPixmapsHash = crAllocHashtable();
551 context->damageQueryFailed = GL_FALSE;
552 context->damageEventsBase = 0;
553#endif
554
555 crHashtableAdd(stub.contextTable, context->id, (void *) context);
556
557 return context;
558}
559
560
561#ifdef Darwin
562
563#define SET_ATTR(l,i,a) ( (l)[(i)++] = (a) )
564#define SET_ATTR_V(l,i,a,v) ( SET_ATTR(l,i,a), SET_ATTR(l,i,v) )
565
566void stubSetPFA( ContextInfo *ctx, CGLPixelFormatAttribute *attribs, int size, GLint *num ) {
567 GLuint visual = ctx->visBits;
568 int i = 0;
569
570 CRASSERT(visual & CR_RGB_BIT);
571
572 SET_ATTR_V(attribs, i, kCGLPFAColorSize, 8);
573
574 if( visual & CR_DEPTH_BIT )
575 SET_ATTR_V(attribs, i, kCGLPFADepthSize, 16);
576
577 if( visual & CR_ACCUM_BIT )
578 SET_ATTR_V(attribs, i, kCGLPFAAccumSize, 1);
579
580 if( visual & CR_STENCIL_BIT )
581 SET_ATTR_V(attribs, i, kCGLPFAStencilSize, 1);
582
583 if( visual & CR_ALPHA_BIT )
584 SET_ATTR_V(attribs, i, kCGLPFAAlphaSize, 1);
585
586 if( visual & CR_DOUBLE_BIT )
587 SET_ATTR(attribs, i, kCGLPFADoubleBuffer);
588
589 if( visual & CR_STEREO_BIT )
590 SET_ATTR(attribs, i, kCGLPFAStereo);
591
592/* SET_ATTR_V(attribs, i, kCGLPFASampleBuffers, 1);
593 SET_ATTR_V(attribs, i, kCGLPFASamples, 0);
594 SET_ATTR_V(attribs, i, kCGLPFADisplayMask, 0); */
595 SET_ATTR(attribs, i, kCGLPFABackingStore);
596 SET_ATTR(attribs, i, kCGLPFAWindow);
597 SET_ATTR_V(attribs, i, kCGLPFADisplayMask, ctx->disp_mask);
598
599 SET_ATTR(attribs, i, 0);
600
601 *num = i;
602}
603
604#endif
605
606/**
607 * This creates a native GLX/WGL context.
608 */
609static GLboolean
610InstantiateNativeContext( WindowInfo *window, ContextInfo *context )
611{
612#ifdef WINDOWS
613 context->hglrc = stub.wsInterface.wglCreateContext( window->drawable );
614 return context->hglrc ? GL_TRUE : GL_FALSE;
615#elif defined(Darwin)
616 CGLContextObj shareCtx = NULL;
617 CGLPixelFormatObj pix;
618 long npix;
619
620 CGLPixelFormatAttribute attribs[16];
621 GLint ind = 0;
622
623 if( context->share ) {
624 if( context->cglc != context->share->cglc ) {
625 crWarning("CGLCreateContext() is trying to share a non-existant "
626 "CGL context. Setting share context to zero.");
627 shareCtx = 0;
628 }
629 else
630 shareCtx = context->cglc;
631 }
632
633 stubSetPFA( context, attribs, 16, &ind );
634
635 stub.wsInterface.CGLChoosePixelFormat( attribs, &pix, &npix );
636 stub.wsInterface.CGLCreateContext( pix, shareCtx, &context->cglc );
637 if( !context->cglc )
638 crError("InstantiateNativeContext: Couldn't Create the context!");
639
640 stub.wsInterface.CGLDestroyPixelFormat( pix );
641
642 if( context->parambits ) {
643 /* Set the delayed parameters */
644 if( context->parambits & VISBIT_SWAP_RECT )
645 stub.wsInterface.CGLSetParameter( context->cglc, kCGLCPSwapRectangle, context->swap_rect );
646
647 if( context->parambits & VISBIT_SWAP_INTERVAL )
648 stub.wsInterface.CGLSetParameter( context->cglc, kCGLCPSwapInterval, &(context->swap_interval) );
649
650 if( context->parambits & VISBIT_CLIENT_STORAGE )
651 stub.wsInterface.CGLSetParameter( context->cglc, kCGLCPClientStorage, (long*)&(context->client_storage) );
652
653 context->parambits = 0;
654 }
655
656 return context->cglc ? GL_TRUE : GL_FALSE;
657#elif defined(GLX)
658 GLXContext shareCtx = 0;
659
660 /* sort out context sharing here */
661 if (context->share) {
662 if (context->glxContext != context->share->glxContext) {
663 crWarning("glXCreateContext() is trying to share a non-existant "
664 "GLX context. Setting share context to zero.");
665 shareCtx = 0;
666 }
667 else {
668 shareCtx = context->glxContext;
669 }
670 }
671
672 context->glxContext = stub.wsInterface.glXCreateContext( window->dpy,
673 context->visual, shareCtx, context->direct );
674
675 return context->glxContext ? GL_TRUE : GL_FALSE;
676#endif
677}
678
679
680/**
681 * Utility functions to get window size and titlebar text.
682 */
683#ifdef WINDOWS
684
685void
686stubGetWindowGeometry(const WindowInfo *window, int *x, int *y,
687 unsigned int *w, unsigned int *h )
688{
689 RECT rect;
690
691 if (!window->drawable || !window->hWnd) {
692 *w = *h = 0;
693 return;
694 }
695
696 if (window->hWnd!=WindowFromDC(window->drawable))
697 {
698 crWarning("Window(%i) DC is no longer valid", window->spuWindow);
699 return;
700 }
701
702 if (!GetClientRect(window->hWnd, &rect))
703 {
704 crWarning("GetClientRect failed for %p", window->hWnd);
705 *w = *h = 0;
706 return;
707 }
708 *w = rect.right - rect.left;
709 *h = rect.bottom - rect.top;
710
711 if (!ClientToScreen( window->hWnd, (LPPOINT) &rect ))
712 {
713 crWarning("ClientToScreen failed for %p", window->hWnd);
714 *w = *h = 0;
715 return;
716 }
717 *x = rect.left;
718 *y = rect.top;
719}
720
721static void
722GetWindowTitle( const WindowInfo *window, char *title )
723{
724 /* XXX - we don't handle recurseUp */
725 if (window->hWnd)
726 GetWindowText(window->hWnd, title, 100);
727 else
728 title[0] = 0;
729}
730
731static void
732GetCursorPosition(WindowInfo *window, int pos[2])
733{
734 RECT rect;
735 POINT point;
736 GLint size[2], x, y;
737 unsigned int NativeHeight, NativeWidth, ChromiumHeight, ChromiumWidth;
738 float WidthRatio, HeightRatio;
739 static int DebugFlag = 0;
740
741 // apparently the "window" parameter passed to this
742 // function contains the native window information
743 HWND NATIVEhwnd = window->hWnd;
744
745 if (NATIVEhwnd!=WindowFromDC(window->drawable))
746 {
747 crWarning("Window(%i) DC is no longer valid", window->spuWindow);
748 return;
749 }
750
751 // get the native window's height and width
752 stubGetWindowGeometry(window, &x, &y, &NativeWidth, &NativeHeight);
753
754 // get the spu window's height and width
755 stub.spu->dispatch_table.GetChromiumParametervCR(GL_WINDOW_SIZE_CR, window->spuWindow, GL_INT, 2, size);
756 ChromiumWidth = size[0];
757 ChromiumHeight = size[1];
758
759 // get the ratio of the size of the native window to the cr window
760 WidthRatio = (float)ChromiumWidth / (float)NativeWidth;
761 HeightRatio = (float)ChromiumHeight / (float)NativeHeight;
762
763 // output some debug information at the beginning
764 if(DebugFlag)
765 {
766 DebugFlag = 0;
767 crDebug("Native Window Handle = %d", NATIVEhwnd);
768 crDebug("Native Width = %i", NativeWidth);
769 crDebug("Native Height = %i", NativeHeight);
770 crDebug("Chromium Width = %i", ChromiumWidth);
771 crDebug("Chromium Height = %i", ChromiumHeight);
772 }
773
774 if (NATIVEhwnd)
775 {
776 GetClientRect( NATIVEhwnd, &rect );
777 GetCursorPos (&point);
778
779 // make sure these coordinates are relative to the native window,
780 // not the whole desktop
781 ScreenToClient(NATIVEhwnd, &point);
782
783 // calculate the new position of the virtual cursor
784 pos[0] = (int)(point.x * WidthRatio);
785 pos[1] = (int)((NativeHeight - point.y) * HeightRatio);
786 }
787 else
788 {
789 pos[0] = 0;
790 pos[1] = 0;
791 }
792}
793
794#elif defined(Darwin)
795
796extern OSStatus CGSGetScreenRectForWindow( CGSConnectionID cid, CGSWindowID wid, float *outRect );
797extern OSStatus CGSGetWindowBounds( CGSConnectionID cid, CGSWindowID wid, float *bounds );
798
799void
800stubGetWindowGeometry( const WindowInfo *window, int *x, int *y, unsigned int *w, unsigned int *h )
801{
802 float rect[4];
803
804 if( !window ||
805 !window->connection ||
806 !window->drawable ||
807 CGSGetWindowBounds( window->connection, window->drawable, rect ) != noErr )
808 {
809 *x = *y = 0;
810 *w = *h = 0;
811 } else {
812 *x = (int) rect[0];
813 *y = (int) rect[1];
814 *w = (int) rect[2];
815 *h = (int) rect[3];
816 }
817}
818
819
820static void
821GetWindowTitle( const WindowInfo *window, char *title )
822{
823 /* XXX \todo Darwin window Title */
824 title[0] = '\0';
825}
826
827
828static void
829GetCursorPosition( const WindowInfo *window, int pos[2] )
830{
831 Point mouse_pos;
832 float window_rect[4];
833
834 GetMouse( &mouse_pos );
835 CGSGetScreenRectForWindow( window->connection, window->drawable, window_rect );
836
837 pos[0] = mouse_pos.h - (int) window_rect[0];
838 pos[1] = (int) window_rect[3] - (mouse_pos.v - (int) window_rect[1]);
839
840 /*crDebug( "%i %i", pos[0], pos[1] );*/
841}
842
843#elif defined(GLX)
844
845void
846stubGetWindowGeometry(WindowInfo *window, int *x, int *y, unsigned int *w, unsigned int *h)
847{
848 Window root, child;
849 unsigned int border, depth;
850 Display *dpy;
851
852 dpy = stubGetWindowDisplay(window);
853
854 //@todo: Performing those checks is expensive operation, especially for simple apps with high FPS.
855 // Disabling those triples glxgears fps, thus using xevents instead of per frame polling is much more preferred.
856 //@todo: Check similar on windows guests, though doubtful as there're no XSync like calls on windows.
857 if (window && dpy)
858 {
859 XLOCK(dpy);
860 }
861
862 if (!window
863 || !dpy
864 || !window->drawable
865 || !XGetGeometry(dpy, window->drawable, &root, x, y, w, h, &border, &depth)
866 || !XTranslateCoordinates(dpy, window->drawable, root, 0, 0, x, y, &child))
867 {
868 crWarning("Failed to get windows geometry for %p, try xwininfo", window);
869 *x = *y = 0;
870 *w = *h = 0;
871 }
872
873 if (window && dpy)
874 {
875 XUNLOCK(dpy);
876 }
877}
878
879static char *
880GetWindowTitleHelper( Display *dpy, Window window, GLboolean recurseUp )
881{
882 while (1) {
883 char *name;
884 if (!XFetchName(dpy, window, &name))
885 return NULL;
886 if (name[0]) {
887 return name;
888 }
889 else if (recurseUp) {
890 /* This window has no name, try the parent */
891 Status stat;
892 Window root, parent, *children;
893 unsigned int numChildren;
894 stat = XQueryTree( dpy, window, &root, &parent,
895 &children, &numChildren );
896 if (!stat || window == root)
897 return NULL;
898 if (children)
899 XFree(children);
900 window = parent;
901 }
902 else {
903 XFree(name);
904 return NULL;
905 }
906 }
907}
908
909static void
910GetWindowTitle( const WindowInfo *window, char *title )
911{
912 char *t = GetWindowTitleHelper(window->dpy, window->drawable, GL_TRUE);
913 if (t) {
914 crStrcpy(title, t);
915 XFree(t);
916 }
917 else {
918 title[0] = 0;
919 }
920}
921
922
923/**
924 *Return current cursor position in local window coords.
925 */
926static void
927GetCursorPosition(WindowInfo *window, int pos[2] )
928{
929 int rootX, rootY;
930 Window root, child;
931 unsigned int mask;
932 int x, y;
933
934 XLOCK(window->dpy);
935
936 Bool q = XQueryPointer(window->dpy, window->drawable, &root, &child,
937 &rootX, &rootY, &pos[0], &pos[1], &mask);
938 if (q) {
939 unsigned int w, h;
940 stubGetWindowGeometry( window, &x, &y, &w, &h );
941 /* invert Y */
942 pos[1] = (int) h - pos[1] - 1;
943 }
944 else {
945 pos[0] = pos[1] = 0;
946 }
947
948 XUNLOCK(window->dpy);
949}
950
951#endif
952
953
954/**
955 * This function is called by MakeCurrent() and determines whether or
956 * not a new rendering context should be bound to Chromium or the native
957 * OpenGL.
958 * \return GL_FALSE if native OpenGL should be used, or GL_TRUE if Chromium
959 * should be used.
960 */
961static GLboolean
962stubCheckUseChromium( WindowInfo *window )
963{
964 int x, y;
965 unsigned int w, h;
966
967 /* If the provided window is CHROMIUM, we're clearly intended
968 * to create a CHROMIUM context.
969 */
970 if (window->type == CHROMIUM)
971 return GL_TRUE;
972
973 if (stub.ignoreFreeglutMenus) {
974 const char *glutMenuTitle = "freeglut menu";
975 char title[1000];
976 GetWindowTitle(window, title);
977 if (crStrcmp(title, glutMenuTitle) == 0) {
978 crDebug("GL faker: Ignoring freeglut menu window");
979 return GL_FALSE;
980 }
981 }
982
983 /* If the user's specified a window count for Chromium, see if
984 * this window satisfies that criterium.
985 */
986 stub.matchChromiumWindowCounter++;
987 if (stub.matchChromiumWindowCount > 0) {
988 if (stub.matchChromiumWindowCounter != stub.matchChromiumWindowCount) {
989 crDebug("Using native GL, app window doesn't meet match_window_count");
990 return GL_FALSE;
991 }
992 }
993
994 /* If the user's specified a window list to ignore, see if this
995 * window satisfies that criterium.
996 */
997 if (stub.matchChromiumWindowID) {
998 GLuint i;
999
1000 for (i = 0; i <= stub.numIgnoreWindowID; i++) {
1001 if (stub.matchChromiumWindowID[i] == stub.matchChromiumWindowCounter) {
1002 crDebug("Ignore window ID %d, using native GL", stub.matchChromiumWindowID[i]);
1003 return GL_FALSE;
1004 }
1005 }
1006 }
1007
1008 /* If the user's specified a minimum window size for Chromium, see if
1009 * this window satisfies that criterium.
1010 */
1011 if (stub.minChromiumWindowWidth > 0 &&
1012 stub.minChromiumWindowHeight > 0) {
1013 stubGetWindowGeometry( window, &x, &y, &w, &h );
1014 if (w >= stub.minChromiumWindowWidth &&
1015 h >= stub.minChromiumWindowHeight) {
1016
1017 /* Check for maximum sized window now too */
1018 if (stub.maxChromiumWindowWidth &&
1019 stub.maxChromiumWindowHeight) {
1020 if (w < stub.maxChromiumWindowWidth &&
1021 h < stub.maxChromiumWindowHeight)
1022 return GL_TRUE;
1023 else
1024 return GL_FALSE;
1025 }
1026
1027 return GL_TRUE;
1028 }
1029 crDebug("Using native GL, app window doesn't meet minimum_window_size");
1030 return GL_FALSE;
1031 }
1032 else if (stub.matchWindowTitle) {
1033 /* If the user's specified a window title for Chromium, see if this
1034 * window satisfies that criterium.
1035 */
1036 GLboolean wildcard = GL_FALSE;
1037 char title[1000];
1038 char *titlePattern;
1039 int len;
1040 /* check for leading '*' wildcard */
1041 if (stub.matchWindowTitle[0] == '*') {
1042 titlePattern = crStrdup( stub.matchWindowTitle + 1 );
1043 wildcard = GL_TRUE;
1044 }
1045 else {
1046 titlePattern = crStrdup( stub.matchWindowTitle );
1047 }
1048 /* check for trailing '*' wildcard */
1049 len = crStrlen(titlePattern);
1050 if (len > 0 && titlePattern[len - 1] == '*') {
1051 titlePattern[len - 1] = '\0'; /* terminate here */
1052 wildcard = GL_TRUE;
1053 }
1054
1055 GetWindowTitle( window, title );
1056 if (title[0]) {
1057 if (wildcard) {
1058 if (crStrstr(title, titlePattern)) {
1059 crFree(titlePattern);
1060 return GL_TRUE;
1061 }
1062 }
1063 else if (crStrcmp(title, titlePattern) == 0) {
1064 crFree(titlePattern);
1065 return GL_TRUE;
1066 }
1067 }
1068 crFree(titlePattern);
1069 crDebug("Using native GL, app window title doesn't match match_window_title string (\"%s\" != \"%s\")", title, stub.matchWindowTitle);
1070 return GL_FALSE;
1071 }
1072
1073 /* Window title and size don't matter */
1074 CRASSERT(stub.minChromiumWindowWidth == 0);
1075 CRASSERT(stub.minChromiumWindowHeight == 0);
1076 CRASSERT(stub.matchWindowTitle == NULL);
1077
1078 /* User hasn't specified a width/height or window title.
1079 * We'll use chromium for this window (and context) if no other is.
1080 */
1081
1082 return GL_TRUE; /* use Chromium! */
1083}
1084
1085static void stubWindowCheckOwnerCB(unsigned long key, void *data1, void *data2)
1086{
1087 WindowInfo *pWindow = (WindowInfo *) data1;
1088 ContextInfo *pCtx = (ContextInfo *) data2;
1089
1090 if (pWindow->pOwner == pCtx)
1091 {
1092#ifdef WINDOWS
1093 /* Note: can't use WindowFromDC(context->pOwnWindow->drawable) here
1094 because GL context is already released from DC and actual guest window
1095 could be destroyed.
1096 */
1097 stubDestroyWindow(CR_CTX_CON(pCtx), (GLint)pWindow->hWnd);
1098#else
1099 stubDestroyWindow(CR_CTX_CON(pCtx), (GLint)pWindow->drawable);
1100#endif
1101 }
1102}
1103
1104GLboolean stubCtxCreate(ContextInfo *context)
1105{
1106 /*
1107 * Create a Chromium context.
1108 */
1109#if defined(GLX) || defined(DARWIN)
1110 GLint spuShareCtx = context->share ? context->share->spuContext : 0;
1111#else
1112 GLint spuShareCtx = 0;
1113#endif
1114 GLint spuConnection = 0;
1115 CRASSERT(stub.spu);
1116 CRASSERT(stub.spu->dispatch_table.CreateContext);
1117 context->type = CHROMIUM;
1118
1119#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
1120 if (context->pHgsmi)
1121 {
1122 spuConnection = stub.spu->dispatch_table.VBoxConCreate(context->pHgsmi);
1123 if (!spuConnection)
1124 {
1125 crWarning("VBoxConCreate failed");
1126 return GL_FALSE;
1127 }
1128 context->spuConnection = spuConnection;
1129 }
1130#endif
1131
1132 context->spuContext
1133 = stub.spu->dispatch_table.VBoxCreateContext(spuConnection, context->dpyName,
1134 context->visBits,
1135 spuShareCtx);
1136
1137 return GL_TRUE;
1138}
1139
1140GLboolean stubCtxCheckCreate(ContextInfo *context)
1141{
1142 if (context->type == UNDECIDED)
1143 return stubCtxCreate(context);
1144 return CHROMIUM == context->type;
1145}
1146
1147
1148GLboolean
1149stubMakeCurrent( WindowInfo *window, ContextInfo *context )
1150{
1151 GLboolean retVal;
1152
1153 /*
1154 * Get WindowInfo and ContextInfo pointers.
1155 */
1156
1157 if (!context || !window) {
1158 ContextInfo * currentContext = stubGetCurrentContext();
1159 if (currentContext)
1160 currentContext->currentDrawable = NULL;
1161 if (context)
1162 context->currentDrawable = NULL;
1163 stubSetCurrentContext(NULL);
1164 return GL_TRUE; /* OK */
1165 }
1166
1167#ifdef CHROMIUM_THREADSAFE
1168 stubCheckMultithread();
1169#endif
1170
1171 if (context->type == UNDECIDED) {
1172 /* Here's where we really create contexts */
1173#ifdef CHROMIUM_THREADSAFE
1174 crLockMutex(&stub.mutex);
1175#endif
1176
1177 if (stubCheckUseChromium(window)) {
1178 GLint spuConnection = 0;
1179
1180 if (!stubCtxCreate(context))
1181 {
1182 crWarning("stubCtxCreate failed");
1183 return GL_FALSE;
1184 }
1185
1186#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
1187 spuConnection = context->spuConnection;
1188#endif
1189
1190 if (window->spuWindow == -1)
1191 {
1192 /*crDebug("(1)stubMakeCurrent ctx=%p(%i) window=%p(%i)", context, context->spuContext, window, window->spuWindow);*/
1193 window->spuWindow = stub.spu->dispatch_table.VBoxWindowCreate(spuConnection, window->dpyName, context->visBits );
1194#ifdef CR_NEWWINTRACK
1195 window->u32ClientID = stub.spu->dispatch_table.VBoxPackGetInjectID(spuConnection);
1196#endif
1197 }
1198 }
1199 else {
1200 /*
1201 * Create a native OpenGL context.
1202 */
1203 if (!InstantiateNativeContext(window, context))
1204 {
1205#ifdef CHROMIUM_THREADSAFE
1206 crUnlockMutex(&stub.mutex);
1207#endif
1208 return 0; /* false */
1209 }
1210 context->type = NATIVE;
1211 }
1212
1213#ifdef CHROMIUM_THREADSAFE
1214 crUnlockMutex(&stub.mutex);
1215#endif
1216 }
1217
1218
1219 if (context->type == NATIVE) {
1220 /*
1221 * Native OpenGL MakeCurrent().
1222 */
1223#ifdef WINDOWS
1224 retVal = (GLboolean) stub.wsInterface.wglMakeCurrent( window->drawable, context->hglrc );
1225#elif defined(Darwin)
1226 // XXX \todo We need to differentiate between these two..
1227 retVal = ( stub.wsInterface.CGLSetSurface(context->cglc, window->connection, window->drawable, window->surface) == noErr );
1228 retVal = ( stub.wsInterface.CGLSetCurrentContext(context->cglc) == noErr );
1229#elif defined(GLX)
1230 retVal = (GLboolean) stub.wsInterface.glXMakeCurrent( window->dpy, window->drawable, context->glxContext );
1231#endif
1232 }
1233 else {
1234 /*
1235 * SPU chain MakeCurrent().
1236 */
1237 CRASSERT(context->type == CHROMIUM);
1238 CRASSERT(context->spuContext >= 0);
1239
1240 /*if (context->currentDrawable && context->currentDrawable != window)
1241 crDebug("Rebinding context %p to a different window", context);*/
1242
1243 if (window->type == NATIVE) {
1244 crWarning("Can't rebind a chromium context to a native window\n");
1245 retVal = 0;
1246 }
1247 else {
1248 if (window->spuWindow == -1)
1249 {
1250 /*crDebug("(2)stubMakeCurrent ctx=%p(%i) window=%p(%i)", context, context->spuContext, window, window->spuWindow);*/
1251 window->spuWindow = stub.spu->dispatch_table.VBoxWindowCreate(
1252#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
1253 context->spuConnection,
1254#else
1255 0,
1256#endif
1257 window->dpyName, context->visBits );
1258#ifdef CR_NEWWINTRACK
1259 window->u32ClientID = stub.spu->dispatch_table.VBoxPackGetInjectID(
1260# if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
1261 context->spuConnection
1262# else
1263 0
1264# endif
1265 );
1266#endif
1267 if (context->currentDrawable && context->currentDrawable->type==CHROMIUM
1268 && context->currentDrawable->pOwner==context)
1269 {
1270#ifdef WINDOWS
1271 if (context->currentDrawable->hWnd!=WindowFromDC(context->currentDrawable->drawable))
1272 {
1273 stubDestroyWindow(CR_CTX_CON(context), (GLint)context->currentDrawable->hWnd);
1274 }
1275#else
1276 Window root;
1277 int x, y;
1278 unsigned int border, depth, w, h;
1279
1280 XLOCK(context->currentDrawable->dpy);
1281 if (!XGetGeometry(context->currentDrawable->dpy, context->currentDrawable->drawable, &root, &x, &y, &w, &h, &border, &depth))
1282 {
1283 stubDestroyWindow(CR_CTX_CON(context), (GLint)context->currentDrawable->drawable);
1284 }
1285 XUNLOCK(context->currentDrawable->dpy);
1286#endif
1287
1288 }
1289 }
1290
1291 if (window->spuWindow != (GLint)window->drawable)
1292 stub.spu->dispatch_table.MakeCurrent( window->spuWindow, (GLint) window->drawable, context->spuContext );
1293 else
1294 stub.spu->dispatch_table.MakeCurrent( window->spuWindow, 0, /* native window handle */ context->spuContext );
1295
1296 retVal = 1;
1297 }
1298 }
1299
1300 window->type = context->type;
1301 window->pOwner = context;
1302 context->currentDrawable = window;
1303 stubSetCurrentContext(context);
1304
1305 if (retVal) {
1306 /* Now, if we've transitions from Chromium to native rendering, or
1307 * vice versa, we have to change all the OpenGL entrypoint pointers.
1308 */
1309 if (context->type == NATIVE) {
1310 /* Switch to native API */
1311 /*printf(" Switching to native API\n");*/
1312 stubSetDispatch(&stub.nativeDispatch);
1313 }
1314 else if (context->type == CHROMIUM) {
1315 /* Switch to stub (SPU) API */
1316 /*printf(" Switching to spu API\n");*/
1317 stubSetDispatch(&stub.spuDispatch);
1318 }
1319 else {
1320 /* no API switch needed */
1321 }
1322 }
1323
1324 if (!window->width && window->type == CHROMIUM) {
1325 /* One time window setup */
1326 int x, y;
1327 unsigned int winW, winH;
1328
1329 stubGetWindowGeometry( window, &x, &y, &winW, &winH );
1330
1331 /* If we're not using GLX/WGL (no app window) we'll always get
1332 * a width and height of zero here. In that case, skip the viewport
1333 * call since we're probably using a tilesort SPU with fake_window_dims
1334 * which the tilesort SPU will use for the viewport.
1335 */
1336 window->width = winW;
1337 window->height = winH;
1338#if defined(WINDOWS) && defined(VBOX_WITH_WDDM)
1339 if (stubIsWindowVisible(window))
1340#endif
1341 {
1342 if (stub.trackWindowSize)
1343 stub.spuDispatch.WindowSize( window->spuWindow, winW, winH );
1344 if (stub.trackWindowPos)
1345 stub.spuDispatch.WindowPosition(window->spuWindow, x, y);
1346 if (winW > 0 && winH > 0)
1347 stub.spu->dispatch_table.Viewport( 0, 0, winW, winH );
1348 }
1349#ifdef VBOX_WITH_WDDM
1350 if (stub.trackWindowVisibleRgn)
1351 stub.spu->dispatch_table.WindowVisibleRegion(window->spuWindow, 0, NULL);
1352#endif
1353 }
1354
1355 /* Update window mapping state.
1356 * Basically, this lets us hide render SPU windows which correspond
1357 * to unmapped application windows. Without this, "pertly" (for example)
1358 * opens *lots* of temporary windows which otherwise clutter the screen.
1359 */
1360 if (stub.trackWindowVisibility && window->type == CHROMIUM && window->drawable) {
1361 const int mapped = stubIsWindowVisible(window);
1362 if (mapped != window->mapped) {
1363 crDebug("Dispatched: WindowShow(%i, %i)", window->spuWindow, mapped);
1364 stub.spu->dispatch_table.WindowShow(window->spuWindow, mapped);
1365 window->mapped = mapped;
1366 }
1367 }
1368
1369 return retVal;
1370}
1371
1372void
1373stubDestroyContext( unsigned long contextId )
1374{
1375 ContextInfo *context;
1376
1377 if (!stub.contextTable) {
1378 return;
1379 }
1380
1381 /* the lock order is windowTable->contextTable (see wglMakeCurrent_prox, glXMakeCurrent)
1382 * this is why we need to take a windowTable lock since we will later do stub.windowTable access & locking */
1383 crHashtableLock(stub.windowTable);
1384 crHashtableLock(stub.contextTable);
1385
1386 context = (ContextInfo *) crHashtableSearch(stub.contextTable, contextId);
1387
1388 CRASSERT(context);
1389
1390 stubDestroyContextLocked(context);
1391
1392#ifdef CHROMIUM_THREADSAFE
1393 if (stubGetCurrentContext() == context) {
1394 stubSetCurrentContext(NULL);
1395 }
1396
1397 VBoxTlsRefMarkDestroy(context);
1398 VBoxTlsRefRelease(context);
1399#else
1400 if (stubGetCurrentContext() == context) {
1401 stubSetCurrentContext(NULL);
1402 }
1403 stubContextFree(context);
1404#endif
1405 crHashtableUnlock(stub.contextTable);
1406 crHashtableUnlock(stub.windowTable);
1407}
1408
1409void
1410stubSwapBuffers(WindowInfo *window, GLint flags)
1411{
1412 if (!window)
1413 return;
1414
1415 /* Determine if this window is being rendered natively or through
1416 * Chromium.
1417 */
1418
1419 if (window->type == NATIVE) {
1420 /*printf("*** Swapping native window %d\n", (int) drawable);*/
1421#ifdef WINDOWS
1422 (void) stub.wsInterface.wglSwapBuffers( window->drawable );
1423#elif defined(Darwin)
1424 /* ...is this ok? */
1425/* stub.wsInterface.CGLFlushDrawable( context->cglc ); */
1426 crDebug("stubSwapBuffers: unable to swap (no context!)");
1427#elif defined(GLX)
1428 stub.wsInterface.glXSwapBuffers( window->dpy, window->drawable );
1429#endif
1430 }
1431 else if (window->type == CHROMIUM) {
1432 /* Let the SPU do the buffer swap */
1433 /*printf("*** Swapping chromium window %d\n", (int) drawable);*/
1434 if (stub.appDrawCursor) {
1435 int pos[2];
1436 GetCursorPosition(window, pos);
1437 stub.spu->dispatch_table.ChromiumParametervCR(GL_CURSOR_POSITION_CR, GL_INT, 2, pos);
1438 }
1439 stub.spu->dispatch_table.SwapBuffers( window->spuWindow, flags );
1440 }
1441 else {
1442 crDebug("Calling SwapBuffers on a window we haven't seen before (no-op).");
1443 }
1444}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette