/* Copyright (c) 2001, Stanford University
* All rights reserved
*
* See the file LICENSE.txt for information on redistributing this software.
*/
#include "server.h"
#include "server_dispatch.h"
#include "cr_mem.h"
#include "cr_rand.h"
#include "cr_string.h"
#include "render/renderspu.h"
{
}
GLint crServerMuralInit(CRMuralInfo *mural, GLboolean fGuestWindow, GLint visBits, GLint preloadWinID)
{
#ifdef RT_OS_DARWIN
if (fGuestWindow)
{
if (!dummy)
{
WARN(("crServerGetDummyMural failed"));
return -1;
}
}
else
#endif
{
/*
* Have first SPU make a new window.
*/
if (spuWindow < 0) {
return spuWindow;
}
/* get initial window size */
cr_server.head_spu->dispatch_table.GetChromiumParametervCR(GL_WINDOW_SIZE_CR, spuWindow, GL_INT, 2, dims);
}
mural->cVisibleRects = 0;
else
return windowID;
}
{
dpyName = "";
if (cr_server.sharedWindows) {
int pos, j;
/* find empty position in my (curclient) windowList */
break;
}
}
if (pos == CR_MAX_WINDOWS) {
crWarning("Too many windows in crserver!");
return -1;
}
/* Look if any other client has a window for this slot */
for (j = 0; j < cr_server.numClients; j++) {
/* use that client's window */
crDebug("CRServer: client %p sharing window %d",
return windowID;
}
}
}
/*
* Create a new mural for the new window.
*/
if (!mural)
{
crWarning("crCalloc failed!");
return -1;
}
if (windowID < 0)
{
crWarning("crServerMuralInit failed!");
return windowID;
}
crDebug("CRServer: client %p created new window %d (SPU window %d)",
int pos;
break;
}
}
}
/* ensure we have a dummy mural created right away to avoid potential deadlocks on VM shutdown */
return windowID;
}
{
int pos;
{
{
return true;
}
}
return false;
}
{
crServerRedirMuralFBO(mural, false);
{
CRMuralInfo *dummyMural = crServerGetDummyMural(cr_server.MainContextInfo.CreateInfo.realVisualBits);
/* reset the current context to some dummy values to ensure render spu does not switch to a default "0" context,
* which might lead to muralFBO (offscreen rendering) gl entities being created in a scope of that context */
cr_server.head_spu->dispatch_table.MakeCurrent(dummyMural->spuWindow, 0, cr_server.MainContextInfo.SpuContext);
}
else
{
}
if (pBlitter)
{
{
}
}
if (!mural->fIsDummyRefference)
if (mural->pVisibleRects)
{
}
}
{
}
{
int found=false;
if (!window)
{
crWarning("Unexpected attempt to delete default mural, ignored!");
return;
}
if (!mural) {
return;
}
{
{
}
/*Same as with contexts, some apps destroy it not in a thread where it was created*/
if (!found)
{
{
continue;
if (found) break;
}
}
if (!found)
{
{
}
}
}
/*Make sure this window isn't active in other clients*/
{
{
}
}
while (pNode)
{
{
}
}
}
{
return GL_FALSE;
&& !mural->fRedirected)
{
}
return GL_TRUE;
}
{
/* crDebug("CRServer: Window %d size %d x %d", window, width, height);*/
if (!mural) {
#if EXTRA_WARN
#endif
return;
}
{
}
}
{
return;
}
{
if (!mural) {
#if EXTRA_WARN
#endif
return;
}
crServerMuralPosition(mural, x, y);
}
{
if (mural->pVisibleRects)
{
}
if (cRects)
{
if (!mural->pVisibleRects)
{
crError("Out of memory in crServerDispatchWindowVisibleRegion");
}
}
}
{
if (!mural) {
#if EXTRA_WARN
#endif
return;
}
}
{
return;
else
}
{
if (!mural) {
#if EXTRA_WARN
#endif
return;
}
}
{
if (!mural) {
#if EXTRA_WARN
crWarning("CRServer: invalid window %d passed to crServerSPUWindowID()",
#endif
return -1;
}
}