Changeset 106772 in webkit


Ignore:
Timestamp:
Feb 5, 2012 8:01:42 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[EFL] Enable WebGL with glx backend
https://bugs.webkit.org/show_bug.cgi?id=77308

Patch by ChangSeok Oh <ChangSeok Oh> on 2012-02-05
Reviewed by Martin Robinson.

.:

Enabled WebGL feature for EFL port. The way is very similar to the one of GTK port.

  • Source/cmake/OptionsEfl.cmake: Added feature option for WebGL.

Source/WebCore:

Implemented WebGL feature for EFL port. The way is very similar to the one of GTK port.

No new tests required. We can verify this feature with the existing test cases.

  • CMakeLists.txt: Revised common files required for WebGL.
  • PlatformEfl.cmake: Added EFL specific files.
  • html/HTMLCanvasElement.cpp:

(WebCore::HTMLCanvasElement::getContext):

  • platform/graphics/ANGLEWebKitBridge.h:
  • platform/graphics/GraphicsContext3D.h:

(WebCore):
(WebCore::GraphicsContext3D::platformTexture):
(GraphicsContext3D):
(WebCore::GraphicsContext3D::paintsIntoCanvasBuffer):

  • platform/graphics/efl/DrawingBufferEfl.cpp: Copied from GTK port.

(WebCore):
(WebCore::DrawingBuffer::DrawingBuffer):
(WebCore::DrawingBuffer::~DrawingBuffer):
(WebCore::DrawingBuffer::platformColorBuffer):
(WebCore::DrawingBuffer::paintCompositedResultsToCanvas):

  • platform/graphics/efl/GraphicsContext3DEfl.cpp: Almost same with GraphicsContext3DGtk.cpp.

(WebCore::GraphicsContext3D::create):
(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::~GraphicsContext3D):
(WebCore::GraphicsContext3D::makeContextCurrent):
(WebCore::GraphicsContext3D::platformGraphicsContext3D):
(WebCore::GraphicsContext3D::isGLES2Compliant):

  • platform/graphics/opengl/Extensions3DOpenGL.cpp:

(WebCore::Extensions3DOpenGL::createVertexArrayOES):
(WebCore::Extensions3DOpenGL::deleteVertexArrayOES):
(WebCore::Extensions3DOpenGL::isVertexArrayOES):
(WebCore::Extensions3DOpenGL::bindVertexArrayOES):

  • platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
  • platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:

Source/WebKit/efl:

Activated WebGL feature.

  • ewk/ewk_view.cpp:

(_Ewk_View_Private_Data):
(_ewk_view_priv_new):

