Modified: trunk/Source/WebCore/ChangeLog (138525 => 138526)
--- trunk/Source/WebCore/ChangeLog 2012-12-28 08:11:20 UTC (rev 138525)
+++ trunk/Source/WebCore/ChangeLog 2012-12-28 09:06:50 UTC (rev 138526)
@@ -1,3 +1,22 @@
+2012-12-28 Kondapally Kalyan <[email protected]>
+
+ [EFL][WebGL] Add GLES2 support in GraphicsContext3DEfl.
+ https://bugs.webkit.org/show_bug.cgi?id=105805
+
+ 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:
+
2012-12-27 Dimitri Glazkov <[email protected]>
Fix styling/formatting errors, pointed out by Darin Adler while reviewing
Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h (138525 => 138526)
--- trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h 2012-12-28 08:11:20 UTC (rev 138525)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h 2012-12-28 09:06:50 UTC (rev 138526)
@@ -1048,7 +1048,7 @@
ANGLEWebKitBridge m_compiler;
#endif
-#if PLATFORM(BLACKBERRY) || (PLATFORM(QT) && defined(QT_OPENGL_ES_2)) || (PLATFORM(GTK) && USE(OPENGL_ES_2))
+#if PLATFORM(BLACKBERRY) || (PLATFORM(QT) && defined(QT_OPENGL_ES_2)) || ((PLATFORM(GTK) || PLATFORM(EFL)) && USE(OPENGL_ES_2))
friend class Extensions3DOpenGLES;
OwnPtr<Extensions3DOpenGLES> m_extensions;
#elif !PLATFORM(CHROMIUM)
Modified: trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp (138525 => 138526)
--- trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp 2012-12-28 08:11:20 UTC (rev 138525)
+++ trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp 2012-12-28 09:06:50 UTC (rev 138526)
@@ -23,19 +23,13 @@
#if USE(3D_GRAPHICS) || USE(ACCELERATED_COMPOSITING)
+#include "GLDefs.h"
#include "GraphicsContext3DPrivate.h"
#include "Image.h"
#include "ImageSource.h"
#include "NotImplemented.h"
-#include "OpenGLShims.h"
#include "PlatformContextCairo.h"
-#if USE(OPENGL_ES_2)
-#include "Extensions3DOpenGLES.h"
-#else
-#include "Extensions3DOpenGL.h"
-#endif
-
namespace WebCore {
PassRefPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, RenderStyle renderStyle)
@@ -106,7 +100,7 @@
#if USE(OPENGL_ES_2)
if (m_attrs.depth)
glGenRenderbuffers(1, &m_depthBuffer);
- if (m_context->m_attrs.stencil)
+ if (m_attrs.stencil)
glGenRenderbuffers(1, &m_stencilBuffer);
#endif
if (m_attrs.stencil || m_attrs.depth)
Modified: trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.cpp (138525 => 138526)
--- trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.cpp 2012-12-28 08:11:20 UTC (rev 138525)
+++ trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.cpp 2012-12-28 09:06:50 UTC (rev 138526)
@@ -141,31 +141,29 @@
m_platformSurface->setGeometry(IntRect(0, 0, m_context->m_currentWidth, m_context->m_currentHeight));
}
- bool enableScissorTest = false;
- int width = m_context->m_currentWidth;
- int height = m_context->m_currentHeight;
-
- // We should copy the full buffer, and not respect the current scissor bounds.
- // FIXME: It would be more efficient to track the state of the scissor test.
- if (m_context->isEnabled(GraphicsContext3D::SCISSOR_TEST)) {
- enableScissorTest = true;
- m_context->disable(GraphicsContext3D::SCISSOR_TEST);
- }
-
if (m_context->m_attrs.antialias) {
+ bool enableScissorTest = false;
+ int width = m_context->m_currentWidth;
+ int height = m_context->m_currentHeight;
+ // We should copy the full buffer, and not respect the current scissor bounds.
+ // FIXME: It would be more efficient to track the state of the scissor test.
+ if (m_context->isEnabled(GraphicsContext3D::SCISSOR_TEST)) {
+ enableScissorTest = true;
+ m_context->disable(GraphicsContext3D::SCISSOR_TEST);
+ }
- glBindFramebuffer(GL_READ_FRAMEBUFFER_EXT, m_context->m_multisampleFBO);
- glBindFramebuffer(GL_DRAW_FRAMEBUFFER_EXT, m_context->m_fbo);
+ glBindFramebuffer(Extensions3D::READ_FRAMEBUFFER, m_context->m_multisampleFBO);
+ glBindFramebuffer(Extensions3D::DRAW_FRAMEBUFFER, m_context->m_fbo);
// Use NEAREST as no scale is performed during the blit.
- glBlitFramebuffer(0, 0, width, height, 0, 0, width, height, GraphicsContext3D::COLOR_BUFFER_BIT, GraphicsContext3D::NEAREST);
+ m_context->getExtensions()->blitFramebuffer(0, 0, width, height, 0, 0, width, height, GraphicsContext3D::COLOR_BUFFER_BIT, GraphicsContext3D::NEAREST);
+
+ if (enableScissorTest)
+ m_context->enable(GraphicsContext3D::SCISSOR_TEST);
}
m_platformSurface->updateContents(m_context->m_texture, m_context->m_boundFBO, m_context->m_boundTexture0);
- if (enableScissorTest)
- m_context->enable(GraphicsContext3D::SCISSOR_TEST);
-
return 0;
}
Modified: trunk/Source/WebCore/platform/graphics/opengl/GLDefs.h (138525 => 138526)
--- trunk/Source/WebCore/platform/graphics/opengl/GLDefs.h 2012-12-28 08:11:20 UTC (rev 138525)
+++ trunk/Source/WebCore/platform/graphics/opengl/GLDefs.h 2012-12-28 09:06:50 UTC (rev 138526)
@@ -28,19 +28,22 @@
#if USE(ACCELERATED_COMPOSITING)
+#define GL_GLEXT_PROTOTYPES 1
+
#if USE(OPENGL_ES_2)
+#include "Extensions3DOpenGLES.h"
#include "OpenGLESShims.h"
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#else
+#include "Extensions3DOpenGL.h"
#include "OpenGLShims.h"
#include <GL/gl.h>
#include <GL/glext.h>
-#endif
-
#if USE(GLX)
#include <GL/glx.h>
#endif
+#endif
#if USE(EGL)
#define EGL_EGLEXT_PROTOTYPES 1