VirtualBox

Ticket #2940: chromium_getstring_passthru.diff

File chromium_getstring_passthru.diff, 4.3 KB (added by Robert Millan, 16 years ago)
  • src/VBox/HostServices/SharedOpenGL/render/renderspu.c

    This patch is licensed under the same terms as the Chromium package.
    
     
    987987        context->extensionString = s2;
    988988        return (const GLubyte *) s2;
    989989    }
    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);
    998992    else
    999993        return NULL;
    1000994}
  • src/VBox/GuestHost/OpenGL/include/state/cr_limits.h

     
    1717#endif
    1818
    1919
    20 /* glGetString strings */
    21 #define CR_RENDERER "Chromium"
    22 #define CR_VENDOR "Humper"
    23 
    24 
    2520#define CR_MAX_TEXTURE_UNITS            8
    2621#define CR_MAX_GENERAL_COMBINERS        8
    2722#define CR_MAX_TEXTURE_SIZE             4096
  • src/VBox/GuestHost/OpenGL/state_tracker/state_getstring.c

     
    2121
    2222        switch( name )
    2323        {
    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;
    3024                case GL_EXTENSIONS:
    3125                        /* This shouldn't normally be queried - the relevant SPU should
    3226                         * catch this query and do all the extension string merging/mucking.
  • src/VBox/Additions/WINNT/Graphics/crOpenGL/pack/packspu.h

     
    3939struct context_info_t {
    4040    CRContext *clientState;  /* used to store client-side GL state */
    4141    GLint serverCtx;         /* context ID returned by server */
     42    char glVendor[100];     /* GL_VENDOR string */
     43    char glRenderer[100];     /* GL_RENDERER string */
    4244    char glVersion[100];     /* GL_VERSION string */
    4345};
    4446
  • src/VBox/Additions/WINNT/Graphics/crOpenGL/pack/packspu_getstring.c

     
    4444}
    4545
    4646
    47 static GLfloat
    48 GetVersionString(void)
     47static void
     48GetString(GLenum name, GLubyte *return_value)
    4949{
    50         GLubyte return_value[100];
    5150        GET_THREAD(thread);
    5251        int writeback = 1;
    53         GLfloat version;
    5452
    5553        if (pack_spu.swap)
    56                 crPackGetStringSWAP( GL_VERSION, return_value, &writeback );
     54                crPackGetStringSWAP( name, return_value, &writeback );
    5755        else
    58                 crPackGetString( GL_VERSION, return_value, &writeback );
     56                crPackGetString( name, return_value, &writeback );
    5957        packspuFlush( (void *) thread );
    6058
    6159        while (writeback)
    6260                crNetRecv();
    6361
    6462        CRASSERT(crStrlen((char *)return_value) < 100);
    65 
    66         version = crStrToFloat((char *) return_value);
    67         version = crStateComputeVersion(version);
    68 
    69         return version;
    7063}
    7164
    7265
     
    7770        {
    7871                return GetExtensions();
    7972        }
     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        }
    8083        else if (name == GL_VERSION)
    8184        {
    82                 float version = GetVersionString();
    83                 sprintf(ctx->glVersion, "%g Chromium %s", version, CR_VERSION_STRING);
     85                GetString(GL_VERSION, ctx->glVersion);
    8486                return (const GLubyte *) ctx->glVersion;
    8587        }
    8688        else

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy