stub.c revision d10b60270f0c0eeb87f45002a010cff8ba2126b1
/* Copyright (c) 2001, Stanford University
* All rights reserved
*
* See the file LICENSE.txt for information on redistributing this software.
*/
#include "cr_spu.h"
#include "cr_error.h"
#include "cr_mem.h"
#include "stub.h"
static void crForcedFlush(
#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
#endif
)
{
#if 0
#else
#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
if (con)
{
}
else
#endif
{
}
#endif
}
#ifdef GLX
{
#if defined(CR_NEWWINTRACK)
if ((NIL_RTTHREAD!=stub.hSyncThread) && (RTThreadNativeSelf()==RTThreadGetNative(stub.hSyncThread)))
{
{
{
}
}
else
{
}
}
else
#endif
{
}
}
#endif
/**
* Returns -1 on error
*/
{
stubInit();
/* XXX in Chromium 1.5 and earlier, the last parameter was UNDECIDED.
* That didn't seem right so it was changed to CHROMIUM. (Brian)
*/
#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
, NULL
#endif
);
}
{
}
{
crWarning("Can't call crMakeCurrent with native GL context");
return;
}
}
{
stubInit();
if (context)
else
return 0;
}
{
stubInit();
else
return -1;
}
{
if (winInfo)
}
/**
* Returns -1 on error
*/
{
stubInit();
}
{
}
{
{
#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
#else
0
#endif
#ifdef WINDOWS
{
}
if (winInfo->pVisibleRegions)
{
}
# ifdef CR_NEWWINTRACK
{
}
# endif
#endif
#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
#endif
);
#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
winInfo->spuConnection = 0;
#endif
}
}
{
{
}
}
{
{
}
}
{
{
}
}
{
}
void APIENTRY stub_GetChromiumParametervCR( GLenum target, GLuint index, GLenum type, GLsizei count, GLvoid *values )
{
char **ret;
switch( target )
{
case GL_HEAD_SPU_NAME_CR:
return;
default:
break;
}
}
/*
* Updates geometry info for given spu window.
* Returns GL_TRUE if it changed since last call, GL_FALSE otherwise.
* bForceUpdate - forces dispatching of geometry info even if it's unchanged
*/
{
/* @todo remove "if (winW && winH)"?*/
if (stub.trackWindowSize) {
#ifdef VBOX_WITH_WDDM
#endif
{
}
}
}
if (stub.trackWindowPos) {
#ifdef VBOX_WITH_WDDM
#endif
{
}
}
}
}
return res;
}
#ifdef WINDOWS
/*
* Updates visible regions for given spu window.
* Returns GL_TRUE if regions changed since last call, GL_FALSE otherwise.
*/
{
int iret;
{
return GL_FALSE;
}
hVisRgn = CreateRectRgn(0,0,0,0);
if (iret==1)
{
/* Convert screen related rectangles to client related rectangles */
pt.x = 0;
pt.y = 0;
/*
dwCount = GetRegionData(hVisRgn, 0, NULL);
lpRgnData = crAlloc(dwCount);
crDebug("GetRandomRgn returned 1, dwCount=%d", dwCount);
GetRegionData(hVisRgn, dwCount, lpRgnData);
crDebug("Region consists of %d rects", lpRgnData->rdh.nCount);
pRects = (RECT*) lpRgnData->Buffer;
for (i=0; i<lpRgnData->rdh.nCount; ++i)
{
crDebug("Rgn[%d] = (%d, %d, %d, %d)", i, pRects[i].left, pRects[i].top, pRects[i].right, pRects[i].bottom);
}
crFree(lpRgnData);
*/
{
if (lpRgnData)
{
crDebug("Dispatched WindowVisibleRegion (%i, cRects=%i)", pWindow->spuWindow, lpRgnData->rdh.nCount);
stub.spuDispatch.WindowVisibleRegion(pWindow->spuWindow, lpRgnData->rdh.nCount, (GLint*) lpRgnData->Buffer);
return GL_TRUE;
}
else crWarning("GetRegionData failed, VisibleRegions update failed");
}
else
{
}
}
else
{
}
return GL_FALSE;
}
# ifndef CR_NEWWINTRACK
{
(void) key;
{
{
case WM_MOVING:
case WM_SIZING:
case WM_MOVE:
case WM_CREATE:
case WM_SIZE:
{
{
}
break;
}
case WM_SHOWWINDOW:
case WM_ACTIVATEAPP:
case WM_PAINT:
case WM_NCPAINT:
case WM_NCACTIVATE:
case WM_ERASEBKGND:
{
{
}
break;
}
default:
{
{
}
break;
}
}
}
}
{
{
{
case WM_MOVING:
case WM_SIZING:
case WM_MOVE:
case WM_ACTIVATEAPP:
case WM_NCPAINT:
case WM_NCACTIVATE:
case WM_ERASEBKGND:
case WM_CREATE:
case WM_SIZE:
case WM_SHOWWINDOW:
{
break;
}
/* @todo remove it*/
default:
{
/*crDebug("hook: unknown message (%d)", pMsgInfo->message);*/
break;
}
}
}
}
void stubInstallWindowMessageHook()
{
stub.hMessageHook = SetWindowsHookEx(WH_CALLWNDPROCRET, stubCBWindowMessageHookProc, 0, crThreadID());
if (!stub.hMessageHook)
crWarning("Window message hook install failed! (not fatal)");
}
{
if (stub.hMessageHook)
}
# endif /*# ifndef CR_NEWWINTRACK*/
{
{
vma=0;
vmi=0;
&& vma>=2)
{
return;
}
else
{
}
}
else
{
}
return;
}
/*
* Updates visible regions for given spu window.
* Returns GL_TRUE if regions changed since last call, GL_FALSE otherwise.
*/
{
int cRects, i;
bool bNoUpdate = false;
if (!stub.bXExtensionsChecked)
{
if (!stub.trackWindowVisibleRgn)
{
return GL_FALSE;
}
}
* it seems there's no way to get even based updates for this. Or I've failed to find the appropriate extension.
*/
/* Check for compiz main window */
{
#ifdef VBOX_TEST_MEGOO
#else
bNoUpdate = true;
#endif
}
if (!bNoUpdate
&& (!pWindow->pVisibleRegions
|| (pWindow->pVisibleRegions && crMemcmp(pWindow->pVisibleRegions, pXRects, cRects * sizeof(XRectangle)))))
{
if (pWindow->pVisibleRegions)
{
}
if (!pGLRects)
{
crWarning("stubUpdateWindowVisibileRegions: failed to allocate %lu bytes",
return GL_FALSE;
}
//crDebug("Got %i rects.", cRects);
for (i=0; i<cRects; ++i)
{
//crDebug("Rect[%i]=(%i,%i,%i,%i)", i, pGLRects[4*i+0], pGLRects[4*i+1], pGLRects[4*i+2], pGLRects[4*i+3]);
}
return GL_TRUE;
}
else
{
}
return GL_FALSE;
}
#endif //#ifdef WINDOWS