Ticket #2940: chromium_getstring_passthru.diff
| File chromium_getstring_passthru.diff, 4.3 KB (added by , 16 years ago) |
|---|
-
src/VBox/HostServices/SharedOpenGL/render/renderspu.c
This patch is licensed under the same terms as the Chromium package.
987 987 context->extensionString = s2; 988 988 return (const GLubyte *) s2; 989 989 } 990 else if (pname == GL_VENDOR) 991 return (const GLubyte *) CR_VENDOR; 992 else if (pname == GL_VERSION) 993 return render_spu.ws.glGetString(GL_VERSION); 994 else if (pname == GL_RENDERER) { 995 sprintf(tempStr, "Chromium (%s)", (char *) render_spu.ws.glGetString(GL_RENDERER)); 996 return (const GLubyte *) tempStr; 997 } 990 else if (pname == GL_VENDOR || pname == GL_VERSION || pname == GL_RENDERER) 991 return render_spu.ws.glGetString(pname); 998 992 else 999 993 return NULL; 1000 994 } -
src/VBox/GuestHost/OpenGL/include/state/cr_limits.h
17 17 #endif 18 18 19 19 20 /* glGetString strings */21 #define CR_RENDERER "Chromium"22 #define CR_VENDOR "Humper"23 24 25 20 #define CR_MAX_TEXTURE_UNITS 8 26 21 #define CR_MAX_GENERAL_COMBINERS 8 27 22 #define CR_MAX_TEXTURE_SIZE 4096 -
src/VBox/GuestHost/OpenGL/state_tracker/state_getstring.c
21 21 22 22 switch( name ) 23 23 { 24 case GL_VENDOR:25 return (const GLubyte *) CR_VENDOR;26 case GL_RENDERER:27 return (const GLubyte *) CR_RENDERER;28 case GL_VERSION:29 return (const GLubyte *) CR_OPENGL_VERSION_STRING " Chromium " CR_VERSION_STRING;30 24 case GL_EXTENSIONS: 31 25 /* This shouldn't normally be queried - the relevant SPU should 32 26 * catch this query and do all the extension string merging/mucking. -
src/VBox/Additions/WINNT/Graphics/crOpenGL/pack/packspu.h
39 39 struct context_info_t { 40 40 CRContext *clientState; /* used to store client-side GL state */ 41 41 GLint serverCtx; /* context ID returned by server */ 42 char glVendor[100]; /* GL_VENDOR string */ 43 char glRenderer[100]; /* GL_RENDERER string */ 42 44 char glVersion[100]; /* GL_VERSION string */ 43 45 }; 44 46 -
src/VBox/Additions/WINNT/Graphics/crOpenGL/pack/packspu_getstring.c
44 44 } 45 45 46 46 47 static GLfloat48 Get VersionString(void)47 static void 48 GetString(GLenum name, GLubyte *return_value) 49 49 { 50 GLubyte return_value[100];51 50 GET_THREAD(thread); 52 51 int writeback = 1; 53 GLfloat version;54 52 55 53 if (pack_spu.swap) 56 crPackGetStringSWAP( GL_VERSION, return_value, &writeback );54 crPackGetStringSWAP( name, return_value, &writeback ); 57 55 else 58 crPackGetString( GL_VERSION, return_value, &writeback );56 crPackGetString( name, return_value, &writeback ); 59 57 packspuFlush( (void *) thread ); 60 58 61 59 while (writeback) 62 60 crNetRecv(); 63 61 64 62 CRASSERT(crStrlen((char *)return_value) < 100); 65 66 version = crStrToFloat((char *) return_value);67 version = crStateComputeVersion(version);68 69 return version;70 63 } 71 64 72 65 … … 77 70 { 78 71 return GetExtensions(); 79 72 } 73 else if (name == GL_VENDOR) 74 { 75 GetString(GL_VENDOR, ctx->glVendor); 76 return (const GLubyte *) ctx->glVendor; 77 } 78 else if (name == GL_RENDERER) 79 { 80 GetString(GL_RENDERER, ctx->glRenderer); 81 return (const GLubyte *) ctx->glRenderer; 82 } 80 83 else if (name == GL_VERSION) 81 84 { 82 float version = GetVersionString(); 83 sprintf(ctx->glVersion, "%g Chromium %s", version, CR_VERSION_STRING); 85 GetString(GL_VERSION, ctx->glVersion); 84 86 return (const GLubyte *) ctx->glVersion; 85 87 } 86 88 else

