⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 92130 in webkit


Ignore:
Timestamp:
Aug 1, 2011, 9:10:12 AM (15 years ago)
Author:
commit-queue@webkit.org
Message:

[Qt] OpenGLShims does not build on ARM
https://bugs.webkit.org/show_bug.cgi?id=65465

Patch by Benjamin Poulain <benjamin@webkit.org> on 2011-08-01
Reviewed by Noam Rosenthal.

Fix the build with OpenGL ES 2:
-lookupOpenGLFunctionAddress() was defined but not used for OpenGL ES.
-glBlitFramebuffer() and glRenderbufferStorageMultisample() are not part of the specification.
When those are available as platform extension, the extension has been added.
-GLchar is not defined on some platform. The patch adds the same typedef as the official definition
to avoid conflicts.

  • platform/graphics/cairo/OpenGLShims.cpp:

(lookupOpenGLFunctionAddress):
(WebCore::initializeOpenGLShims):

  • platform/graphics/cairo/OpenGLShims.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r92125 r92130  
     12011-08-01  Benjamin Poulain  <benjamin@webkit.org>
     2
     3        [Qt] OpenGLShims does not build on ARM
     4        https://bugs.webkit.org/show_bug.cgi?id=65465
     5
     6        Reviewed by Noam Rosenthal.
     7
     8        Fix the build with OpenGL ES 2:
     9        -lookupOpenGLFunctionAddress() was defined but not used for OpenGL ES.
     10        -glBlitFramebuffer() and glRenderbufferStorageMultisample() are not part of the specification.
     11        When those are available as platform extension, the extension has been added.
     12        -GLchar is not defined on some platform. The patch adds the same typedef as the official definition
     13        to avoid conflicts.
     14
     15        * platform/graphics/cairo/OpenGLShims.cpp:
     16        (lookupOpenGLFunctionAddress):
     17        (WebCore::initializeOpenGLShims):
     18        * platform/graphics/cairo/OpenGLShims.h:
     19
    1202011-08-01  Yury Semikhatsky  <yurys@chromium.org>
    221
  • trunk/Source/WebCore/platform/graphics/cairo/OpenGLShims.cpp

    r91363 r92130  
    2727#include <wtf/text/WTFString.h>
    2828
     29namespace WebCore {
     30
     31OpenGLFunctionTable* openGLFunctionTable()
     32{
     33    static OpenGLFunctionTable table;
     34    return &table;
     35}
     36
    2937#if PLATFORM(QT) && defined(QT_OPENGL_ES_2)
    3038#define ASSIGN_FUNCTION_TABLE_ENTRY(FunctionName, success) \
    3139    openGLFunctionTable()->FunctionName = ::FunctionName
    3240#else
    33 #define ASSIGN_FUNCTION_TABLE_ENTRY(FunctionName, success) \
    34     openGLFunctionTable()->FunctionName = reinterpret_cast<FunctionName##Type>(lookupOpenGLFunctionAddress(#FunctionName, success))
    35 #endif
    36 
    37 namespace WebCore {
    3841
    3942#if PLATFORM(QT)
     
    8790}
    8891
    89 OpenGLFunctionTable* openGLFunctionTable()
    90 {
    91     static OpenGLFunctionTable table;
    92     return &table;
    93 }
     92#define ASSIGN_FUNCTION_TABLE_ENTRY(FunctionName, success) \
     93    openGLFunctionTable()->FunctionName = reinterpret_cast<FunctionName##Type>(lookupOpenGLFunctionAddress(#FunctionName, success))
     94#endif
    9495
    9596bool initializeOpenGLShims()
     
    111112    ASSIGN_FUNCTION_TABLE_ENTRY(glBlendEquationSeparate, success);
    112113    ASSIGN_FUNCTION_TABLE_ENTRY(glBlendFuncSeparate, success);
     114#if defined(GL_ES_VERSION_2_0)
     115
     116#if defined(GL_ANGLE_framebuffer_blit)
     117    openGLFunctionTable()->glBlitFramebuffer = ::GL_ANGLE_framebuffer_blit;
     118#else
     119    openGLFunctionTable()->glBlitFramebuffer = 0;
     120#endif
     121
     122#else
    113123    ASSIGN_FUNCTION_TABLE_ENTRY(glBlitFramebuffer, success);
     124#endif
    114125    ASSIGN_FUNCTION_TABLE_ENTRY(glBufferData, success);
    115126    ASSIGN_FUNCTION_TABLE_ENTRY(glBufferSubData, success);
     
    157168    ASSIGN_FUNCTION_TABLE_ENTRY(glLinkProgram, success);
    158169    ASSIGN_FUNCTION_TABLE_ENTRY(glRenderbufferStorage, success);
     170#if defined(GL_ES_VERSION_2_0)
     171
     172#if defined(GL_APPLE_framebuffer_multisample)
     173    openGLFunctionTable()->glRenderbufferStorageMultisample = ::glRenderbufferStorageMultisampleAPPLE;
     174#elif defined(GL_ANGLE_framebuffer_multisample)
     175    openGLFunctionTable()->glRenderbufferStorageMultisample = ::glRenderbufferStorageMultisampleANGLE;
     176#else
     177    openGLFunctionTable()->glRenderbufferStorageMultisample = 0;
     178#endif
     179
     180#else
    159181    ASSIGN_FUNCTION_TABLE_ENTRY(glRenderbufferStorageMultisample, success);
     182#endif
    160183    ASSIGN_FUNCTION_TABLE_ENTRY(glSampleCoverage, success);
    161184    ASSIGN_FUNCTION_TABLE_ENTRY(glShaderSource, success);
  • trunk/Source/WebCore/platform/graphics/cairo/OpenGLShims.h

    r91363 r92130  
    2222#else
    2323#include <GL/gl.h>
     24#endif
     25
     26#if defined(GL_ES_VERSION_2_0)
     27// Some openGL ES systems miss this typedef.
     28typedef char GLchar;
    2429#endif
    2530
Note: See TracChangeset for help on using the changeset viewer.