/* Copyright (c) 2001, Stanford University
* All rights reserved
*
* See the file LICENSE.txt for information on redistributing this software.
*/
#include "server_dispatch.h"
#include "server.h"
#include "cr_error.h"
#include "cr_unpack.h"
#include "cr_mem.h"
#include "state/cr_statetypes.h"
/* This code copied from the tilesorter (fooey) */
typedef struct BucketRegion {
} BucketRegion;
struct BucketingInfo {
};
/*
* At this point we know that the tiles are uniformly sized so we can use
* a hash-based bucketing method. Setup the hash table now.
*/
static GLboolean
{
#if 0
int i, j, k, m;
int r_len = 0;
struct BucketingInfo *bucketInfo;
if (mural->bucketInfo) {
}
if (!bucketInfo)
return GL_FALSE;
/* Allocate rlist (don't free it!!!) */
for ( i = 0; i < HASHRANGE; i++ )
{
for ( j = 0; j < HASHRANGE; j++ )
{
}
}
/* Fill the rlist */
{
{
for (k=0; k < mural->numExtents; k++)
{
{
break;
}
}
if (k == mural->numExtents)
{
}
rptr++;
}
}
/* Fill hash table */
for (i = 0; i < r_len; i++)
{
k < HASHRANGE;
k++)
{
m < HASHRANGE;
m++)
{
{
bucketInfo->rhash[m][k] = r;
}
}
}
}
/* Initialize links */
for (i=0; i<r_len; i++)
{
}
/* Build links */
for (i=0; i<r_len; i++)
{
for (j=0; j<r_len; j++)
{
if (r==q)
continue;
/* Right Edge */
{
r->right = q;
}
/* Upper Edge */
{
r->up = q;
}
}
}
#endif
return GL_TRUE;
}
/*
* Check if the tiles are the same size. If so, initialize hash-based
* bucketing.
*/
{
#if 0
int optTileWidth = 0, optTileHeight = 0;
int i;
for (i = 0; i < mural->numExtents; i++)
{
if (optTileWidth == 0 && optTileHeight == 0) {
/* First tile */
optTileWidth = w;
optTileHeight = h;
}
else
{
/* Subsequent tile - make sure it's the same size as first and
* falls on the expected x/y location.
*/
if (w != optTileWidth || h != optTileHeight) {
crWarning("Tile %d, %d .. %d, %d is not the right size!",
crWarning("All tiles must be same size with optimize_bucket.");
crWarning("Turning off optimize_bucket for this mural.");
return GL_FALSE;
}
{
crWarning("Tile %d, %d .. %d, %d is not positioned correctly "
"to use optimize_bucket.",
crWarning("Turning off optimize_bucket for this mural.");
return GL_FALSE;
}
}
}
#endif
return fillBucketingHash(mural);
}
/**
* followed by a payload of arbitrary Chromium rendering commands.
* The tilesort SPU will send this.
* Note: the bounding box is in mural pixel coordinates (y=0=bottom)
*/
{
/* Save current unpacker state */
crUnpackPush();
#if 0
/* pass bounds info to first SPU */
{
/* "infinite" bounds: convert to full image bounds */
}
else {
}
}
if (!mural->viewportValidated) {
mural);
}
/* Check for out of bounds, and optimizeBucket to enable */
{
const BucketRegion *r;
const BucketRegion *p;
r = r->up)
{
{
if ( p->id != (unsigned int) -1 &&
{
if (cr_server.run_queue->client->currentCtxInfo && cr_server.run_queue->client->currentCtxInfo->pContext) {
}
}
}
}
}
else
{
int i;
for ( i = 0; i < mural->numExtents; i++ )
{
if (cr_server.localTileSpec ||
{
if (cr_server.run_queue->client->currentCtxInfo && cr_server.run_queue->client->currentCtxInfo->pContext) {
crServerSetOutputBounds( mural, i );
}
}
}
}
#endif
/* Restore previous unpacker state */
crUnpackPop();
}