renderspu.c revision 5a73e622149e8abc6532f88a8791dad782d3f34d
6210N/A * See the file LICENSE.txt for information on redistributing this software.
6210N/A#include "cr_environment.h"
6210N/A#include "cr_string.h"
6210N/A#include "cr_error.h"
6210N/A#include "cr_environment.h"
6210N/A#include "renderspu.h"
6210N/A#include "cr_extstring.h"
6210N/AGLboolean renderspuInitVisual(VisualInfo *pVisInfo, const char *displayName, GLbitfield visAttribs)
6210N/A if (!displayName)
6210N/Astatic ContextInfo * renderspuCreateContextInternal(const char *dpyName, GLint visBits, GLint idCtx, ContextInfo * sharedContext)
6210N/A if (sharedContext)
6210N/A * this is why we keep a context refference counting the base (shared) context will be destroyed as soon as*/
6210N/Astatic void RENDER_APIENTRY
if (!context)
if (!window)
if (!window)
return NULL;
return NULL;
return window;
#ifdef CHROMIUM_THREADSAFE
if (!window)
if (!context)
#ifdef CHROMIUM_THREADSAFE
void RENDER_APIENTRY
if (crWindow)
if (!window)
if (ctx)
if (!context)
GLboolean renderspuWindowInitWithVisual( WindowInfo *window, VisualInfo *visual, GLboolean showIt, GLint id )
return GL_FALSE;
return GL_TRUE;
if (!visual)
return GL_FALSE;
return GL_FALSE;
return GL_TRUE;
if (id <= 0)
if (id <= 0)
if (!window)
(void) key;
if (pDummy)
if (pOldCtx)
if (window) {
static void RENDER_APIENTRY
if (window) {
* and that no redraw is started until new Present request comes containing a valid presentation data */
static void RENDER_APIENTRY
if (window) {
window->x = x;
window->y = y;
static void RENDER_APIENTRY
if (window) {
static void RENDER_APIENTRY
if (window) {
flag = 0;
static void RENDER_APIENTRY
renderspuVBoxPresentComposition( GLint win, struct VBOXVR_SCR_COMPOSITOR * pCompositor, struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry )
if (window) {
if (pCompositor)
if (pCompositor)
void renderspuVBoxCompositorBlitStretched ( struct VBOXVR_SCR_COMPOSITOR * pCompositor, PCR_BLITTER pBlitter, GLfloat scaleX, GLfloat scaleY)
int rc = CrVrScrCompositorEntryRegionsGet(pCompositor, pEntry, &cRegions, &paSrcRegions, &paDstRegions, NULL);
uint32_t i;
for (i = 0; i < cRegions; ++i)
void renderspuVBoxCompositorBlit ( struct VBOXVR_SCR_COMPOSITOR * pCompositor, PCR_BLITTER pBlitter)
int rc = CrVrScrCompositorEntryRegionsGet(pCompositor, pEntry, &cRegions, &paSrcRegions, &paDstRegions, NULL);
if (!pBlitter)
if (!pBlitter)
int rc;
if (!pBlitter)
return NULL;
if (!pDefaultCtxInfo)
return NULL;
return NULL;
return pBlitter;
int rc;
if (pCtx)
return rc;
return VINF_SUCCESS;
PCR_BLITTER renderspuVBoxPresentBlitterGetAndEnter( WindowInfo *window, int32_t i32MakeCurrentUserData )
if (pBlitter)
return pBlitter;
return NULL;
PCR_BLITTER renderspuVBoxPresentBlitterEnsureCreated( WindowInfo *window, int32_t i32MakeCurrentUserData )
if (pTmpCompositor)
if (pBlitter)
void renderspuVBoxPresentCompositionGeneric( WindowInfo *window, struct VBOXVR_SCR_COMPOSITOR * pCompositor, struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry, int32_t i32MakeCurrentUserData )
if (!pBlitter)
int rc;
* since the lock order used in presentation thread is compositor lock() -> hash table lock (aquired for id->window resolution)
* this is why, to prevent potential deadlocks, we use crHashtableWalkUnlocked that does not hold the table lock
* we are can be sure noone will modify the table here since renderspuVBoxCompositorClearAll can be called in the command (hgcm) thread only,
if (pCompositor)
return pCompositor;
return NULL;
return rc;
return rc;
int renderspuVBoxCompositorTryAcquire(WindowInfo *window, struct VBOXVR_SCR_COMPOSITOR **ppCompositor)
if (*ppCompositor)
return VINF_SUCCESS;
return rc;
int rc;
if (CrVrScrCompositorIsEmpty(window->pCompositor) && RTCritSectGetRecursion(&window->CompositorLock) == 1)
if (firstCall) {
GLint i, j;
for (i = 0; i < POINTER_HEIGHT; i++) {
for (j = 0; j < POINTER_WIDTH; j++) {
SetRasterPos(x, y);
if (lighting)
if (depthTest)
if (scissorTest)
DoSync();
Barrier *b;
Barrier *b;
(void) name;
(void) count;
(void) name;
(void) name;
(void) name;
if (pCtx)
switch (target)
if (value)
static void RENDER_APIENTRY
(void) target;
(void) value;
switch (target) {
static void RENDER_APIENTRY
int client_num;
unsigned short port;
switch (target) {
case GL_GATHER_CONNECT_CR:
case CR_TCPIP:
case CR_GM:
case GL_GATHER_DRAWPIXELS_CR:
DoSync();
sizeof(CRMessageHeader));
case GL_CURSOR_POSITION_CR:
case GL_WINDOW_SIZE_CR:
GLint w, h;
if (window)
static void RENDER_APIENTRY
switch (target) {
case GL_WINDOW_SIZE_CR:
if (window)
size[0] = w;
case GL_WINDOW_POSITION_CR:
GLint x, y, w, h;
if (window)
case GL_MAX_WINDOW_SIZE_CR:
if (window)
case GL_WINDOW_VISIBILITY_CR:
if (window)
static void RENDER_APIENTRY
(void) bounds;
(void) payload;
(void) len;
(void) num_opcodes;
GLint x, y, w, h;
static void RENDER_APIENTRY
(void) writeback;
remove_trailing_space(char *s)
int k = crStrlen(s);
const char *nativeExt;
return NULL;
if (!nativeExt) {
return NULL;
#ifdef VBOX
snprintf(tempStr, sizeof(tempStr), "Chromium (%s)", (char *) render_spu.ws.glGetString(GL_RENDERER));
#ifdef CR_OPENGL_VERSION_2_0
#ifdef GL_CR_real_vendor_strings
return NULL;
if (!pWindow)