Location:
trunk
Files:
1 added
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r106759 r106772  
     12012-02-05  ChangSeok Oh  <shivamidow@gmail.com>
     2
     3        [EFL] Enable WebGL with glx backend
     4        https://bugs.webkit.org/show_bug.cgi?id=77308
     5
     6        Reviewed by Martin Robinson.
     7
     8        Enabled WebGL feature for EFL port. The way is very similar to the one of GTK port.
     9
     10        * Source/cmake/OptionsEfl.cmake: Added feature option for WebGL.
     11
    1122012-02-05  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
    213
  • trunk/Source/WebCore/CMakeLists.txt

    r106756 r106772  
    20222022        html/HTMLVideoElement.cpp
    20232023        html/MediaFragmentURIParser.cpp
     2024        html/TimeRanges.cpp
    20242025        html/shadow/MediaControlElements.cpp
    2025         html/TimeRanges.cpp
    20262026        platform/graphics/MediaPlayer.cpp
    20272027        rendering/RenderMedia.cpp
     
    21372137        ${DERIVED_SOURCES_WEBCORE_DIR}/glslang_tab.cpp
    21382138        ${THIRDPARTY_DIR}/ANGLE/src/compiler/CodeGenGLSL.cpp
     2139        ${THIRDPARTY_DIR}/ANGLE/src/compiler/BuiltInFunctionEmulator.cpp
     2140        ${THIRDPARTY_DIR}/ANGLE/src/compiler/CodeGenGLSL.cpp
    21392141        ${THIRDPARTY_DIR}/ANGLE/src/compiler/Compiler.cpp
    21402142        ${THIRDPARTY_DIR}/ANGLE/src/compiler/debug.cpp
     2143        ${THIRDPARTY_DIR}/ANGLE/src/compiler/DetectRecursion.cpp
     2144        ${THIRDPARTY_DIR}/ANGLE/src/compiler/ForLoopUnroll.cpp
    21412145        ${THIRDPARTY_DIR}/ANGLE/src/compiler/InfoSink.cpp
    21422146        ${THIRDPARTY_DIR}/ANGLE/src/compiler/Initialize.cpp
     
    21452149        ${THIRDPARTY_DIR}/ANGLE/src/compiler/intermOut.cpp
    21462150        ${THIRDPARTY_DIR}/ANGLE/src/compiler/IntermTraverse.cpp
     2151        ${THIRDPARTY_DIR}/ANGLE/src/compiler/MapLongVariableNames.cpp
    21472152        ${THIRDPARTY_DIR}/ANGLE/src/compiler/ossource_posix.cpp
     2153        ${THIRDPARTY_DIR}/ANGLE/src/compiler/OutputESSL.cpp
    21482154        ${THIRDPARTY_DIR}/ANGLE/src/compiler/OutputGLSL.cpp
     2155        ${THIRDPARTY_DIR}/ANGLE/src/compiler/OutputGLSLBase.cpp
    21492156        ${THIRDPARTY_DIR}/ANGLE/src/compiler/OutputHLSL.cpp
    21502157        ${THIRDPARTY_DIR}/ANGLE/src/compiler/parseConst.cpp
    21512158        ${THIRDPARTY_DIR}/ANGLE/src/compiler/ParseHelper.cpp
    21522159        ${THIRDPARTY_DIR}/ANGLE/src/compiler/PoolAlloc.cpp
    2153         ${THIRDPARTY_DIR}/ANGLE/src/compiler/preprocessor
    21542160        ${THIRDPARTY_DIR}/ANGLE/src/compiler/preprocessor/atom.c
    21552161        ${THIRDPARTY_DIR}/ANGLE/src/compiler/preprocessor/cpp.c
     
    21652171        ${THIRDPARTY_DIR}/ANGLE/src/compiler/SymbolTable.cpp
    21662172        ${THIRDPARTY_DIR}/ANGLE/src/compiler/VersionGLSL.cpp
     2173        ${THIRDPARTY_DIR}/ANGLE/src/compiler/TranslatorESSL.cpp
    21672174        ${THIRDPARTY_DIR}/ANGLE/src/compiler/TranslatorGLSL.cpp
    21682175        ${THIRDPARTY_DIR}/ANGLE/src/compiler/TranslatorHLSL.cpp
     
    21712178        ${THIRDPARTY_DIR}/ANGLE/src/compiler/ValidateLimitations.cpp
    21722179        ${THIRDPARTY_DIR}/ANGLE/src/compiler/VariableInfo.cpp
    2173 
    21742180        html/canvas/WebGLBuffer.cpp
    21752181        html/canvas/WebGLCompressedTextures.cpp
     
    21962202        html/canvas/OESTextureFloat.cpp
    21972203        html/canvas/OESVertexArrayObject.cpp
    2198 
    21992204        platform/graphics/ANGLEWebKitBridge.cpp
    22002205        platform/graphics/GraphicsContext3D.cpp
    2201        
    22022206        platform/graphics/gpu/DrawingBuffer.cpp
    22032207    )
  • trunk/Source/WebCore/ChangeLog

    r106771 r106772  
     12012-02-05  ChangSeok Oh  <shivamidow@gmail.com>
     2
     3        [EFL] Enable WebGL with glx backend
     4        https://bugs.webkit.org/show_bug.cgi?id=77308
     5
     6        Reviewed by Martin Robinson.
     7
     8        Implemented WebGL feature for EFL port. The way is very similar to the one of GTK port.
     9
     10        No new tests required. We can verify this feature with the existing test cases.
     11
     12        * CMakeLists.txt: Revised common files required for WebGL.
     13        * PlatformEfl.cmake: Added EFL specific files.
     14        * html/HTMLCanvasElement.cpp:
     15        (WebCore::HTMLCanvasElement::getContext):
     16        * platform/graphics/ANGLEWebKitBridge.h:
     17        * platform/graphics/GraphicsContext3D.h:
     18        (WebCore):
     19        (WebCore::GraphicsContext3D::platformTexture):
     20        (GraphicsContext3D):
     21        (WebCore::GraphicsContext3D::paintsIntoCanvasBuffer):
     22        * platform/graphics/efl/DrawingBufferEfl.cpp: Copied from GTK port.
     23        (WebCore):
     24        (WebCore::DrawingBuffer::DrawingBuffer):
     25        (WebCore::DrawingBuffer::~DrawingBuffer):
     26        (WebCore::DrawingBuffer::platformColorBuffer):
     27        (WebCore::DrawingBuffer::paintCompositedResultsToCanvas):
     28        * platform/graphics/efl/GraphicsContext3DEfl.cpp: Almost same with GraphicsContext3DGtk.cpp.
     29        (WebCore::GraphicsContext3D::create):
     30        (WebCore::GraphicsContext3D::GraphicsContext3D):
     31        (WebCore::GraphicsContext3D::~GraphicsContext3D):
     32        (WebCore::GraphicsContext3D::makeContextCurrent):
     33        (WebCore::GraphicsContext3D::platformGraphicsContext3D):
     34        (WebCore::GraphicsContext3D::isGLES2Compliant):
     35        * platform/graphics/opengl/Extensions3DOpenGL.cpp:
     36        (WebCore::Extensions3DOpenGL::createVertexArrayOES):
     37        (WebCore::Extensions3DOpenGL::deleteVertexArrayOES):
     38        (WebCore::Extensions3DOpenGL::isVertexArrayOES):
     39        (WebCore::Extensions3DOpenGL::bindVertexArrayOES):
     40        * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
     41        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
     42
    1432012-02-05  Abhishek Arya  <inferno@chromium.org>
    244
  • trunk/Source/WebCore/PlatformEfl.cmake

    r104722 r106772  
    282282ENDIF ()
    283283
    284 
    285284IF (ENABLE_GLIB_SUPPORT)
    286285  LIST(APPEND WebCore_LIBRARIES
     
    295294  LIST(APPEND WebCore_INCLUDE_DIRECTORIES
    296295    ${OPENGL_INCLUDE_DIR}
     296    "${WEBCORE_DIR}/platform/graphics/cairo"
     297    "${WEBCORE_DIR}/platform/graphics/glx"
     298    "${WEBCORE_DIR}/platform/graphics/opengl"
    297299  )
    298300  LIST(APPEND WebCore_LIBRARIES
    299301    ${OPENGL_gl_LIBRARY}
     302  )
     303  LIST(APPEND WebCore_SOURCES
     304    platform/graphics/cairo/GraphicsContext3DCairo.cpp
     305    platform/graphics/cairo/OpenGLShims.cpp
     306    platform/graphics/efl/DrawingBufferEfl.cpp
     307    platform/graphics/efl/GraphicsContext3DEfl.cpp
     308    platform/graphics/glx/GraphicsContext3DPrivate.cpp
     309    platform/graphics/opengl/Extensions3DOpenGL.cpp
     310    platform/graphics/opengl/GraphicsContext3DOpenGL.cpp
     311    platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp
    300312  )
    301313ENDIF ()
  • trunk/Source/WebCore/html/HTMLCanvasElement.cpp

    r106769 r106772  
    178178    Settings* settings = document()->settings();
    179179    if (settings && settings->webGLEnabled()
    180 #if !PLATFORM(CHROMIUM) && !PLATFORM(GTK)
     180#if !PLATFORM(CHROMIUM) && !PLATFORM(GTK) && !PLATFORM(EFL)
    181181        && settings->acceleratedCompositingEnabled()
    182182#endif
  • trunk/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h

    r95901 r106772  
    3232#if PLATFORM(QT)
    3333#include "ANGLE/include/GLSLANG/ShaderLang.h"
    34 #elif !PLATFORM(GTK)
     34#elif !PLATFORM(GTK) && !PLATFORM(EFL)
    3535#include "ANGLE/ShaderLang.h"
    3636#else
  • trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h

    r106320 r106772  
    4444#endif
    4545
    46 #if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(QT)
     46#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL)
    4747#include "ANGLEWebKitBridge.h"
    4848#endif
     
    5858class QRect;
    5959QT_END_NAMESPACE
    60 #elif PLATFORM(GTK)
     60#elif PLATFORM(GTK) || PLATFORM(EFL)
    6161typedef unsigned int GLuint;
    6262#endif
     
    8484class DrawingBuffer;
    8585class Extensions3D;
    86 #if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(QT)
     86#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL)
    8787class Extensions3DOpenGL;
    8888#endif
     
    494494#elif PLATFORM(EFL)
    495495    PlatformGraphicsContext3D platformGraphicsContext3D() const;
     496    Platform3DObject platformTexture() const { return m_texture; }
    496497#if USE(ACCELERATED_COMPOSITING)
    497498    PlatformLayer* platformLayer() const;
     
    506507    bool makeContextCurrent();
    507508
    508 #if PLATFORM(MAC) || PLATFORM(CHROMIUM) || PLATFORM(GTK) || PLATFORM(QT)
     509#if PLATFORM(MAC) || PLATFORM(CHROMIUM) || PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL)
    509510    // With multisampling on, blit from multisampleFBO to regular FBO.
    510511    void prepareTexture();
     
    785786    static void paintToCanvas(const unsigned char* imagePixels, int imageWidth, int imageHeight,
    786787                              int canvasWidth, int canvasHeight, CGContextRef);
    787 #elif PLATFORM(GTK)
     788#elif PLATFORM(GTK) || PLATFORM(EFL)
    788789    void paintToCanvas(const unsigned char* imagePixels, int imageWidth, int imageHeight,
    789790                       int canvasWidth, int canvasHeight, PlatformContextCairo* context);
     
    803804    bool paintsIntoCanvasBuffer() const;
    804805#elif PLATFORM(GTK)
     806    bool paintsIntoCanvasBuffer() const { return true; }
     807#elif PLATFORM(EFL)
    805808    bool paintsIntoCanvasBuffer() const { return true; }
    806809#else
     
    894897                    void* destinationData);
    895898
    896 #if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(QT)
     899#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL)
    897900    // Take into account the user's requested context creation attributes,
    898901    // in particular stencil and antialias, and determine which could or
     
    914917#endif
    915918
    916 #if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(QT)
     919#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL)
    917920    typedef struct {
    918921        String source;
  • trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp

    r106320 r106772  
    11/*
    2     Copyright (C) 2011 Samsung Electronics
    3 
    4    This library is free software; you can redistribute it and/or
    5    modify it under the terms of the GNU Library General Public
    6    License as published by the Free Software Foundation; either
    7    version 2 of the License, or (at your option) any later version.
    8 
    9    This library is distributed in the hope that it will be useful,
    10    but WITHOUT ANY WARRANTY; without even the implied warranty of
    11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    12    Library General Public License for more details.
    13 
    14    You should have received a copy of the GNU Library General Public License
    15    along with this library; see the file COPYING.LIB.  If not, write to
    16    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    17    Boston, MA 02110-1301, USA.
    18 */
     2 * Copyright (C) 2011, 2012 Samsung Electronics
     3 *
     4 * This library is free software; you can redistribute it and/or
     5 * modify it under the terms of the GNU Library General Public
     6 * License as published by the Free Software Foundation; either
     7 * version 2 of the License, or (at your option) any later version.
     8 *
     9 * This library is distributed in the hope that it will be useful,
     10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     12 * Library General Public License for more details.
     13 *
     14 * You should have received a copy of the GNU Library General Public License
     15 * along with this library; see the file COPYING.LIB.  If not, write to
     16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
     17 * Boston, MA 02110-1301, USA.
     18 */
    1919
    2020#include "config.h"
     21#include "GraphicsContext3D.h"
    2122
    2223#if ENABLE(WEBGL)
    23 
    24 #include "GraphicsContext3DInternal.h"
    25 
    26 #include "ImageData.h"
    27 #include "NotImplemented.h"
     24#include "Extensions3DOpenGL.h"
     25#include "GraphicsContext3DPrivate.h"
     26#include "OpenGLShims.h"
     27#include "ShaderLang.h"
    2828
    2929namespace WebCore {
    3030
    31 PassRefPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, RenderStyle renderStyle)
     31PassRefPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attributes attributes, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle)
    3232{
    33     bool renderDirectlyToEvasGLObject = (renderStyle == RenderDirectlyToHostWindow);
    34 
    35     OwnPtr<GraphicsContext3DInternal> internal = GraphicsContext3DInternal::create(attrs, hostWindow, renderDirectlyToEvasGLObject);
    36     if (!internal)
     33    bool renderDirectlyToHostWindow = (renderStyle == RenderDirectlyToHostWindow);
     34    // This implementation doesn't currently support rendering directly to the HostWindow.
     35    if (renderDirectlyToHostWindow)
    3736        return 0;
    3837
    39     RefPtr<GraphicsContext3D> context = adoptRef(new GraphicsContext3D(attrs, hostWindow, renderDirectlyToEvasGLObject));
    40     context->m_internal = internal.release();
     38    OwnPtr<GraphicsContext3DPrivate> priv = GraphicsContext3DPrivate::create();
     39    if (!priv)
     40        return 0;
     41
     42    RefPtr<GraphicsContext3D> context = adoptRef(new GraphicsContext3D(attributes, hostWindow, renderDirectlyToHostWindow));
     43    context->m_private = priv.release();
    4144    return context.release();
    4245}
    4346
    44 GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, bool renderDirectlyToHostWindow)
     47GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attributes, HostWindow* hostWindow, bool renderDirectlyToHostWindow)
    4548    : m_currentWidth(0)
    4649    , m_currentHeight(0)
    47     , m_isResourceSafe(false)
     50    , m_attrs(attributes)
     51    , m_texture(0)
     52    , m_fbo(0)
     53    , m_depthStencilBuffer(0)
     54    , m_boundFBO(0)
     55    , m_multisampleFBO(0)
     56    , m_multisampleDepthStencilBuffer(0)
     57    , m_multisampleColorBuffer(0)
    4858{
     59    GraphicsContext3DPrivate::addActiveGraphicsContext(this);
     60
     61    validateAttributes();
     62
     63    // Create a texture to render into.
     64    ::glGenTextures(1, &m_texture);
     65    ::glBindTexture(GL_TEXTURE_2D, m_texture);
     66    ::glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
     67    ::glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
     68    ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
     69    ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
     70    ::glBindTexture(GL_TEXTURE_2D, 0);
     71
     72    // Create an FBO.
     73    ::glGenFramebuffersEXT(1, &m_fbo);
     74    ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
     75
     76    m_boundFBO = m_fbo;
     77    if (!m_attrs.antialias && (m_attrs.stencil || m_attrs.depth))
     78        ::glGenRenderbuffersEXT(1, &m_depthStencilBuffer);
     79
     80    // Create a multisample FBO.
     81    if (m_attrs.antialias) {
     82        ::glGenFramebuffersEXT(1, &m_multisampleFBO);
     83        ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_multisampleFBO);
     84        m_boundFBO = m_multisampleFBO;
     85        ::glGenRenderbuffersEXT(1, &m_multisampleColorBuffer);
     86        if (m_attrs.stencil || m_attrs.depth)
     87            ::glGenRenderbuffersEXT(1, &m_multisampleDepthStencilBuffer);
     88    }
     89
     90    // ANGLE initialization.
     91    ShBuiltInResources ANGLEResources;
     92    ShInitBuiltInResources(&ANGLEResources);
     93
     94    getIntegerv(GraphicsContext3D::MAX_VERTEX_ATTRIBS, &ANGLEResources.MaxVertexAttribs);
     95    getIntegerv(GraphicsContext3D::MAX_VERTEX_UNIFORM_VECTORS, &ANGLEResources.MaxVertexUniformVectors);
     96    getIntegerv(GraphicsContext3D::MAX_VARYING_VECTORS, &ANGLEResources.MaxVaryingVectors);
     97    getIntegerv(GraphicsContext3D::MAX_VERTEX_TEXTURE_IMAGE_UNITS, &ANGLEResources.MaxVertexTextureImageUnits);
     98    getIntegerv(GraphicsContext3D::MAX_COMBINED_TEXTURE_IMAGE_UNITS, &ANGLEResources.MaxCombinedTextureImageUnits);
     99    getIntegerv(GraphicsContext3D::MAX_TEXTURE_IMAGE_UNITS, &ANGLEResources.MaxTextureImageUnits);
     100    getIntegerv(GraphicsContext3D::MAX_FRAGMENT_UNIFORM_VECTORS, &ANGLEResources.MaxFragmentUniformVectors);
     101
     102    // Always set to 1 for OpenGL ES.
     103    ANGLEResources.MaxDrawBuffers = 1;
     104    m_compiler.setResources(ANGLEResources);
     105
     106    ::glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
     107    ::glEnable(GL_POINT_SPRITE);
     108    ::glClearColor(0, 0, 0, 0);
    49109}
    50110
    51111GraphicsContext3D::~GraphicsContext3D()
    52112{
     113    GraphicsContext3DPrivate::removeActiveGraphicsContext(this);
     114    if (!m_private->m_context)
     115        return;
     116
     117    makeContextCurrent();
     118    ::glDeleteTextures(1, &m_texture);
     119    if (m_attrs.antialias) {
     120        ::glDeleteRenderbuffersEXT(1, &m_multisampleColorBuffer);
     121        if (m_attrs.stencil || m_attrs.depth)
     122            ::glDeleteRenderbuffersEXT(1, &m_multisampleDepthStencilBuffer);
     123        ::glDeleteFramebuffersEXT(1, &m_multisampleFBO);
     124    } else {
     125        if (m_attrs.stencil || m_attrs.depth)
     126            ::glDeleteRenderbuffersEXT(1, &m_depthStencilBuffer);
     127    }
     128    ::glDeleteFramebuffersEXT(1, &m_fbo);
     129}
     130
     131bool GraphicsContext3D::makeContextCurrent()
     132{
     133    if (!m_private)
     134        return false;
     135    return m_private->makeContextCurrent();
    53136}
    54137
    55138PlatformGraphicsContext3D GraphicsContext3D::platformGraphicsContext3D() const
    56139{
    57     return m_internal->platformGraphicsContext3D();
    58 }
    59 
    60 #if USE(ACCELERATED_COMPOSITING)
    61 PlatformLayer* GraphicsContext3D::platformLayer() const
    62 {
    63     notImplemented();
    64     return 0;
    65 }
    66 #endif
    67 
    68 bool GraphicsContext3D::makeContextCurrent()
    69 {
    70     m_internal->makeContextCurrent();
    71     return true;
     140    return m_private->m_context;
    72141}
    73142
    74143bool GraphicsContext3D::isGLES2Compliant() const
    75144{
    76     return m_internal->isGLES2Compliant();
    77 }
    78 
    79 void GraphicsContext3D::activeTexture(GC3Denum texture)
    80 {
    81     m_internal->activeTexture(texture);
    82 }
    83 
    84 void GraphicsContext3D::attachShader(Platform3DObject program, Platform3DObject shader)
    85 {
    86     m_internal->attachShader(program, shader);
    87 }
    88 
    89 void GraphicsContext3D::bindAttribLocation(Platform3DObject program, GC3Duint index, const String& name)
    90 {
    91     m_internal->bindAttribLocation(program, index, name);
    92 }
    93 
    94 void GraphicsContext3D::bindBuffer(GC3Denum target, Platform3DObject buffer)
    95 {
    96     m_internal->bindBuffer(target, buffer);
    97 }
    98 
    99 void GraphicsContext3D::bindFramebuffer(GC3Denum target, Platform3DObject buffer)
    100 {
    101     m_internal->bindFramebuffer(target, buffer);
    102 }
    103 
    104 void GraphicsContext3D::bindRenderbuffer(GC3Denum target, Platform3DObject renderbuffer)
    105 {
    106     m_internal->bindRenderbuffer(target, renderbuffer);
    107 }
    108 
    109 void GraphicsContext3D::bindTexture(GC3Denum target, Platform3DObject texture)
    110 {
    111     m_internal->bindTexture(target, texture);
    112 }
    113 
    114 void GraphicsContext3D::blendColor(GC3Dclampf red, GC3Dclampf green, GC3Dclampf blue, GC3Dclampf alpha)
    115 {
    116     m_internal->blendColor(red, green, blue, alpha);
    117 }
    118 
    119 void GraphicsContext3D::blendEquation(GC3Denum mode)
    120 {
    121     m_internal->blendEquation(mode);
    122 }
    123 
    124 void GraphicsContext3D::blendEquationSeparate(GC3Denum modeRGB, GC3Denum modeAlpha)
    125 {
    126     m_internal->blendEquationSeparate(modeRGB, modeAlpha);
    127 }
    128 
    129 void GraphicsContext3D::blendFunc(GC3Denum srcFactor, GC3Denum dstFactor)
    130 {
    131     m_internal->blendFunc(srcFactor, dstFactor);
    132 }
    133 
    134 void GraphicsContext3D::blendFuncSeparate(GC3Denum srcRGB, GC3Denum dstRGB, GC3Denum srcAlpha, GC3Denum dstAlpha)
    135 {
    136     m_internal->blendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
    137 }
    138 
    139 void GraphicsContext3D::bufferData(GC3Denum target, GC3Dsizeiptr size, GC3Denum usage)
    140 {
    141     m_internal->bufferData(target, size, 0, usage);
    142 }
    143 
    144 void GraphicsContext3D::bufferData(GC3Denum target, GC3Dsizeiptr size, const void* data, GC3Denum usage)
    145 {
    146     m_internal->bufferData(target, size, data, usage);
    147 }
    148 
    149 void GraphicsContext3D::bufferSubData(GC3Denum target, GC3Dintptr offset, GC3Dsizeiptr size, const void* data)
    150 {
    151     m_internal->bufferSubData(target, offset, size, data);
    152 }
    153 
    154 GC3Denum GraphicsContext3D::checkFramebufferStatus(GC3Denum target)
    155 {
    156     return m_internal->checkFramebufferStatus(target);
    157 }
    158 
    159 void GraphicsContext3D::clear(GC3Dbitfield mask)
    160 {
    161     m_internal->clear(mask);
    162 }
    163 
    164 void GraphicsContext3D::clearColor(GC3Dclampf red, GC3Dclampf green, GC3Dclampf blue, GC3Dclampf alpha)
    165 {
    166     m_internal->clearColor(red, green, blue, alpha);
    167 }
    168 
    169 void GraphicsContext3D::clearDepth(GC3Dclampf depth)
    170 {
    171     m_internal->clearDepth(depth);
    172 }
    173 
    174 void GraphicsContext3D::clearStencil(GC3Dint clearValue)
    175 {
    176     m_internal->clearStencil(clearValue);
    177 }
    178 
    179 void GraphicsContext3D::colorMask(GC3Dboolean red, GC3Dboolean green, GC3Dboolean blue, GC3Dboolean alpha)
    180 {
    181     m_internal->colorMask(red, green, blue, alpha);
    182 }
    183 
    184 void GraphicsContext3D::compileShader(Platform3DObject shader)
    185 {
    186     m_internal->compileShader(shader);
    187 }
    188 
    189 void GraphicsContext3D::copyTexImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height, GC3Dint border)
    190 {
    191     m_internal->copyTexImage2D(target, level, internalformat, x, y, width, height, border);
    192 }
    193 
    194 void GraphicsContext3D::copyTexSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xOffset, GC3Dint yOffset, GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height)
    195 {
    196     m_internal->copyTexSubImage2D(target, level, xOffset, yOffset, x, y, width, height);
    197 }
    198 
    199 void GraphicsContext3D::compressedTexImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Dsizei imageSize, const void* data)
    200 {
    201     // FIXME: Add support for compressedTexImage2D.
    202     // m_internal->compressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
    203 }
    204 
    205 void GraphicsContext3D::compressedTexSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Dsizei imageSize, const void* data)
    206 {
    207     // FIXME: Add support for compressedTexSubImage2D.
    208     // m_internal->compressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
    209 }
    210 
    211 void GraphicsContext3D::cullFace(GC3Denum mode)
    212 {
    213     m_internal->cullFace(mode);
    214 }
    215 
    216 void GraphicsContext3D::depthFunc(GC3Denum func)
    217 {
    218     m_internal->depthFunc(func);
    219 }
    220 
    221 void GraphicsContext3D::depthMask(GC3Dboolean flag)
    222 {
    223     m_internal->depthMask(flag);
    224 }
    225 
    226 void GraphicsContext3D::depthRange(GC3Dclampf zNear, GC3Dclampf zFar)
    227 {
    228     m_internal->depthRange(zNear, zFar);
    229 }
    230 
    231 void GraphicsContext3D::detachShader(Platform3DObject program, Platform3DObject shader)
    232 {
    233     m_internal->detachShader(program, shader);
    234 }
    235 
    236 void GraphicsContext3D::disable(GC3Denum cap)
    237 {
    238     m_internal->disable(cap);
    239 }
    240 
    241 void GraphicsContext3D::disableVertexAttribArray(GC3Duint index)
    242 {
    243     m_internal->disableVertexAttribArray(index);
    244 }
    245 
    246 void GraphicsContext3D::drawArrays(GC3Denum mode, GC3Dint first, GC3Dsizei count)
    247 {
    248     m_internal->drawArrays(mode, first, count);
    249 }
    250 
    251 void GraphicsContext3D::drawElements(GC3Denum mode, GC3Dsizei count, GC3Denum type, GC3Dintptr offset)
    252 {
    253     m_internal->drawElements(mode, count, type, offset);
    254 }
    255 
    256 void GraphicsContext3D::enable(GC3Denum cap)
    257 {
    258     m_internal->enable(cap);
    259 }
    260 
    261 void GraphicsContext3D::enableVertexAttribArray(GC3Duint index)
    262 {
    263     m_internal->enableVertexAttribArray(index);
    264 }
    265 
    266 void GraphicsContext3D::finish()
    267 {
    268     m_internal->finish();
    269 }
    270 
    271 void GraphicsContext3D::flush()
    272 {
    273     m_internal->flush();
    274 }
    275 
    276 void GraphicsContext3D::framebufferRenderbuffer(GC3Denum target, GC3Denum attachment, GC3Denum renderbufferTarget, Platform3DObject buffer)
    277 {
    278     m_internal->framebufferRenderbuffer(target, attachment, renderbufferTarget, buffer);
    279 }
    280 
    281 void GraphicsContext3D::framebufferTexture2D(GC3Denum target, GC3Denum attachment, GC3Denum texTarget, Platform3DObject texture, GC3Dint level)
    282 {
    283     m_internal->framebufferTexture2D(target, attachment, texTarget, texture, level);
    284 }
    285 
    286 void GraphicsContext3D::frontFace(GC3Denum mode)
    287 {
    288     m_internal->frontFace(mode);
    289 }
    290 
    291 void GraphicsContext3D::generateMipmap(GC3Denum target)
    292 {
    293     m_internal->generateMipmap(target);
    294 }
    295 
    296 bool GraphicsContext3D::getActiveAttrib(Platform3DObject program, GC3Duint index, ActiveInfo& info)
    297 {
    298     return m_internal->getActiveAttrib(program, index, info);
    299 }
    300 
    301 bool GraphicsContext3D::getActiveUniform(Platform3DObject program, GC3Duint index, ActiveInfo& info)
    302 {
    303     return m_internal->getActiveUniform(program, index, info);
    304 }
    305 
    306 void GraphicsContext3D::getAttachedShaders(Platform3DObject program, GC3Dsizei maxCount, GC3Dsizei* count, Platform3DObject* shaders)
    307 {
    308     m_internal->getAttachedShaders(program, maxCount, count, shaders);
    309 }
    310 
    311 int GraphicsContext3D::getAttribLocation(Platform3DObject program, const String& name)
    312 {
    313     return m_internal->getAttribLocation(program, name);
    314 }
    315 
    316 void GraphicsContext3D::getBooleanv(GC3Denum paramName, GC3Dboolean* value)
    317 {
    318     m_internal->getBooleanv(paramName, value);
    319 }
    320 
    321 void GraphicsContext3D::getBufferParameteriv(GC3Denum target, GC3Denum paramName, GC3Dint* value)
    322 {
    323     m_internal->getBufferParameteriv(target, paramName, value);
    324 }
    325 
    326 GraphicsContext3D::Attributes GraphicsContext3D::getContextAttributes()
    327 {
    328     return m_internal->getContextAttributes();
    329 }
    330 
    331 GC3Denum GraphicsContext3D::getError()
    332 {
    333     return m_internal->getError();
    334 }
    335 
    336 void GraphicsContext3D::getFloatv(GC3Denum paramName, GC3Dfloat* value)
    337 {
    338     m_internal->getFloatv(paramName, value);
    339 }
    340 
    341 void GraphicsContext3D::getFramebufferAttachmentParameteriv(GC3Denum target, GC3Denum attachment, GC3Denum paramName, GC3Dint* value)
    342 {
    343     m_internal->getFramebufferAttachmentParameteriv(target, attachment, paramName, value);
    344 }
    345 
    346 void GraphicsContext3D::getIntegerv(GC3Denum paramName, GC3Dint* value)
    347 {
    348     m_internal->getIntegerv(paramName, value);
    349 }
    350 
    351 void GraphicsContext3D::getProgramiv(Platform3DObject program, GC3Denum paramName, GC3Dint* value)
    352 {
    353     m_internal->getProgramiv(program, paramName, value);
    354 }
    355 
    356 String GraphicsContext3D::getProgramInfoLog(Platform3DObject program)
    357 {
    358     return m_internal->getProgramInfoLog(program);
    359 }
    360 
    361 void GraphicsContext3D::getRenderbufferParameteriv(GC3Denum target, GC3Denum paramName, GC3Dint* value)
    362 {
    363     m_internal->getRenderbufferParameteriv(target, paramName, value);
    364 }
    365 
    366 void GraphicsContext3D::getShaderiv(Platform3DObject shader, GC3Denum paramName, GC3Dint* value)
    367 {
    368     m_internal->getShaderiv(shader, paramName, value);
    369 }
    370 
    371 String GraphicsContext3D::getShaderInfoLog(Platform3DObject shader)
    372 {
    373     return m_internal->getShaderInfoLog(shader);
    374 }
    375 
    376 String GraphicsContext3D::getShaderSource(Platform3DObject shader)
    377 {
    378     return m_internal->getShaderSource(shader);
    379 }
    380 
    381 String GraphicsContext3D::getString(GC3Denum name)
    382 {
    383     return m_internal->getString(name);
    384 }
    385 
    386 void GraphicsContext3D::getTexParameterfv(GC3Denum target, GC3Denum paramName, GC3Dfloat* value)
    387 {
    388     m_internal->getTexParameterfv(target, paramName, value);
    389 }
    390 
    391 void GraphicsContext3D::getTexParameteriv(GC3Denum target, GC3Denum paramName, GC3Dint* value)
    392 {
    393     m_internal->getTexParameteriv(target, paramName, value);
    394 }
    395 
    396 void GraphicsContext3D::getUniformfv(Platform3DObject program, GC3Dint location, GC3Dfloat* value)
    397 {
    398     m_internal->getUniformfv(program, location, value);
    399 }
    400 
    401 void GraphicsContext3D::getUniformiv(Platform3DObject program, GC3Dint location, GC3Dint* value)
    402 {
    403     m_internal->getUniformiv(program, location, value);
    404 }
    405 
    406 GC3Dint GraphicsContext3D::getUniformLocation(Platform3DObject program, const String& name)
    407 {
    408     return m_internal->getUniformLocation(program, name);
    409 }
    410 
    411 void GraphicsContext3D::getVertexAttribfv(GC3Duint index, GC3Denum paramName, GC3Dfloat* value)
    412 {
    413     m_internal->getVertexAttribfv(index, paramName, value);
    414 }
    415 
    416 void GraphicsContext3D::getVertexAttribiv(GC3Duint index, GC3Denum paramName, GC3Dint* value)
    417 {
    418     m_internal->getVertexAttribiv(index, paramName, value);
    419 }
    420 
    421 long GraphicsContext3D::getVertexAttribOffset(GC3Duint index, GC3Denum paramName)
    422 {
    423     return m_internal->getVertexAttribOffset(index, paramName);
    424 }
    425 
    426 void GraphicsContext3D::hint(GC3Denum target, GC3Denum mode)
    427 {
    428     m_internal->hint(target, mode);
    429 }
    430 
    431 GC3Dboolean GraphicsContext3D::isBuffer(Platform3DObject obj)
    432 {
    433     return m_internal->isBuffer(obj);
    434 }
    435 
    436 GC3Dboolean GraphicsContext3D::isEnabled(GC3Denum cap)
    437 {
    438     return m_internal->isEnabled(cap);
    439 }
    440 
    441 GC3Dboolean GraphicsContext3D::isFramebuffer(Platform3DObject obj)
    442 {
    443     return m_internal->isFramebuffer(obj);
    444 }
    445 
    446 GC3Dboolean GraphicsContext3D::isProgram(Platform3DObject obj)
    447 {
    448     return m_internal->isProgram(obj);
    449 }
    450 
    451 GC3Dboolean GraphicsContext3D::isRenderbuffer(Platform3DObject obj)
    452 {
    453     return m_internal->isRenderbuffer(obj);
    454 }
    455 
    456 GC3Dboolean GraphicsContext3D::isShader(Platform3DObject obj)
    457 {
    458     return m_internal->isShader(obj);
    459 }
    460 
    461 GC3Dboolean GraphicsContext3D::isTexture(Platform3DObject obj)
    462 {
    463     return m_internal->isTexture(obj);
    464 }
    465 
    466 void GraphicsContext3D::lineWidth(GC3Dfloat width)
    467 {
    468     m_internal->lineWidth(width);
    469 }
    470 
    471 void GraphicsContext3D::linkProgram(Platform3DObject program)
    472 {
    473     m_internal->linkProgram(program);
    474 }
    475 
    476 void GraphicsContext3D::pixelStorei(GC3Denum paramName, GC3Dint param)
    477 {
    478     m_internal->pixelStorei(paramName, param);
    479 }
    480 
    481 void GraphicsContext3D::polygonOffset(GC3Dfloat factor, GC3Dfloat units)
    482 {
    483     m_internal->polygonOffset(factor, units);
    484 }
    485 
    486 void GraphicsContext3D::readPixels(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, void* data)
    487 {
    488     m_internal->readPixels(x, y, width, height, format, type, data);
    489 }
    490 
    491 void GraphicsContext3D::releaseShaderCompiler()
    492 {
    493     notImplemented();
    494 }
    495 
    496 void GraphicsContext3D::renderbufferStorage(GC3Denum target, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height)
    497 {
    498     m_internal->renderbufferStorage(target, internalformat, width, height);
    499 }
    500 
    501 void GraphicsContext3D::sampleCoverage(GC3Dclampf value, GC3Dboolean invert)
    502 {
    503     m_internal->sampleCoverage(value, invert);
    504 }
    505 
    506 void GraphicsContext3D::scissor(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height)
    507 {
    508     m_internal->scissor(x, y, width, height);
    509 }
    510 
    511 void GraphicsContext3D::shaderSource(Platform3DObject program, const String& string)
    512 {
    513     m_internal->shaderSource(program, string);
    514 }
    515 
    516 void GraphicsContext3D::stencilFunc(GC3Denum func, GC3Dint ref, GC3Duint mask)
    517 {
    518     m_internal->stencilFunc(func, ref, mask);
    519 }
    520 
    521 void GraphicsContext3D::stencilFuncSeparate(GC3Denum face, GC3Denum func, GC3Dint ref, GC3Duint mask)
    522 {
    523     m_internal->stencilFuncSeparate(face, func, ref, mask);
    524 }
    525 
    526 void GraphicsContext3D::stencilMask(GC3Duint mask)
    527 {
    528     m_internal->stencilMask(mask);
    529 }
    530 
    531 void GraphicsContext3D::stencilMaskSeparate(GC3Denum face, GC3Duint mask)
    532 {
    533     m_internal->stencilMaskSeparate(face, mask);
    534 }
    535 
    536 void GraphicsContext3D::stencilOp(GC3Denum fail, GC3Denum zfail, GC3Denum zpass)
    537 {
    538     m_internal->stencilOp(fail, zfail, zpass);
    539 }
    540 
    541 void GraphicsContext3D::stencilOpSeparate(GC3Denum face, GC3Denum fail, GC3Denum zfail, GC3Denum zpass)
    542 {
    543     m_internal->stencilOpSeparate(face, fail, zfail, zpass);
    544 }
    545 
    546 bool GraphicsContext3D::texImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type, const void* pixels)
    547 {
    548     return m_internal->texImage2D(target, level, internalformat, width, height, border, format, type, pixels);
    549 }
    550 
    551 void GraphicsContext3D::texParameterf(GC3Denum target, GC3Denum paramName, GC3Dfloat param)
    552 {
    553     m_internal->texParameterf(target, paramName, param);
    554 }
    555 
    556 void GraphicsContext3D::texParameteri(GC3Denum target, GC3Denum paramName, GC3Dint param)
    557 {
    558     m_internal->texParameteri(target, paramName, param);
    559 }
    560 
    561 void GraphicsContext3D::texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xOffset, GC3Dint yOffset, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, const void* pixels)
    562 {
    563     m_internal->texSubImage2D(target, level, xOffset, yOffset, width, height, format, type, pixels);
    564 }
    565 
    566 void GraphicsContext3D::uniform1f(GC3Dint location, GC3Dfloat x)
    567 {
    568     m_internal->uniform1f(location, x);
    569 }
    570 
    571 void GraphicsContext3D::uniform1fv(GC3Dint location, GC3Dfloat* v, GC3Dsizei size)
    572 {
    573     m_internal->uniform1fv(location, size, v);
    574 }
    575 
    576 void GraphicsContext3D::uniform1i(GC3Dint location, GC3Dint x)
    577 {
    578     m_internal->uniform1i(location, x);
    579 }
    580 
    581 void GraphicsContext3D::uniform1iv(GC3Dint location, GC3Dint* v, GC3Dsizei size)
    582 {
    583     m_internal->uniform1iv(location, size, v);
    584 }
    585 
    586 void GraphicsContext3D::uniform2f(GC3Dint location, GC3Dfloat x, float y)
    587 {
    588     m_internal->uniform2f(location, x, y);
    589 }
    590 
    591 void GraphicsContext3D::uniform2fv(GC3Dint location, GC3Dfloat* v, GC3Dsizei size)
    592 {
    593     m_internal->uniform2fv(location, size, v);
    594 }
    595 
    596 void GraphicsContext3D::uniform2i(GC3Dint location, GC3Dint x, GC3Dint y)
    597 {
    598     m_internal->uniform2i(location, x, y);
    599 }
    600 
    601 void GraphicsContext3D::uniform2iv(GC3Dint location, GC3Dint* v, GC3Dsizei size)
    602 {
    603     m_internal->uniform2iv(location, size, v);
    604 }
    605 
    606 void GraphicsContext3D::uniform3f(GC3Dint location, GC3Dfloat x, GC3Dfloat y, GC3Dfloat z)
    607 {
    608     m_internal->uniform3f(location, x, y, z);
    609 }
    610 
    611 void GraphicsContext3D::uniform3fv(GC3Dint location, GC3Dfloat* v, GC3Dsizei size)
    612 {
    613     m_internal->uniform3fv(location, size, v);
    614 }
    615 
    616 void GraphicsContext3D::uniform3i(GC3Dint location, GC3Dint x, GC3Dint y, GC3Dint z)
    617 {
    618     m_internal->uniform3i(location, x, y, z);
    619 }
    620 
    621 void GraphicsContext3D::uniform3iv(GC3Dint location, GC3Dint* v, GC3Dsizei size)
    622 {
    623     m_internal->uniform3iv(location, size, v);
    624 }
    625 
    626 void GraphicsContext3D::uniform4f(GC3Dint location, GC3Dfloat x, GC3Dfloat y, GC3Dfloat z, GC3Dfloat w)
    627 {
    628     m_internal->uniform4f(location, x, y, z, w);
    629 }
    630 
    631 void GraphicsContext3D::uniform4fv(GC3Dint location, GC3Dfloat* v, GC3Dsizei size)
    632 {
    633     m_internal->uniform4fv(location, size, v);
    634 }
    635 
    636 void GraphicsContext3D::uniform4i(GC3Dint location, GC3Dint x, GC3Dint y, GC3Dint z, GC3Dint w)
    637 {
    638     m_internal->uniform4i(location, x, y, z, w);
    639 }
    640 
    641 void GraphicsContext3D::uniform4iv(GC3Dint location, GC3Dint* v, GC3Dsizei size)
    642 {
    643     m_internal->uniform4iv(location, size, v);
    644 }
    645 
    646 void GraphicsContext3D::uniformMatrix2fv(GC3Dint location, GC3Dboolean transpose, GC3Dfloat* value, GC3Dsizei size)
    647 {
    648     m_internal->uniformMatrix2fv(location, size, transpose, value);
    649 }
    650 
    651 void GraphicsContext3D::uniformMatrix3fv(GC3Dint location, GC3Dboolean transpose, GC3Dfloat* value, GC3Dsizei size)
    652 {
    653     m_internal->uniformMatrix3fv(location, size, transpose, value);
    654 }
    655 
    656 void GraphicsContext3D::uniformMatrix4fv(GC3Dint location, GC3Dboolean transpose, GC3Dfloat* value, GC3Dsizei size)
    657 {
    658     m_internal->uniformMatrix4fv(location, size, transpose, value);
    659 }
    660 
    661 void GraphicsContext3D::useProgram(Platform3DObject program)
    662 {
    663     m_internal->useProgram(program);
    664 }
    665 
    666 void GraphicsContext3D::validateProgram(Platform3DObject program)
    667 {
    668     m_internal->validateProgram(program);
    669 }
    670 
    671 void GraphicsContext3D::vertexAttrib1f(GC3Duint index, GC3Dfloat x)
    672 {
    673     m_internal->vertexAttrib1f(index, x);
    674 }
    675 
    676 void GraphicsContext3D::vertexAttrib1fv(GC3Duint index, GC3Dfloat* values)
    677 {
    678     m_internal->vertexAttrib1fv(index, values);
    679 }
    680 
    681 void GraphicsContext3D::vertexAttrib2f(GC3Duint index, GC3Dfloat x, GC3Dfloat y)
    682 {
    683     m_internal->vertexAttrib2f(index, x, y);
    684 }
    685 
    686 void GraphicsContext3D::vertexAttrib2fv(GC3Duint index, GC3Dfloat* values)
    687 {
    688     m_internal->vertexAttrib2fv(index, values);
    689 }
    690 
    691 void GraphicsContext3D::vertexAttrib3f(GC3Duint index, GC3Dfloat x, GC3Dfloat y, GC3Dfloat z)
    692 {
    693     m_internal->vertexAttrib3f(index, x, y, z);
    694 }
    695 
    696 void GraphicsContext3D::vertexAttrib3fv(GC3Duint index, GC3Dfloat* values)
    697 {
    698     m_internal->vertexAttrib3fv(index, values);
    699 }
    700 
    701 void GraphicsContext3D::vertexAttrib4f(GC3Duint index, GC3Dfloat x, GC3Dfloat y, GC3Dfloat z, GC3Dfloat w)
    702 {
    703     m_internal->vertexAttrib4f(index, x, y, z, w);
    704 }
    705 
    706 void GraphicsContext3D::vertexAttrib4fv(GC3Duint index, GC3Dfloat* values)
    707 {
    708     m_internal->vertexAttrib4fv(index, values);
    709 }
    710 
    711 void GraphicsContext3D::vertexAttribPointer(GC3Duint index, GC3Dint size, GC3Denum type, GC3Dboolean normalized, GC3Dsizei stride, GC3Dintptr offset)
    712 {
    713     m_internal->vertexAttribPointer(index, size, type, normalized, stride, offset);
    714 }
    715 
    716 void GraphicsContext3D::viewport(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height)
    717 {
    718     m_internal->viewport(x, y, width, height);
    719 }
    720 
    721 void GraphicsContext3D::reshape(int width, int height)
    722 {
    723     notImplemented();
    724 }
    725 
    726 void GraphicsContext3D::markContextChanged()
    727 {
    728     notImplemented();
    729 }
    730 
    731 void GraphicsContext3D::markLayerComposited()
    732 {
    733     notImplemented();
    734 }
    735 
    736 bool GraphicsContext3D::layerComposited() const
    737 {
    738     notImplemented();
    739     return false;
    740 }
    741 
    742 void GraphicsContext3D::paintRenderingResultsToCanvas(CanvasRenderingContext* context, DrawingBuffer* drawingBuffer)
    743 {
    744     // DrawingBuffer support only implemented in Chromium ports.
    745     ASSERT(!drawingBuffer);
    746     notImplemented();
    747 }
    748 
    749 PassRefPtr<ImageData> GraphicsContext3D::paintRenderingResultsToImageData(DrawingBuffer* drawingBuffer)
    750 {
    751     // DrawingBuffer support only implemented in Chromium ports.
    752     ASSERT(!drawingBuffer);
    753     notImplemented();
    754     RefPtr<ImageData> imageData = ImageData::create(IntSize(1, 1));
    755     return imageData.release();
    756 }
    757 
    758 Platform3DObject GraphicsContext3D::createBuffer()
    759 {
    760     return m_internal->createBuffer();
    761 }
    762 
    763 Platform3DObject GraphicsContext3D::createFramebuffer()
    764 {
    765     return m_internal->createFramebuffer();
    766 }
    767 
    768 Platform3DObject GraphicsContext3D::createProgram()
    769 {
    770     return m_internal->createProgram();
    771 }
    772 
    773 Platform3DObject GraphicsContext3D::createRenderbuffer()
    774 {
    775     return m_internal->createRenderbuffer();
    776 }
    777 
    778 Platform3DObject GraphicsContext3D::createShader(GC3Denum type)
    779 {
    780     return m_internal->createShader(type);
    781 }
    782 
    783 Platform3DObject GraphicsContext3D::createTexture()
    784 {
    785     return m_internal->createTexture();
    786 }
    787 
    788 void GraphicsContext3D::deleteBuffer(Platform3DObject buffer)
    789 {
    790     m_internal->deleteBuffer(buffer);
    791 }
    792 
    793 void GraphicsContext3D::deleteFramebuffer(Platform3DObject buffer)
    794 {
    795     m_internal->deleteFramebuffer(buffer);
    796 }
    797 
    798 void GraphicsContext3D::deleteProgram(Platform3DObject program)
    799 {
    800     m_internal->deleteProgram(program);
    801 }
    802 
    803 void GraphicsContext3D::deleteRenderbuffer(Platform3DObject buffer)
    804 {
    805     m_internal->deleteRenderbuffer(buffer);
    806 }
    807 
    808 void GraphicsContext3D::deleteShader(Platform3DObject shader)
    809 {
    810     m_internal->deleteShader(shader);
    811 }
    812 
    813 void GraphicsContext3D::deleteTexture(Platform3DObject texture)
    814 {
    815     m_internal->deleteTexture(texture);
    816 }
    817 
    818 void GraphicsContext3D::synthesizeGLError(GC3Denum error)
    819 {
    820     m_internal->synthesizeGLError(error);
    821 }
    822 
    823 Extensions3D* GraphicsContext3D::getExtensions()
    824 {
    825     return m_internal->getExtensions();
    826 }
    827 
    828 IntSize GraphicsContext3D::getInternalFramebufferSize()
    829 {
    830     notImplemented();
    831     return IntSize();
    832 }
    833 
    834 void GraphicsContext3D::setContextLostCallback(PassOwnPtr<ContextLostCallback>)
    835 {
    836     notImplemented();
    837 }
    838 
    839 void GraphicsContext3D::setErrorMessageCallback(PassOwnPtr<ErrorMessageCallback>)
    840 {
    841     notImplemented();
    842 }
    843 
    844 bool GraphicsContext3D::getImageData(Image* image, GC3Denum format, GC3Denum type, bool premultiplyAlpha,
    845                                      bool ignoreGammaAndColorProfile, Vector<uint8_t>& outputVector)
    846 {
    847     notImplemented();
    848145    return false;
    849146}
  • trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp

    r97896 r106772  
    3636#include "ANGLE/ShaderLang.h"
    3737#include <OpenGL/gl.h>
    38 #elif PLATFORM(GTK)
     38#elif PLATFORM(GTK) || PLATFORM(EFL)
    3939#include "OpenGLShims.h"
    4040#elif PLATFORM(QT)
     
    150150{
    151151    m_context->makeContextCurrent();
    152 #if !PLATFORM(GTK) && !PLATFORM(QT) && defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object
     152#if !PLATFORM(GTK) && !PLATFORM(QT) && !PLATFORM(EFL) && defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object
    153153    GLuint array = 0;
    154154    glGenVertexArraysAPPLE(1, &array);
     
    165165   
    166166    m_context->makeContextCurrent();
    167 #if !PLATFORM(GTK) && !PLATFORM(QT) && defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object
     167#if !PLATFORM(GTK) && !PLATFORM(QT) && !PLATFORM(EFL) && defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object
    168168    glDeleteVertexArraysAPPLE(1, &array);
    169169#endif
     
    176176   
    177177    m_context->makeContextCurrent();
    178 #if !PLATFORM(GTK) && !PLATFORM(QT) && defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object
     178#if !PLATFORM(GTK) && !PLATFORM(QT) && !PLATFORM(EFL) && defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object
    179179    return glIsVertexArrayAPPLE(array);
    180180#else
     
    189189
    190190    m_context->makeContextCurrent();
    191 #if !PLATFORM(GTK) && !PLATFORM(QT) && defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object
     191#if !PLATFORM(GTK) && !PLATFORM(QT) && !PLATFORM(EFL) && defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object
    192192    glBindVertexArrayAPPLE(array);
    193193#endif
  • trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp

    r104896 r106772  
    3535#if PLATFORM(MAC)
    3636#include <OpenGL/gl.h>
    37 #elif PLATFORM(GTK)
     37#elif PLATFORM(GTK) || PLATFORM(EFL)
    3838#include "OpenGLShims.h"
    3939#elif PLATFORM(QT)
  • trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp

    r104896 r106772  
    4949#if PLATFORM(MAC)
    5050#include <OpenGL/gl.h>
    51 #elif PLATFORM(GTK)
     51#elif PLATFORM(GTK) || PLATFORM(EFL)
    5252#include "OpenGLShims.h"
    5353#elif PLATFORM(QT)
  • trunk/Source/WebKit/efl/ChangeLog

    r106760 r106772  
     12012-02-05  ChangSeok Oh  <shivamidow@gmail.com>
     2
     3        [EFL] Enable WebGL with glx backend
     4        https://bugs.webkit.org/show_bug.cgi?id=77308
     5
     6        Reviewed by Martin Robinson.
     7
     8        Activated WebGL feature.
     9
     10        * ewk/ewk_view.cpp:
     11        (_Ewk_View_Private_Data):
     12        (_ewk_view_priv_new):
     13
    1142012-02-05  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
    215
  • trunk/Source/WebKit/efl/ewk/ewk_view.cpp

    r106330 r106772  
    649649    priv->pageSettings->setUsesPageCache(true);
    650650    priv->pageSettings->setUsesEncodingDetector(false);
     651    priv->pageSettings->setWebGLEnabled(true);
    651652
    652653    url = priv->pageSettings->userStyleSheetLocation();
  • trunk/Source/cmake/OptionsEfl.cmake

    r106759 r106772  
    9797WEBKIT_FEATURE(ENABLE_VIDEO "Enable video" DEFAULT ON)
    9898WEBKIT_FEATURE(ENABLE_WEB_SOCKETS "Enable web sockets" DEFAULT ON)
     99WEBKIT_FEATURE(ENABLE_WEBGL "Enable WebGL" DEFAULT OFF)
    99100WEBKIT_FEATURE(ENABLE_WORKERS "Enable workers" DEFAULT ON)
    100101WEBKIT_FEATURE(ENABLE_XSLT "Enable XSLT" DEFAULT ON)
Note: See TracChangeset for help on using the changeset viewer.