| Differences between
and this patch
- Source/WebCore/ChangeLog +18 lines
Lines 1-3 Source/WebCore/ChangeLog_sec1
1
2012-12-22  Kondapally Kalyan  <kalyan.kondapally@intel.com>
2
3
        [EFL][WebGL] Add OPENGL_ES_2 checks.
4
        https://bugs.webkit.org/show_bug.cgi?id=105805
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        This is in preparation for adding GLES2 support.
9
        This patch adds OPENGL_ES_2 checks in GraphicsContext3DPrivate and GraphicsContext3DEFl.
10
11
        * platform/graphics/GraphicsContext3D.h:
12
        (GraphicsContext3D):
13
        * platform/graphics/efl/GraphicsContext3DEfl.cpp:
14
        (WebCore::GraphicsContext3D::GraphicsContext3D):
15
        * platform/graphics/efl/GraphicsContext3DPrivate.cpp:
16
        (GraphicsContext3DPrivate::copyToGraphicsSurface):
17
        * platform/graphics/opengl/GLDefs.h:
18
1
2012-12-27  Kondapally Kalyan  <kalyan.kondapally@intel.com>
19
2012-12-27  Kondapally Kalyan  <kalyan.kondapally@intel.com>
2
20
3
        [EFL][WebGL] Implement EGL support with GLX.
21
        [EFL][WebGL] Implement EGL support with GLX.
- Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp -8 / +2 lines
Lines 23-41 Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp_sec1
23
23
24
#if USE(3D_GRAPHICS) || USE(ACCELERATED_COMPOSITING)
24
#if USE(3D_GRAPHICS) || USE(ACCELERATED_COMPOSITING)
25
25
26
#include "GLDefs.h"
26
#include "GraphicsContext3DPrivate.h"
27
#include "GraphicsContext3DPrivate.h"
27
#include "Image.h"
28
#include "Image.h"
28
#include "ImageSource.h"
29
#include "ImageSource.h"
29
#include "NotImplemented.h"
30
#include "NotImplemented.h"
30
#include "OpenGLShims.h"
31
#include "PlatformContextCairo.h"
31
#include "PlatformContextCairo.h"
32
32
33
#if USE(OPENGL_ES_2)
34
#include "Extensions3DOpenGLES.h"
35
#else
36
#include "Extensions3DOpenGL.h"
37
#endif
38
39
namespace WebCore {
33
namespace WebCore {
40
34
41
PassRefPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, RenderStyle renderStyle)
35
PassRefPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, RenderStyle renderStyle)
Lines 106-112 GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWi Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp_sec2
106
#if USE(OPENGL_ES_2)
100
#if USE(OPENGL_ES_2)
107
            if (m_attrs.depth)
101
            if (m_attrs.depth)
108
                glGenRenderbuffers(1, &m_depthBuffer);
102
                glGenRenderbuffers(1, &m_depthBuffer);
109
            if (m_context->m_attrs.stencil)
103
            if (m_attrs.stencil)
110
                glGenRenderbuffers(1, &m_stencilBuffer);
104
                glGenRenderbuffers(1, &m_stencilBuffer);
111
#endif
105
#endif
112
            if (m_attrs.stencil || m_attrs.depth)
106
            if (m_attrs.stencil || m_attrs.depth)
- Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.cpp -14 / +14 lines
Lines 141-171 uint32_t GraphicsContext3DPrivate::copyToGraphicsSurface() Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.cpp_sec1
141
        m_platformSurface->setGeometry(IntRect(0, 0, m_context->m_currentWidth, m_context->m_currentHeight));
141
        m_platformSurface->setGeometry(IntRect(0, 0, m_context->m_currentWidth, m_context->m_currentHeight));
142
    }
142
    }
143
143
144
    bool enableScissorTest = false;
144
#if !USE(OPENGL_ES_2)
145
    int width = m_context->m_currentWidth;
146
    int height = m_context->m_currentHeight;
147
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) {
145
    if (m_context->m_attrs.antialias) {
146
        bool enableScissorTest = false;
147
        int width = m_context->m_currentWidth;
148
        int height = m_context->m_currentHeight;
149
        // We should copy the full buffer, and not respect the current scissor bounds.
150
        // FIXME: It would be more efficient to track the state of the scissor test.
151
        if (m_context->isEnabled(GraphicsContext3D::SCISSOR_TEST)) {
152
            enableScissorTest = true;
153
            m_context->disable(GraphicsContext3D::SCISSOR_TEST);
154
        }
156
155
157
        glBindFramebuffer(GL_READ_FRAMEBUFFER_EXT, m_context->m_multisampleFBO);
156
        glBindFramebuffer(GL_READ_FRAMEBUFFER_EXT, m_context->m_multisampleFBO);
158
        glBindFramebuffer(GL_DRAW_FRAMEBUFFER_EXT, m_context->m_fbo);
157
        glBindFramebuffer(GL_DRAW_FRAMEBUFFER_EXT, m_context->m_fbo);
159
158
160
        // Use NEAREST as no scale is performed during the blit.
159
        // 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);
160
        glBlitFramebuffer(0, 0, width, height, 0, 0, width, height, GraphicsContext3D::COLOR_BUFFER_BIT, GraphicsContext3D::NEAREST);
161
162
        if (enableScissorTest)
163
            m_context->enable(GraphicsContext3D::SCISSOR_TEST);
162
    }
164
    }
165
#endif
163
166
164
    m_platformSurface->updateContents(m_context->m_texture, m_context->m_boundFBO, m_context->m_boundTexture0);
167
    m_platformSurface->updateContents(m_context->m_texture, m_context->m_boundFBO, m_context->m_boundTexture0);
165
168
166
    if (enableScissorTest)
167
        m_context->enable(GraphicsContext3D::SCISSOR_TEST);
168
169
    return 0;
169
    return 0;
170
}
170
}
171
171
- Source/WebCore/platform/graphics/opengl/GLDefs.h -2 / +5 lines
Lines 28-46 Source/WebCore/platform/graphics/opengl/GLDefs.h_sec1
28
28
29
#if USE(ACCELERATED_COMPOSITING)
29
#if USE(ACCELERATED_COMPOSITING)
30
30
31
#define GL_GLEXT_PROTOTYPES 1
32
31
#if USE(OPENGL_ES_2)
33
#if USE(OPENGL_ES_2)
34
#include "Extensions3DOpenGLES.h"
32
#include "OpenGLESShims.h"
35
#include "OpenGLESShims.h"
33
#include <GLES2/gl2.h>
36
#include <GLES2/gl2.h>
34
#include <GLES2/gl2ext.h>
37
#include <GLES2/gl2ext.h>
35
#else
38
#else
39
#include "Extensions3DOpenGL.h"
36
#include "OpenGLShims.h"
40
#include "OpenGLShims.h"
37
#include <GL/gl.h>
41
#include <GL/gl.h>
38
#include <GL/glext.h>
42
#include <GL/glext.h>
39
#endif
40
41
#if USE(GLX)
43
#if USE(GLX)
42
#include <GL/glx.h>
44
#include <GL/glx.h>
43
#endif
45
#endif
46
#endif
44
47
45
#if USE(EGL)
48
#if USE(EGL)
46
#define EGL_EGLEXT_PROTOTYPES 1
49
#define EGL_EGLEXT_PROTOTYPES 1

Return to Bug 105805