WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-77308-20120131012354.patch (text/plain), 50.71 KB, created by
ChangSeok Oh
on 2012-01-30 08:23:57 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
ChangSeok Oh
Created:
2012-01-30 08:23:57 PST
Size:
50.71 KB
patch
obsolete
>Subversion Revision: 106240 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 8f781b71f1d79a8b8400b338d96ebac45ead59cd..6b50fc40bfa0bfc7ade762e1701d07cb65f8f844 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,46 @@ >+2012-01-30 ChangSeok Oh <shivamidow@gmail.com> >+ >+ [EFL] Enable WebGL with glx backend >+ https://bugs.webkit.org/show_bug.cgi?id=77308 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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: >+ > 2012-01-30 Carlos Garcia Campos <cgarcia@igalia.com> > > Unreviewed. Fix make distcheck. >diff --git a/Source/WebKit/efl/ChangeLog b/Source/WebKit/efl/ChangeLog >index 88d3ae9a4f4288bdee160fe0c67661ada0305217..cd690d633d4483f2c322b1bdcf51a0ac2edc0728 100644 >--- a/Source/WebKit/efl/ChangeLog >+++ b/Source/WebKit/efl/ChangeLog >@@ -1,3 +1,15 @@ >+2012-01-30 ChangSeok Oh <shivamidow@gmail.com> >+ >+ [EFL] Enable WebGL with glx backend >+ https://bugs.webkit.org/show_bug.cgi?id=77308 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Activated WebGL feature. >+ >+ * ewk/ewk_view.cpp: >+ (_ewk_view_priv_new): >+ > 2012-01-26 Tomasz Morawski <t.morawski@samsung.com> > > [EFL] Added missing NETSCAPE_PLUGIN_API macro. >diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt >index efbf9f6842970f6d51878a445de05c0e8bb4c3e9..2b8cad1c89f450caad6e52e9c6bad1978a9096e6 100644 >--- a/Source/WebCore/CMakeLists.txt >+++ b/Source/WebCore/CMakeLists.txt >@@ -2138,21 +2138,27 @@ IF (ENABLE_WEBGL) > ${DERIVED_SOURCES_WEBCORE_DIR}/glslang.cpp > ${DERIVED_SOURCES_WEBCORE_DIR}/glslang_tab.cpp > ${THIRDPARTY_DIR}/ANGLE/src/compiler/CodeGenGLSL.cpp >+ ${THIRDPARTY_DIR}/ANGLE/src/compiler/BuiltInFunctionEmulator.cpp >+ ${THIRDPARTY_DIR}/ANGLE/src/compiler/CodeGenGLSL.cpp > ${THIRDPARTY_DIR}/ANGLE/src/compiler/Compiler.cpp > ${THIRDPARTY_DIR}/ANGLE/src/compiler/debug.cpp >+ ${THIRDPARTY_DIR}/ANGLE/src/compiler/DetectRecursion.cpp >+ ${THIRDPARTY_DIR}/ANGLE/src/compiler/ForLoopUnroll.cpp > ${THIRDPARTY_DIR}/ANGLE/src/compiler/InfoSink.cpp > ${THIRDPARTY_DIR}/ANGLE/src/compiler/Initialize.cpp > ${THIRDPARTY_DIR}/ANGLE/src/compiler/InitializeDll.cpp > ${THIRDPARTY_DIR}/ANGLE/src/compiler/Intermediate.cpp > ${THIRDPARTY_DIR}/ANGLE/src/compiler/intermOut.cpp > ${THIRDPARTY_DIR}/ANGLE/src/compiler/IntermTraverse.cpp >+ ${THIRDPARTY_DIR}/ANGLE/src/compiler/MapLongVariableNames.cpp > ${THIRDPARTY_DIR}/ANGLE/src/compiler/ossource_posix.cpp >+ ${THIRDPARTY_DIR}/ANGLE/src/compiler/OutputESSL.cpp > ${THIRDPARTY_DIR}/ANGLE/src/compiler/OutputGLSL.cpp >+ ${THIRDPARTY_DIR}/ANGLE/src/compiler/OutputGLSLBase.cpp > ${THIRDPARTY_DIR}/ANGLE/src/compiler/OutputHLSL.cpp > ${THIRDPARTY_DIR}/ANGLE/src/compiler/parseConst.cpp > ${THIRDPARTY_DIR}/ANGLE/src/compiler/ParseHelper.cpp > ${THIRDPARTY_DIR}/ANGLE/src/compiler/PoolAlloc.cpp >- ${THIRDPARTY_DIR}/ANGLE/src/compiler/preprocessor > ${THIRDPARTY_DIR}/ANGLE/src/compiler/preprocessor/atom.c > ${THIRDPARTY_DIR}/ANGLE/src/compiler/preprocessor/cpp.c > ${THIRDPARTY_DIR}/ANGLE/src/compiler/preprocessor/cppstruct.c >@@ -2166,13 +2172,13 @@ IF (ENABLE_WEBGL) > ${THIRDPARTY_DIR}/ANGLE/src/compiler/ShaderLang.cpp > ${THIRDPARTY_DIR}/ANGLE/src/compiler/SymbolTable.cpp > ${THIRDPARTY_DIR}/ANGLE/src/compiler/VersionGLSL.cpp >+ ${THIRDPARTY_DIR}/ANGLE/src/compiler/TranslatorESSL.cpp > ${THIRDPARTY_DIR}/ANGLE/src/compiler/TranslatorGLSL.cpp > ${THIRDPARTY_DIR}/ANGLE/src/compiler/TranslatorHLSL.cpp > ${THIRDPARTY_DIR}/ANGLE/src/compiler/UnfoldSelect.cpp > ${THIRDPARTY_DIR}/ANGLE/src/compiler/util.cpp > ${THIRDPARTY_DIR}/ANGLE/src/compiler/ValidateLimitations.cpp > ${THIRDPARTY_DIR}/ANGLE/src/compiler/VariableInfo.cpp >- > html/canvas/WebGLBuffer.cpp > html/canvas/WebGLCompressedTextures.cpp > html/canvas/WebGLContextAttributes.cpp >@@ -2197,11 +2203,9 @@ IF (ENABLE_WEBGL) > html/canvas/OESStandardDerivatives.cpp > html/canvas/OESTextureFloat.cpp > html/canvas/OESVertexArrayObject.cpp >- > platform/graphics/ANGLEWebKitBridge.cpp >- platform/graphics/GraphicsContext3D.cpp >- > platform/graphics/gpu/DrawingBuffer.cpp >+ platform/graphics/GraphicsContext3D.cpp > ) > LIST(APPEND WebCore_IDL_FILES > html/canvas/OESStandardDerivatives.idl >diff --git a/Source/WebCore/PlatformEfl.cmake b/Source/WebCore/PlatformEfl.cmake >index 1b2e1e4065052da365337444dd2703a584b815da..4c877ae0e15386fe3541aaf2f9feb8f4596f8aa3 100644 >--- a/Source/WebCore/PlatformEfl.cmake >+++ b/Source/WebCore/PlatformEfl.cmake >@@ -281,7 +281,6 @@ IF (ENABLE_VIDEO) > ) > ENDIF () > >- > IF (ENABLE_GLIB_SUPPORT) > LIST(APPEND WebCore_LIBRARIES > ${Glib_LIBRARIES} >@@ -294,10 +293,23 @@ ENDIF () > IF (ENABLE_WEBGL) > LIST(APPEND WebCore_INCLUDE_DIRECTORIES > ${OPENGL_INCLUDE_DIR} >+ "${WEBCORE_DIR}/platform/graphics/cairo" >+ "${WEBCORE_DIR}/platform/graphics/glx" >+ "${WEBCORE_DIR}/platform/graphics/opengl" > ) > LIST(APPEND WebCore_LIBRARIES > ${OPENGL_gl_LIBRARY} > ) >+ LIST(APPEND WebCore_SOURCES >+ platform/graphics/cairo/GraphicsContext3DCairo.cpp >+ platform/graphics/cairo/OpenGLShims.cpp >+ platform/graphics/efl/DrawingBufferEfl.cpp >+ platform/graphics/efl/GraphicsContext3DEfl.cpp >+ platform/graphics/glx/GraphicsContext3DPrivate.cpp >+ platform/graphics/opengl/Extensions3DOpenGL.cpp >+ platform/graphics/opengl/GraphicsContext3DOpenGL.cpp >+ platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp >+ ) > ENDIF () > > IF (WTF_USE_SOUP) >diff --git a/Source/WebCore/html/HTMLCanvasElement.cpp b/Source/WebCore/html/HTMLCanvasElement.cpp >index 681fb93ca84bf57a2dc6e9213afc12846706ac29..83901b42434de0ddb42f76b37d9a86cc91b840e9 100644 >--- a/Source/WebCore/html/HTMLCanvasElement.cpp >+++ b/Source/WebCore/html/HTMLCanvasElement.cpp >@@ -177,7 +177,7 @@ CanvasRenderingContext* HTMLCanvasElement::getContext(const String& type, Canvas > #if ENABLE(WEBGL) > Settings* settings = document()->settings(); > if (settings && settings->webGLEnabled() >-#if !PLATFORM(CHROMIUM) && !PLATFORM(GTK) >+#if !PLATFORM(CHROMIUM) && !PLATFORM(GTK) && !PLATFORM(EFL) > && settings->acceleratedCompositingEnabled() > #endif > ) { >diff --git a/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h b/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h >index 0f4bf7d0066ac8428d85378d0a109894a903ed0a..c638bc0fc3cd613ab0b3cbe0b022681ed373da41 100644 >--- a/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h >+++ b/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h >@@ -31,7 +31,7 @@ > > #if PLATFORM(QT) > #include "ANGLE/include/GLSLANG/ShaderLang.h" >-#elif !PLATFORM(GTK) >+#elif !PLATFORM(GTK) && !PLATFORM(EFL) > #include "ANGLE/ShaderLang.h" > #else > #include "ShaderLang.h" >diff --git a/Source/WebCore/platform/graphics/GraphicsContext3D.h b/Source/WebCore/platform/graphics/GraphicsContext3D.h >index dfebbba9b02d8726c300f3197ddc199b249e9935..077df2a854cc6bf7f3defbb15af3933499c3872b 100644 >--- a/Source/WebCore/platform/graphics/GraphicsContext3D.h >+++ b/Source/WebCore/platform/graphics/GraphicsContext3D.h >@@ -43,7 +43,7 @@ > #undef VERSION > #endif > >-#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(QT) >+#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) > #include "ANGLEWebKitBridge.h" > #endif > >@@ -57,7 +57,7 @@ QT_BEGIN_NAMESPACE > class QPainter; > class QRect; > QT_END_NAMESPACE >-#elif PLATFORM(GTK) >+#elif PLATFORM(GTK) || PLATFORM(EFL) > typedef unsigned int GLuint; > #endif > >@@ -83,7 +83,7 @@ namespace WebCore { > class CanvasRenderingContext; > class DrawingBuffer; > class Extensions3D; >-#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(QT) >+#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) > class Extensions3DOpenGL; > #endif > #if PLATFORM(QT) >@@ -486,6 +486,7 @@ public: > #endif > #elif PLATFORM(EFL) > PlatformGraphicsContext3D platformGraphicsContext3D() const; >+ Platform3DObject platformTexture() const { return m_texture; } > #if USE(ACCELERATED_COMPOSITING) > PlatformLayer* platformLayer() const; > #endif >@@ -498,7 +499,7 @@ public: > #endif > bool makeContextCurrent(); > >-#if PLATFORM(MAC) || PLATFORM(CHROMIUM) || PLATFORM(GTK) || PLATFORM(QT) >+#if PLATFORM(MAC) || PLATFORM(CHROMIUM) || PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) > // With multisampling on, blit from multisampleFBO to regular FBO. > void prepareTexture(); > #endif >@@ -777,7 +778,7 @@ public: > #if USE(CG) > static void paintToCanvas(const unsigned char* imagePixels, int imageWidth, int imageHeight, > int canvasWidth, int canvasHeight, CGContextRef); >-#elif PLATFORM(GTK) >+#elif PLATFORM(GTK) || PLATFORM(EFL) > void paintToCanvas(const unsigned char* imagePixels, int imageWidth, int imageHeight, > int canvasWidth, int canvasHeight, PlatformContextCairo* context); > #endif >@@ -796,6 +797,8 @@ public: > bool paintsIntoCanvasBuffer() const; > #elif PLATFORM(GTK) > bool paintsIntoCanvasBuffer() const { return true; } >+#elif PLATFORM(EFL) >+ bool paintsIntoCanvasBuffer() const { return true; } > #else > bool paintsIntoCanvasBuffer() const { return false; } > #endif >@@ -886,7 +889,7 @@ public: > AlphaOp alphaOp, > void* destinationData); > >-#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(QT) >+#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) > // Take into account the user's requested context creation attributes, > // in particular stencil and antialias, and determine which could or > // could not be honored based on the capabilities of the OpenGL >@@ -906,7 +909,7 @@ public: > RetainPtr<WebGLLayer> m_webGLLayer; > #endif > >-#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(QT) >+#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) > typedef struct { > String source; > String log; >diff --git a/Source/WebCore/platform/graphics/efl/DrawingBufferEfl.cpp b/Source/WebCore/platform/graphics/efl/DrawingBufferEfl.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..1e502ae7c9b1738eaed6cfb6328b88e0cde70817 >--- /dev/null >+++ b/Source/WebCore/platform/graphics/efl/DrawingBufferEfl.cpp >@@ -0,0 +1,97 @@ >+/* >+ * Copyright (C) 2010 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+ >+#if ENABLE(ACCELERATED_2D_CANVAS) || ENABLE(WEBGL) >+ >+#include "DrawingBuffer.h" >+ >+#include "Extensions3D.h" >+ >+namespace WebCore { >+ >+DrawingBuffer::DrawingBuffer(GraphicsContext3D* context, >+ const IntSize& size, >+ bool multisampleExtensionSupported, >+ bool packedDepthStencilExtensionSupported, >+ bool separateBackingTexture) >+ : m_separateBackingTexture(separateBackingTexture) >+ , m_scissorEnabled(false) >+ , m_texture2DBinding(0) >+ , m_activeTextureUnit(GraphicsContext3D::TEXTURE0) >+ , m_context(context) >+ , m_size(-1, -1) >+ , m_multisampleExtensionSupported(multisampleExtensionSupported) >+ , m_packedDepthStencilExtensionSupported(packedDepthStencilExtensionSupported) >+ , m_fbo(context->createFramebuffer()) >+ , m_colorBuffer(0) >+ , m_depthStencilBuffer(0) >+ , m_depthBuffer(0) >+ , m_stencilBuffer(0) >+ , m_multisampleFBO(0) >+ , m_multisampleColorBuffer(0) >+{ >+ // Support for a separate backing texture has only been enabled for >+ // the chromium port. >+ ASSERT(!m_separateBackingTexture); >+ ASSERT(m_fbo); >+ if (!m_fbo) { >+ clear(); >+ return; >+ } >+ >+ // create a texture to render into >+ m_colorBuffer = context->createTexture(); >+ context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_colorBuffer); >+ context->texParameterf(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MAG_FILTER, GraphicsContext3D::LINEAR); >+ context->texParameterf(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MIN_FILTER, GraphicsContext3D::LINEAR); >+ context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_S, GraphicsContext3D::CLAMP_TO_EDGE); >+ context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_T, GraphicsContext3D::CLAMP_TO_EDGE); >+ context->bindTexture(GraphicsContext3D::TEXTURE_2D, 0); >+ >+ createSecondaryBuffers(); >+ reset(size); >+} >+ >+DrawingBuffer::~DrawingBuffer() >+{ >+ clear(); >+} >+ >+Platform3DObject DrawingBuffer::platformColorBuffer() const >+{ >+ return m_colorBuffer; >+} >+ >+#if USE(ACCELERATED_COMPOSITING) >+void DrawingBuffer::paintCompositedResultsToCanvas(CanvasRenderingContext* context) >+{ >+} >+#endif >+ >+} >+ >+#endif >diff --git a/Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp b/Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp >index d45235e14ca5f25a68aed843b07278fe141f8fa7..c7b46d636d6052ea1b9182c706d23bc9c5a8b306 100644 >--- a/Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp >+++ b/Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp >@@ -1,845 +1,148 @@ > /* >- Copyright (C) 2011 Samsung Electronics >- >- This library is free software; you can redistribute it and/or >- modify it under the terms of the GNU Library General Public >- License as published by the Free Software Foundation; either >- version 2 of the License, or (at your option) any later version. >- >- This library is distributed in the hope that it will be useful, >- but WITHOUT ANY WARRANTY; without even the implied warranty of >- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >- Library General Public License for more details. >- >- You should have received a copy of the GNU Library General Public License >- along with this library; see the file COPYING.LIB. If not, write to >- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >- Boston, MA 02110-1301, USA. >-*/ >+ * Copyright (C) 2011, 2012 Samsung Electronics >+ * >+ * This library is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU Library General Public >+ * License as published by the Free Software Foundation; either >+ * version 2 of the License, or (at your option) any later version. >+ * >+ * This library is distributed in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >+ * Library General Public License for more details. >+ * >+ * You should have received a copy of the GNU Library General Public License >+ * along with this library; see the file COPYING.LIB. If not, write to >+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >+ * Boston, MA 02110-1301, USA. >+ */ > > #include "config.h" >+#include "GraphicsContext3D.h" > > #if ENABLE(WEBGL) >- >-#include "GraphicsContext3DInternal.h" >- >-#include "ImageData.h" >+#include "Extensions3DOpenGL.h" >+#include "GraphicsContext3DPrivate.h" >+#include "OpenGLShims.h" >+#include "ShaderLang.h" > #include "NotImplemented.h" > > namespace WebCore { > >-PassRefPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, RenderStyle renderStyle) >+PassRefPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attributes attributes, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle) > { >- bool renderDirectlyToEvasGLObject = (renderStyle == RenderDirectlyToHostWindow); >+ bool renderDirectlyToHostWindow = (renderStyle == RenderDirectlyToHostWindow); >+ // This implementation doesn't currently support rendering directly to the HostWindow. >+ if (renderDirectlyToHostWindow) >+ return 0; > >- OwnPtr<GraphicsContext3DInternal> internal = GraphicsContext3DInternal::create(attrs, hostWindow, renderDirectlyToEvasGLObject); >- if (!internal) >+ OwnPtr<GraphicsContext3DPrivate> priv = GraphicsContext3DPrivate::create(); >+ if (!priv) > return 0; > >- RefPtr<GraphicsContext3D> context = adoptRef(new GraphicsContext3D(attrs, hostWindow, renderDirectlyToEvasGLObject)); >- context->m_internal = internal.release(); >+ RefPtr<GraphicsContext3D> context = adoptRef(new GraphicsContext3D(attributes, hostWindow, renderDirectlyToHostWindow)); >+ context->m_private = priv.release(); > return context.release(); > } > >-GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, bool renderDirectlyToHostWindow) >+GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attributes, HostWindow* hostWindow, bool renderDirectlyToHostWindow) > : m_currentWidth(0) > , m_currentHeight(0) >- , m_isResourceSafe(false) >-{ >+ , m_attrs(attributes) >+ , m_texture(0) >+ , m_fbo(0) >+ , m_depthStencilBuffer(0) >+ , m_boundFBO(0) >+ , m_multisampleFBO(0) >+ , m_multisampleDepthStencilBuffer(0) >+ , m_multisampleColorBuffer(0) >+{ >+ GraphicsContext3DPrivate::addActiveGraphicsContext(this); >+ >+ validateAttributes(); >+ >+ // Create a texture to render into. >+ ::glGenTextures(1, &m_texture); >+ ::glBindTexture(GL_TEXTURE_2D, m_texture); >+ ::glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); >+ ::glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); >+ ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); >+ ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); >+ ::glBindTexture(GL_TEXTURE_2D, 0); >+ >+ // Create an FBO. >+ ::glGenFramebuffersEXT(1, &m_fbo); >+ ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo); >+ >+ m_boundFBO = m_fbo; >+ if (!m_attrs.antialias && (m_attrs.stencil || m_attrs.depth)) >+ ::glGenRenderbuffersEXT(1, &m_depthStencilBuffer); >+ >+ // Create a multisample FBO. >+ if (m_attrs.antialias) { >+ ::glGenFramebuffersEXT(1, &m_multisampleFBO); >+ ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_multisampleFBO); >+ m_boundFBO = m_multisampleFBO; >+ ::glGenRenderbuffersEXT(1, &m_multisampleColorBuffer); >+ if (m_attrs.stencil || m_attrs.depth) >+ ::glGenRenderbuffersEXT(1, &m_multisampleDepthStencilBuffer); >+ } >+ >+ // ANGLE initialization. >+ ShBuiltInResources ANGLEResources; >+ ShInitBuiltInResources(&ANGLEResources); >+ >+ getIntegerv(GraphicsContext3D::MAX_VERTEX_ATTRIBS, &ANGLEResources.MaxVertexAttribs); >+ getIntegerv(GraphicsContext3D::MAX_VERTEX_UNIFORM_VECTORS, &ANGLEResources.MaxVertexUniformVectors); >+ getIntegerv(GraphicsContext3D::MAX_VARYING_VECTORS, &ANGLEResources.MaxVaryingVectors); >+ getIntegerv(GraphicsContext3D::MAX_VERTEX_TEXTURE_IMAGE_UNITS, &ANGLEResources.MaxVertexTextureImageUnits); >+ getIntegerv(GraphicsContext3D::MAX_COMBINED_TEXTURE_IMAGE_UNITS, &ANGLEResources.MaxCombinedTextureImageUnits); >+ getIntegerv(GraphicsContext3D::MAX_TEXTURE_IMAGE_UNITS, &ANGLEResources.MaxTextureImageUnits); >+ getIntegerv(GraphicsContext3D::MAX_FRAGMENT_UNIFORM_VECTORS, &ANGLEResources.MaxFragmentUniformVectors); >+ >+ // Always set to 1 for OpenGL ES. >+ ANGLEResources.MaxDrawBuffers = 1; >+ m_compiler.setResources(ANGLEResources); >+ >+ ::glEnable(GL_VERTEX_PROGRAM_POINT_SIZE); >+ ::glEnable(GL_POINT_SPRITE); >+ ::glClearColor(0, 0, 0, 0); > } > > GraphicsContext3D::~GraphicsContext3D() > { >-} >+ GraphicsContext3DPrivate::removeActiveGraphicsContext(this); >+ if (!m_private->m_context) >+ return; > >-PlatformGraphicsContext3D GraphicsContext3D::platformGraphicsContext3D() const >-{ >- return m_internal->platformGraphicsContext3D(); >+ makeContextCurrent(); >+ ::glDeleteTextures(1, &m_texture); >+ if (m_attrs.antialias) { >+ ::glDeleteRenderbuffersEXT(1, &m_multisampleColorBuffer); >+ if (m_attrs.stencil || m_attrs.depth) >+ ::glDeleteRenderbuffersEXT(1, &m_multisampleDepthStencilBuffer); >+ ::glDeleteFramebuffersEXT(1, &m_multisampleFBO); >+ } else { >+ if (m_attrs.stencil || m_attrs.depth) >+ ::glDeleteRenderbuffersEXT(1, &m_depthStencilBuffer); >+ } >+ ::glDeleteFramebuffersEXT(1, &m_fbo); > } > >-#if USE(ACCELERATED_COMPOSITING) >-PlatformLayer* GraphicsContext3D::platformLayer() const >-{ >- notImplemented(); >- return 0; >-} >-#endif >- > bool GraphicsContext3D::makeContextCurrent() > { >- m_internal->makeContextCurrent(); >- return true; >-} >- >-bool GraphicsContext3D::isGLES2Compliant() const >-{ >- return m_internal->isGLES2Compliant(); >-} >- >-void GraphicsContext3D::activeTexture(GC3Denum texture) >-{ >- m_internal->activeTexture(texture); >-} >- >-void GraphicsContext3D::attachShader(Platform3DObject program, Platform3DObject shader) >-{ >- m_internal->attachShader(program, shader); >-} >- >-void GraphicsContext3D::bindAttribLocation(Platform3DObject program, GC3Duint index, const String& name) >-{ >- m_internal->bindAttribLocation(program, index, name); >-} >- >-void GraphicsContext3D::bindBuffer(GC3Denum target, Platform3DObject buffer) >-{ >- m_internal->bindBuffer(target, buffer); >-} >- >-void GraphicsContext3D::bindFramebuffer(GC3Denum target, Platform3DObject buffer) >-{ >- m_internal->bindFramebuffer(target, buffer); >-} >- >-void GraphicsContext3D::bindRenderbuffer(GC3Denum target, Platform3DObject renderbuffer) >-{ >- m_internal->bindRenderbuffer(target, renderbuffer); >-} >- >-void GraphicsContext3D::bindTexture(GC3Denum target, Platform3DObject texture) >-{ >- m_internal->bindTexture(target, texture); >-} >- >-void GraphicsContext3D::blendColor(GC3Dclampf red, GC3Dclampf green, GC3Dclampf blue, GC3Dclampf alpha) >-{ >- m_internal->blendColor(red, green, blue, alpha); >-} >- >-void GraphicsContext3D::blendEquation(GC3Denum mode) >-{ >- m_internal->blendEquation(mode); >-} >- >-void GraphicsContext3D::blendEquationSeparate(GC3Denum modeRGB, GC3Denum modeAlpha) >-{ >- m_internal->blendEquationSeparate(modeRGB, modeAlpha); >-} >- >-void GraphicsContext3D::blendFunc(GC3Denum srcFactor, GC3Denum dstFactor) >-{ >- m_internal->blendFunc(srcFactor, dstFactor); >-} >- >-void GraphicsContext3D::blendFuncSeparate(GC3Denum srcRGB, GC3Denum dstRGB, GC3Denum srcAlpha, GC3Denum dstAlpha) >-{ >- m_internal->blendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha); >-} >- >-void GraphicsContext3D::bufferData(GC3Denum target, GC3Dsizeiptr size, GC3Denum usage) >-{ >- m_internal->bufferData(target, size, 0, usage); >-} >- >-void GraphicsContext3D::bufferData(GC3Denum target, GC3Dsizeiptr size, const void* data, GC3Denum usage) >-{ >- m_internal->bufferData(target, size, data, usage); >-} >- >-void GraphicsContext3D::bufferSubData(GC3Denum target, GC3Dintptr offset, GC3Dsizeiptr size, const void* data) >-{ >- m_internal->bufferSubData(target, offset, size, data); >-} >- >-GC3Denum GraphicsContext3D::checkFramebufferStatus(GC3Denum target) >-{ >- return m_internal->checkFramebufferStatus(target); >-} >- >-void GraphicsContext3D::clear(GC3Dbitfield mask) >-{ >- m_internal->clear(mask); >-} >- >-void GraphicsContext3D::clearColor(GC3Dclampf red, GC3Dclampf green, GC3Dclampf blue, GC3Dclampf alpha) >-{ >- m_internal->clearColor(red, green, blue, alpha); >-} >- >-void GraphicsContext3D::clearDepth(GC3Dclampf depth) >-{ >- m_internal->clearDepth(depth); >-} >- >-void GraphicsContext3D::clearStencil(GC3Dint clearValue) >-{ >- m_internal->clearStencil(clearValue); >-} >- >-void GraphicsContext3D::colorMask(GC3Dboolean red, GC3Dboolean green, GC3Dboolean blue, GC3Dboolean alpha) >-{ >- m_internal->colorMask(red, green, blue, alpha); >-} >- >-void GraphicsContext3D::compileShader(Platform3DObject shader) >-{ >- m_internal->compileShader(shader); >-} >- >-void GraphicsContext3D::copyTexImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height, GC3Dint border) >-{ >- m_internal->copyTexImage2D(target, level, internalformat, x, y, width, height, border); >-} >- >-void GraphicsContext3D::copyTexSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xOffset, GC3Dint yOffset, GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height) >-{ >- m_internal->copyTexSubImage2D(target, level, xOffset, yOffset, x, y, width, height); >-} >- >-void GraphicsContext3D::compressedTexImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Dsizei imageSize, const void* data) >-{ >- // FIXME: Add support for compressedTexImage2D. >- // m_internal->compressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data); >-} >- >-void GraphicsContext3D::compressedTexSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Dsizei imageSize, const void* data) >-{ >- // FIXME: Add support for compressedTexSubImage2D. >- // m_internal->compressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data); >-} >- >-void GraphicsContext3D::cullFace(GC3Denum mode) >-{ >- m_internal->cullFace(mode); >-} >- >-void GraphicsContext3D::depthFunc(GC3Denum func) >-{ >- m_internal->depthFunc(func); >-} >- >-void GraphicsContext3D::depthMask(GC3Dboolean flag) >-{ >- m_internal->depthMask(flag); >-} >- >-void GraphicsContext3D::depthRange(GC3Dclampf zNear, GC3Dclampf zFar) >-{ >- m_internal->depthRange(zNear, zFar); >-} >- >-void GraphicsContext3D::detachShader(Platform3DObject program, Platform3DObject shader) >-{ >- m_internal->detachShader(program, shader); >-} >- >-void GraphicsContext3D::disable(GC3Denum cap) >-{ >- m_internal->disable(cap); >-} >- >-void GraphicsContext3D::disableVertexAttribArray(GC3Duint index) >-{ >- m_internal->disableVertexAttribArray(index); >-} >- >-void GraphicsContext3D::drawArrays(GC3Denum mode, GC3Dint first, GC3Dsizei count) >-{ >- m_internal->drawArrays(mode, first, count); >-} >- >-void GraphicsContext3D::drawElements(GC3Denum mode, GC3Dsizei count, GC3Denum type, GC3Dintptr offset) >-{ >- m_internal->drawElements(mode, count, type, offset); >-} >- >-void GraphicsContext3D::enable(GC3Denum cap) >-{ >- m_internal->enable(cap); >-} >- >-void GraphicsContext3D::enableVertexAttribArray(GC3Duint index) >-{ >- m_internal->enableVertexAttribArray(index); >-} >- >-void GraphicsContext3D::finish() >-{ >- m_internal->finish(); >-} >- >-void GraphicsContext3D::flush() >-{ >- m_internal->flush(); >-} >- >-void GraphicsContext3D::framebufferRenderbuffer(GC3Denum target, GC3Denum attachment, GC3Denum renderbufferTarget, Platform3DObject buffer) >-{ >- m_internal->framebufferRenderbuffer(target, attachment, renderbufferTarget, buffer); >-} >- >-void GraphicsContext3D::framebufferTexture2D(GC3Denum target, GC3Denum attachment, GC3Denum texTarget, Platform3DObject texture, GC3Dint level) >-{ >- m_internal->framebufferTexture2D(target, attachment, texTarget, texture, level); >-} >- >-void GraphicsContext3D::frontFace(GC3Denum mode) >-{ >- m_internal->frontFace(mode); >-} >- >-void GraphicsContext3D::generateMipmap(GC3Denum target) >-{ >- m_internal->generateMipmap(target); >-} >- >-bool GraphicsContext3D::getActiveAttrib(Platform3DObject program, GC3Duint index, ActiveInfo& info) >-{ >- return m_internal->getActiveAttrib(program, index, info); >-} >- >-bool GraphicsContext3D::getActiveUniform(Platform3DObject program, GC3Duint index, ActiveInfo& info) >-{ >- return m_internal->getActiveUniform(program, index, info); >-} >- >-void GraphicsContext3D::getAttachedShaders(Platform3DObject program, GC3Dsizei maxCount, GC3Dsizei* count, Platform3DObject* shaders) >-{ >- m_internal->getAttachedShaders(program, maxCount, count, shaders); >-} >- >-int GraphicsContext3D::getAttribLocation(Platform3DObject program, const String& name) >-{ >- return m_internal->getAttribLocation(program, name); >-} >- >-void GraphicsContext3D::getBooleanv(GC3Denum paramName, GC3Dboolean* value) >-{ >- m_internal->getBooleanv(paramName, value); >-} >- >-void GraphicsContext3D::getBufferParameteriv(GC3Denum target, GC3Denum paramName, GC3Dint* value) >-{ >- m_internal->getBufferParameteriv(target, paramName, value); >-} >- >-GraphicsContext3D::Attributes GraphicsContext3D::getContextAttributes() >-{ >- return m_internal->getContextAttributes(); >-} >- >-GC3Denum GraphicsContext3D::getError() >-{ >- return m_internal->getError(); >-} >- >-void GraphicsContext3D::getFloatv(GC3Denum paramName, GC3Dfloat* value) >-{ >- m_internal->getFloatv(paramName, value); >-} >- >-void GraphicsContext3D::getFramebufferAttachmentParameteriv(GC3Denum target, GC3Denum attachment, GC3Denum paramName, GC3Dint* value) >-{ >- m_internal->getFramebufferAttachmentParameteriv(target, attachment, paramName, value); >+ if (!m_private) >+ return false; >+ return m_private->makeContextCurrent(); > } > >-void GraphicsContext3D::getIntegerv(GC3Denum paramName, GC3Dint* value) >-{ >- m_internal->getIntegerv(paramName, value); >-} >- >-void GraphicsContext3D::getProgramiv(Platform3DObject program, GC3Denum paramName, GC3Dint* value) >-{ >- m_internal->getProgramiv(program, paramName, value); >-} >- >-String GraphicsContext3D::getProgramInfoLog(Platform3DObject program) >-{ >- return m_internal->getProgramInfoLog(program); >-} >- >-void GraphicsContext3D::getRenderbufferParameteriv(GC3Denum target, GC3Denum paramName, GC3Dint* value) >-{ >- m_internal->getRenderbufferParameteriv(target, paramName, value); >-} >- >-void GraphicsContext3D::getShaderiv(Platform3DObject shader, GC3Denum paramName, GC3Dint* value) >-{ >- m_internal->getShaderiv(shader, paramName, value); >-} >- >-String GraphicsContext3D::getShaderInfoLog(Platform3DObject shader) >-{ >- return m_internal->getShaderInfoLog(shader); >-} >- >-String GraphicsContext3D::getShaderSource(Platform3DObject shader) >-{ >- return m_internal->getShaderSource(shader); >-} >- >-String GraphicsContext3D::getString(GC3Denum name) >-{ >- return m_internal->getString(name); >-} >- >-void GraphicsContext3D::getTexParameterfv(GC3Denum target, GC3Denum paramName, GC3Dfloat* value) >-{ >- m_internal->getTexParameterfv(target, paramName, value); >-} >- >-void GraphicsContext3D::getTexParameteriv(GC3Denum target, GC3Denum paramName, GC3Dint* value) >-{ >- m_internal->getTexParameteriv(target, paramName, value); >-} >- >-void GraphicsContext3D::getUniformfv(Platform3DObject program, GC3Dint location, GC3Dfloat* value) >-{ >- m_internal->getUniformfv(program, location, value); >-} >- >-void GraphicsContext3D::getUniformiv(Platform3DObject program, GC3Dint location, GC3Dint* value) >-{ >- m_internal->getUniformiv(program, location, value); >-} >- >-GC3Dint GraphicsContext3D::getUniformLocation(Platform3DObject program, const String& name) >-{ >- return m_internal->getUniformLocation(program, name); >-} >- >-void GraphicsContext3D::getVertexAttribfv(GC3Duint index, GC3Denum paramName, GC3Dfloat* value) >-{ >- m_internal->getVertexAttribfv(index, paramName, value); >-} >- >-void GraphicsContext3D::getVertexAttribiv(GC3Duint index, GC3Denum paramName, GC3Dint* value) >-{ >- m_internal->getVertexAttribiv(index, paramName, value); >-} >- >-long GraphicsContext3D::getVertexAttribOffset(GC3Duint index, GC3Denum paramName) >-{ >- return m_internal->getVertexAttribOffset(index, paramName); >-} >- >-void GraphicsContext3D::hint(GC3Denum target, GC3Denum mode) >-{ >- m_internal->hint(target, mode); >-} >- >-GC3Dboolean GraphicsContext3D::isBuffer(Platform3DObject obj) >-{ >- return m_internal->isBuffer(obj); >-} >- >-GC3Dboolean GraphicsContext3D::isEnabled(GC3Denum cap) >-{ >- return m_internal->isEnabled(cap); >-} >- >-GC3Dboolean GraphicsContext3D::isFramebuffer(Platform3DObject obj) >-{ >- return m_internal->isFramebuffer(obj); >-} >- >-GC3Dboolean GraphicsContext3D::isProgram(Platform3DObject obj) >-{ >- return m_internal->isProgram(obj); >-} >- >-GC3Dboolean GraphicsContext3D::isRenderbuffer(Platform3DObject obj) >-{ >- return m_internal->isRenderbuffer(obj); >-} >- >-GC3Dboolean GraphicsContext3D::isShader(Platform3DObject obj) >-{ >- return m_internal->isShader(obj); >-} >- >-GC3Dboolean GraphicsContext3D::isTexture(Platform3DObject obj) >-{ >- return m_internal->isTexture(obj); >-} >- >-void GraphicsContext3D::lineWidth(GC3Dfloat width) >-{ >- m_internal->lineWidth(width); >-} >- >-void GraphicsContext3D::linkProgram(Platform3DObject program) >-{ >- m_internal->linkProgram(program); >-} >- >-void GraphicsContext3D::pixelStorei(GC3Denum paramName, GC3Dint param) >-{ >- m_internal->pixelStorei(paramName, param); >-} >- >-void GraphicsContext3D::polygonOffset(GC3Dfloat factor, GC3Dfloat units) >-{ >- m_internal->polygonOffset(factor, units); >-} >- >-void GraphicsContext3D::readPixels(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, void* data) >-{ >- m_internal->readPixels(x, y, width, height, format, type, data); >-} >- >-void GraphicsContext3D::releaseShaderCompiler() >-{ >- notImplemented(); >-} >- >-void GraphicsContext3D::renderbufferStorage(GC3Denum target, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height) >-{ >- m_internal->renderbufferStorage(target, internalformat, width, height); >-} >- >-void GraphicsContext3D::sampleCoverage(GC3Dclampf value, GC3Dboolean invert) >-{ >- m_internal->sampleCoverage(value, invert); >-} >- >-void GraphicsContext3D::scissor(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height) >-{ >- m_internal->scissor(x, y, width, height); >-} >- >-void GraphicsContext3D::shaderSource(Platform3DObject program, const String& string) >-{ >- m_internal->shaderSource(program, string); >-} >- >-void GraphicsContext3D::stencilFunc(GC3Denum func, GC3Dint ref, GC3Duint mask) >-{ >- m_internal->stencilFunc(func, ref, mask); >-} >- >-void GraphicsContext3D::stencilFuncSeparate(GC3Denum face, GC3Denum func, GC3Dint ref, GC3Duint mask) >-{ >- m_internal->stencilFuncSeparate(face, func, ref, mask); >-} >- >-void GraphicsContext3D::stencilMask(GC3Duint mask) >-{ >- m_internal->stencilMask(mask); >-} >- >-void GraphicsContext3D::stencilMaskSeparate(GC3Denum face, GC3Duint mask) >-{ >- m_internal->stencilMaskSeparate(face, mask); >-} >- >-void GraphicsContext3D::stencilOp(GC3Denum fail, GC3Denum zfail, GC3Denum zpass) >-{ >- m_internal->stencilOp(fail, zfail, zpass); >-} >- >-void GraphicsContext3D::stencilOpSeparate(GC3Denum face, GC3Denum fail, GC3Denum zfail, GC3Denum zpass) >-{ >- m_internal->stencilOpSeparate(face, fail, zfail, zpass); >-} >- >-bool GraphicsContext3D::texImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type, const void* pixels) >-{ >- return m_internal->texImage2D(target, level, internalformat, width, height, border, format, type, pixels); >-} >- >-void GraphicsContext3D::texParameterf(GC3Denum target, GC3Denum paramName, GC3Dfloat param) >-{ >- m_internal->texParameterf(target, paramName, param); >-} >- >-void GraphicsContext3D::texParameteri(GC3Denum target, GC3Denum paramName, GC3Dint param) >-{ >- m_internal->texParameteri(target, paramName, param); >-} >- >-void GraphicsContext3D::texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xOffset, GC3Dint yOffset, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, const void* pixels) >-{ >- m_internal->texSubImage2D(target, level, xOffset, yOffset, width, height, format, type, pixels); >-} >- >-void GraphicsContext3D::uniform1f(GC3Dint location, GC3Dfloat x) >-{ >- m_internal->uniform1f(location, x); >-} >- >-void GraphicsContext3D::uniform1fv(GC3Dint location, GC3Dfloat* v, GC3Dsizei size) >-{ >- m_internal->uniform1fv(location, size, v); >-} >- >-void GraphicsContext3D::uniform1i(GC3Dint location, GC3Dint x) >-{ >- m_internal->uniform1i(location, x); >-} >- >-void GraphicsContext3D::uniform1iv(GC3Dint location, GC3Dint* v, GC3Dsizei size) >-{ >- m_internal->uniform1iv(location, size, v); >-} >- >-void GraphicsContext3D::uniform2f(GC3Dint location, GC3Dfloat x, float y) >-{ >- m_internal->uniform2f(location, x, y); >-} >- >-void GraphicsContext3D::uniform2fv(GC3Dint location, GC3Dfloat* v, GC3Dsizei size) >-{ >- m_internal->uniform2fv(location, size, v); >-} >- >-void GraphicsContext3D::uniform2i(GC3Dint location, GC3Dint x, GC3Dint y) >-{ >- m_internal->uniform2i(location, x, y); >-} >- >-void GraphicsContext3D::uniform2iv(GC3Dint location, GC3Dint* v, GC3Dsizei size) >-{ >- m_internal->uniform2iv(location, size, v); >-} >- >-void GraphicsContext3D::uniform3f(GC3Dint location, GC3Dfloat x, GC3Dfloat y, GC3Dfloat z) >-{ >- m_internal->uniform3f(location, x, y, z); >-} >- >-void GraphicsContext3D::uniform3fv(GC3Dint location, GC3Dfloat* v, GC3Dsizei size) >-{ >- m_internal->uniform3fv(location, size, v); >-} >- >-void GraphicsContext3D::uniform3i(GC3Dint location, GC3Dint x, GC3Dint y, GC3Dint z) >-{ >- m_internal->uniform3i(location, x, y, z); >-} >- >-void GraphicsContext3D::uniform3iv(GC3Dint location, GC3Dint* v, GC3Dsizei size) >-{ >- m_internal->uniform3iv(location, size, v); >-} >- >-void GraphicsContext3D::uniform4f(GC3Dint location, GC3Dfloat x, GC3Dfloat y, GC3Dfloat z, GC3Dfloat w) >-{ >- m_internal->uniform4f(location, x, y, z, w); >-} >- >-void GraphicsContext3D::uniform4fv(GC3Dint location, GC3Dfloat* v, GC3Dsizei size) >-{ >- m_internal->uniform4fv(location, size, v); >-} >- >-void GraphicsContext3D::uniform4i(GC3Dint location, GC3Dint x, GC3Dint y, GC3Dint z, GC3Dint w) >-{ >- m_internal->uniform4i(location, x, y, z, w); >-} >- >-void GraphicsContext3D::uniform4iv(GC3Dint location, GC3Dint* v, GC3Dsizei size) >-{ >- m_internal->uniform4iv(location, size, v); >-} >- >-void GraphicsContext3D::uniformMatrix2fv(GC3Dint location, GC3Dboolean transpose, GC3Dfloat* value, GC3Dsizei size) >-{ >- m_internal->uniformMatrix2fv(location, size, transpose, value); >-} >- >-void GraphicsContext3D::uniformMatrix3fv(GC3Dint location, GC3Dboolean transpose, GC3Dfloat* value, GC3Dsizei size) >-{ >- m_internal->uniformMatrix3fv(location, size, transpose, value); >-} >- >-void GraphicsContext3D::uniformMatrix4fv(GC3Dint location, GC3Dboolean transpose, GC3Dfloat* value, GC3Dsizei size) >-{ >- m_internal->uniformMatrix4fv(location, size, transpose, value); >-} >- >-void GraphicsContext3D::useProgram(Platform3DObject program) >-{ >- m_internal->useProgram(program); >-} >- >-void GraphicsContext3D::validateProgram(Platform3DObject program) >-{ >- m_internal->validateProgram(program); >-} >- >-void GraphicsContext3D::vertexAttrib1f(GC3Duint index, GC3Dfloat x) >-{ >- m_internal->vertexAttrib1f(index, x); >-} >- >-void GraphicsContext3D::vertexAttrib1fv(GC3Duint index, GC3Dfloat* values) >-{ >- m_internal->vertexAttrib1fv(index, values); >-} >- >-void GraphicsContext3D::vertexAttrib2f(GC3Duint index, GC3Dfloat x, GC3Dfloat y) >-{ >- m_internal->vertexAttrib2f(index, x, y); >-} >- >-void GraphicsContext3D::vertexAttrib2fv(GC3Duint index, GC3Dfloat* values) >-{ >- m_internal->vertexAttrib2fv(index, values); >-} >- >-void GraphicsContext3D::vertexAttrib3f(GC3Duint index, GC3Dfloat x, GC3Dfloat y, GC3Dfloat z) >-{ >- m_internal->vertexAttrib3f(index, x, y, z); >-} >- >-void GraphicsContext3D::vertexAttrib3fv(GC3Duint index, GC3Dfloat* values) >-{ >- m_internal->vertexAttrib3fv(index, values); >-} >- >-void GraphicsContext3D::vertexAttrib4f(GC3Duint index, GC3Dfloat x, GC3Dfloat y, GC3Dfloat z, GC3Dfloat w) >-{ >- m_internal->vertexAttrib4f(index, x, y, z, w); >-} >- >-void GraphicsContext3D::vertexAttrib4fv(GC3Duint index, GC3Dfloat* values) >-{ >- m_internal->vertexAttrib4fv(index, values); >-} >- >-void GraphicsContext3D::vertexAttribPointer(GC3Duint index, GC3Dint size, GC3Denum type, GC3Dboolean normalized, GC3Dsizei stride, GC3Dintptr offset) >-{ >- m_internal->vertexAttribPointer(index, size, type, normalized, stride, offset); >-} >- >-void GraphicsContext3D::viewport(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height) >-{ >- m_internal->viewport(x, y, width, height); >-} >- >-void GraphicsContext3D::reshape(int width, int height) >-{ >- notImplemented(); >-} >- >-void GraphicsContext3D::markContextChanged() >-{ >- notImplemented(); >-} >- >-void GraphicsContext3D::markLayerComposited() >-{ >- notImplemented(); >-} >- >-bool GraphicsContext3D::layerComposited() const >-{ >- notImplemented(); >- return false; >-} >- >-void GraphicsContext3D::paintRenderingResultsToCanvas(CanvasRenderingContext* context, DrawingBuffer* drawingBuffer) >-{ >- // DrawingBuffer support only implemented in Chromium ports. >- ASSERT(!drawingBuffer); >- notImplemented(); >-} >- >-PassRefPtr<ImageData> GraphicsContext3D::paintRenderingResultsToImageData(DrawingBuffer* drawingBuffer) >-{ >- // DrawingBuffer support only implemented in Chromium ports. >- ASSERT(!drawingBuffer); >- notImplemented(); >- RefPtr<ImageData> imageData = ImageData::create(IntSize(1, 1)); >- return imageData.release(); >-} >- >-Platform3DObject GraphicsContext3D::createBuffer() >-{ >- return m_internal->createBuffer(); >-} >- >-Platform3DObject GraphicsContext3D::createFramebuffer() >-{ >- return m_internal->createFramebuffer(); >-} >- >-Platform3DObject GraphicsContext3D::createProgram() >-{ >- return m_internal->createProgram(); >-} >- >-Platform3DObject GraphicsContext3D::createRenderbuffer() >-{ >- return m_internal->createRenderbuffer(); >-} >- >-Platform3DObject GraphicsContext3D::createShader(GC3Denum type) >-{ >- return m_internal->createShader(type); >-} >- >-Platform3DObject GraphicsContext3D::createTexture() >-{ >- return m_internal->createTexture(); >-} >- >-void GraphicsContext3D::deleteBuffer(Platform3DObject buffer) >-{ >- m_internal->deleteBuffer(buffer); >-} >- >-void GraphicsContext3D::deleteFramebuffer(Platform3DObject buffer) >-{ >- m_internal->deleteFramebuffer(buffer); >-} >- >-void GraphicsContext3D::deleteProgram(Platform3DObject program) >-{ >- m_internal->deleteProgram(program); >-} >- >-void GraphicsContext3D::deleteRenderbuffer(Platform3DObject buffer) >-{ >- m_internal->deleteRenderbuffer(buffer); >-} >- >-void GraphicsContext3D::deleteShader(Platform3DObject shader) >-{ >- m_internal->deleteShader(shader); >-} >- >-void GraphicsContext3D::deleteTexture(Platform3DObject texture) >-{ >- m_internal->deleteTexture(texture); >-} >- >-void GraphicsContext3D::synthesizeGLError(GC3Denum error) >-{ >- m_internal->synthesizeGLError(error); >-} >- >-Extensions3D* GraphicsContext3D::getExtensions() >-{ >- return m_internal->getExtensions(); >-} >- >-IntSize GraphicsContext3D::getInternalFramebufferSize() >-{ >- notImplemented(); >- return IntSize(); >-} >- >-void GraphicsContext3D::setContextLostCallback(PassOwnPtr<ContextLostCallback>) >+PlatformGraphicsContext3D GraphicsContext3D::platformGraphicsContext3D() const > { >- notImplemented(); >+ return m_private->m_context; > } > >-bool GraphicsContext3D::getImageData(Image* image, GC3Denum format, GC3Denum type, bool premultiplyAlpha, >- bool ignoreGammaAndColorProfile, Vector<uint8_t>& outputVector) >+bool GraphicsContext3D::isGLES2Compliant() const > { >- notImplemented(); > return false; > } > >diff --git a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp >index 73320d18705d29164bd95ba7d172fa86bb88f047..67d42ba8684522a13325ed5f4fd693fd7b6588c5 100644 >--- a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp >+++ b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp >@@ -35,7 +35,7 @@ > #if PLATFORM(MAC) > #include "ANGLE/ShaderLang.h" > #include <OpenGL/gl.h> >-#elif PLATFORM(GTK) >+#elif PLATFORM(GTK) || PLATFORM(EFL) > #include "OpenGLShims.h" > #elif PLATFORM(QT) > #include <cairo/OpenGLShims.h> >@@ -149,7 +149,7 @@ void Extensions3DOpenGL::renderbufferStorageMultisample(unsigned long target, un > Platform3DObject Extensions3DOpenGL::createVertexArrayOES() > { > m_context->makeContextCurrent(); >-#if !PLATFORM(GTK) && !PLATFORM(QT) && defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object >+#if !PLATFORM(GTK) && !PLATFORM(QT) && !PLATFORM(EFL) && defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object > GLuint array = 0; > glGenVertexArraysAPPLE(1, &array); > return array; >@@ -164,7 +164,7 @@ void Extensions3DOpenGL::deleteVertexArrayOES(Platform3DObject array) > return; > > m_context->makeContextCurrent(); >-#if !PLATFORM(GTK) && !PLATFORM(QT) && defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object >+#if !PLATFORM(GTK) && !PLATFORM(QT) && !PLATFORM(EFL) && defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object > glDeleteVertexArraysAPPLE(1, &array); > #endif > } >@@ -175,7 +175,7 @@ GC3Dboolean Extensions3DOpenGL::isVertexArrayOES(Platform3DObject array) > return GL_FALSE; > > m_context->makeContextCurrent(); >-#if !PLATFORM(GTK) && !PLATFORM(QT) && defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object >+#if !PLATFORM(GTK) && !PLATFORM(QT) && !PLATFORM(EFL) && defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object > return glIsVertexArrayAPPLE(array); > #else > return GL_FALSE; >@@ -188,7 +188,7 @@ void Extensions3DOpenGL::bindVertexArrayOES(Platform3DObject array) > return; > > m_context->makeContextCurrent(); >-#if !PLATFORM(GTK) && !PLATFORM(QT) && defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object >+#if !PLATFORM(GTK) && !PLATFORM(QT) && !PLATFORM(EFL) && defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object > glBindVertexArrayAPPLE(array); > #endif > } >diff --git a/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp b/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp >index 47a41c6d00265b0cba9a44ffcc41106ae9ba0775..e23c9513ae0c54d746ca59c196993e054eb5c163 100644 >--- a/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp >+++ b/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp >@@ -34,7 +34,7 @@ > > #if PLATFORM(MAC) > #include <OpenGL/gl.h> >-#elif PLATFORM(GTK) >+#elif PLATFORM(GTK) || PLATFORM(EFL) > #include "OpenGLShims.h" > #elif PLATFORM(QT) > #include <QtGlobal> >diff --git a/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp b/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp >index e68bba7fd7f519fd78c169a7293c9b2ad5260de8..0ec4df9e94ed7a85bbc3eaede94d02d832f1d591 100644 >--- a/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp >+++ b/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp >@@ -48,7 +48,7 @@ > > #if PLATFORM(MAC) > #include <OpenGL/gl.h> >-#elif PLATFORM(GTK) >+#elif PLATFORM(GTK) || PLATFORM(EFL) > #include "OpenGLShims.h" > #elif PLATFORM(QT) > #include <QtGlobal> >diff --git a/Source/WebKit/efl/ewk/ewk_view.cpp b/Source/WebKit/efl/ewk/ewk_view.cpp >index a68bbabbe8d93d7dc8e70d791c650764ba113dc9..b2e37f36ac65aed9018e9add63426e4cbfb6409f 100644 >--- a/Source/WebKit/efl/ewk/ewk_view.cpp >+++ b/Source/WebKit/efl/ewk/ewk_view.cpp >@@ -648,6 +648,7 @@ static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* smartData) > priv->pageSettings->setOfflineWebApplicationCacheEnabled(true); > priv->pageSettings->setUsesPageCache(true); > priv->pageSettings->setUsesEncodingDetector(false); >+ priv->pageSettings->setWebGLEnabled(true); > > url = priv->pageSettings->userStyleSheetLocation(); > priv->settings.userStylesheet = eina_stringshare_add(url.string().utf8().data()); >diff --git a/Source/cmake/OptionsEfl.cmake b/Source/cmake/OptionsEfl.cmake >index 2f2abf4a3439c18f237efde0a2245029442efce9..49a4e74d093521ae4dc09c43d1ef2e64179ff7ab 100644 >--- a/Source/cmake/OptionsEfl.cmake >+++ b/Source/cmake/OptionsEfl.cmake >@@ -95,6 +95,7 @@ WEBKIT_FEATURE(ENABLE_TOUCH_EVENTS "Enable Touch Events" DEFAULT OFF) > WEBKIT_FEATURE(ENABLE_TOUCH_ICON_LOADING "Enable Touch Icon Loading" DEFAULT OFF) > WEBKIT_FEATURE(ENABLE_VIDEO "Enable video" DEFAULT ON) > WEBKIT_FEATURE(ENABLE_WEB_SOCKETS "Enable web sockets" DEFAULT ON) >+WEBKIT_FEATURE(ENABLE_WEBGL "Enable WebGL" DEFAULT OFF) > WEBKIT_FEATURE(ENABLE_WORKERS "Enable workers" DEFAULT ON) > WEBKIT_FEATURE(ENABLE_XSLT "Enable XSLT" DEFAULT ON) > >diff --git a/ChangeLog b/ChangeLog >index 0e27ce3df3304c5a6a0aa04c6f5467fb419d1dea..62d9f2ac159bc3808214bba8dfeafec5728e0a14 100644 >--- a/ChangeLog >+++ b/ChangeLog >@@ -1,3 +1,14 @@ >+2012-01-30 ChangSeok Oh <shivamidow@gmail.com> >+ >+ [EFL] Enable WebGL with glx backend >+ https://bugs.webkit.org/show_bug.cgi?id=77308 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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. >+ > 2012-01-30 Allan Sandfeld Jensen <allan.jensen@nokia.com> > > Manual test of number of resize events emitted during page generation.
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 77308
:
124554
|
124747
|
125482
|
125488