Changeset 138526 in webkit


Ignore:
Timestamp:
Dec 28, 2012, 1:06:50 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

[EFL][WebGL] Add GLES2 support in GraphicsContext3DEfl.
https://bugs.webkit.org/show_bug.cgi?id=105805

Patch by Kondapally Kalyan <kalyan.kondapally@intel.com> on 2012-12-28
Reviewed by Kenneth Rohde Christiansen.

This is in preparation for adding GLES2 support.
This patch adds OPENGL_ES_2 checks in GraphicsContext3DEFl.
With this patch, GraphicsContext3DPrivate uses the FramebufferBlit extension supported by Extensions3D.

  • platform/graphics/GraphicsContext3D.h:

(GraphicsContext3D):

  • platform/graphics/efl/GraphicsContext3DEfl.cpp:

(WebCore::GraphicsContext3D::GraphicsContext3D):

  • platform/graphics/efl/GraphicsContext3DPrivate.cpp:

(GraphicsContext3DPrivate::copyToGraphicsSurface):

  • platform/graphics/opengl/GLDefs.h:
Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r138519 r138526  
     12012-12-28  Kondapally Kalyan  <kalyan.kondapally@intel.com>
     2
     3        [EFL][WebGL] Add GLES2 support in GraphicsContext3DEfl.
     4        https://bugs.webkit.org/show_bug.cgi?id=105805
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        This is in preparation for adding GLES2 support.
     9        This patch adds OPENGL_ES_2 checks in GraphicsContext3DEFl.
     10        With this patch, GraphicsContext3DPrivate uses the FramebufferBlit extension supported by Extensions3D.
     11
     12        * platform/graphics/GraphicsContext3D.h:
     13        (GraphicsContext3D):
     14        * platform/graphics/efl/GraphicsContext3DEfl.cpp:
     15        (WebCore::GraphicsContext3D::GraphicsContext3D):
     16        * platform/graphics/efl/GraphicsContext3DPrivate.cpp:
     17        (GraphicsContext3DPrivate::copyToGraphicsSurface):
     18        * platform/graphics/opengl/GLDefs.h:
     19
    1202012-12-27  Dimitri Glazkov  <dglazkov@chromium.org>
    221
  • trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h

    r137397 r138526  
    10491049#endif
    10501050
    1051 #if PLATFORM(BLACKBERRY) || (PLATFORM(QT) && defined(QT_OPENGL_ES_2)) || (PLATFORM(GTK) && USE(OPENGL_ES_2))
     1051#if PLATFORM(BLACKBERRY) || (PLATFORM(QT) && defined(QT_OPENGL_ES_2)) || ((PLATFORM(GTK) || PLATFORM(EFL)) && USE(OPENGL_ES_2))
    10521052    friend class Extensions3DOpenGLES;
    10531053    OwnPtr<Extensions3DOpenGLES> m_extensions;
  • trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp

    r137467 r138526  
    2424#if USE(3D_GRAPHICS) || USE(ACCELERATED_COMPOSITING)
    2525
     26#include "GLDefs.h"
    2627#include "GraphicsContext3DPrivate.h"
    2728#include "Image.h"
    2829#include "ImageSource.h"
    2930#include "NotImplemented.h"
    30 #include "OpenGLShims.h"
    3131#include "PlatformContextCairo.h"
    32 
    33 #if USE(OPENGL_ES_2)
    34 #include "Extensions3DOpenGLES.h"
    35 #else
    36 #include "Extensions3DOpenGL.h"
    37 #endif
    3832
    3933namespace WebCore {
     
    107101            if (m_attrs.depth)
    108102                glGenRenderbuffers(1, &m_depthBuffer);
    109             if (m_context->m_attrs.stencil)
     103            if (m_attrs.stencil)
    110104                glGenRenderbuffers(1, &m_stencilBuffer);
    111105#endif
  • trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.cpp

    r138346 r138526  
    142142    }
    143143
    144     bool enableScissorTest = false;
    145     int width = m_context->m_currentWidth;
    146     int height = m_context->m_currentHeight;
     144    if (m_context->m_attrs.antialias) {
     145        bool enableScissorTest = false;
     146        int width = m_context->m_currentWidth;
     147        int height = m_context->m_currentHeight;
     148        // We should copy the full buffer, and not respect the current scissor bounds.
     149        // FIXME: It would be more efficient to track the state of the scissor test.
     150        if (m_context->isEnabled(GraphicsContext3D::SCISSOR_TEST)) {
     151            enableScissorTest = true;
     152            m_context->disable(GraphicsContext3D::SCISSOR_TEST);
     153        }
    147154
    148     // We should copy the full buffer, and not respect the current scissor bounds.
    149     // FIXME: It would be more efficient to track the state of the scissor test.
    150     if (m_context->isEnabled(GraphicsContext3D::SCISSOR_TEST)) {
    151         enableScissorTest = true;
    152         m_context->disable(GraphicsContext3D::SCISSOR_TEST);
    153     }
    154 
    155     if (m_context->m_attrs.antialias) {
    156 
    157         glBindFramebuffer(GL_READ_FRAMEBUFFER_EXT, m_context->m_multisampleFBO);
    158         glBindFramebuffer(GL_DRAW_FRAMEBUFFER_EXT, m_context->m_fbo);
     155        glBindFramebuffer(Extensions3D::READ_FRAMEBUFFER, m_context->m_multisampleFBO);
     156        glBindFramebuffer(Extensions3D::DRAW_FRAMEBUFFER, m_context->m_fbo);
    159157
    160158        // Use NEAREST as no scale is performed during the blit.
    161         glBlitFramebuffer(0, 0, width, height, 0, 0, width, height, GraphicsContext3D::COLOR_BUFFER_BIT, GraphicsContext3D::NEAREST);
     159        m_context->getExtensions()->blitFramebuffer(0, 0, width, height, 0, 0, width, height, GraphicsContext3D::COLOR_BUFFER_BIT, GraphicsContext3D::NEAREST);
     160
     161        if (enableScissorTest)
     162            m_context->enable(GraphicsContext3D::SCISSOR_TEST);
    162163    }
    163164
    164165    m_platformSurface->updateContents(m_context->m_texture, m_context->m_boundFBO, m_context->m_boundTexture0);
    165 
    166     if (enableScissorTest)
    167         m_context->enable(GraphicsContext3D::SCISSOR_TEST);
    168166
    169167    return 0;
  • trunk/Source/WebCore/platform/graphics/opengl/GLDefs.h

    r138513 r138526  
    2929#if USE(ACCELERATED_COMPOSITING)
    3030
     31#define GL_GLEXT_PROTOTYPES 1
     32
    3133#if USE(OPENGL_ES_2)
     34#include "Extensions3DOpenGLES.h"
    3235#include "OpenGLESShims.h"
    3336#include <GLES2/gl2.h>
    3437#include <GLES2/gl2ext.h>
    3538#else
     39#include "Extensions3DOpenGL.h"
    3640#include "OpenGLShims.h"
    3741#include <GL/gl.h>
    3842#include <GL/glext.h>
    39 #endif
    40 
    4143#if USE(GLX)
    4244#include <GL/glx.h>
     45#endif
    4346#endif
    4447
Note: See TracChangeset for help on using the changeset viewer.