Changeset 82878 in webkit
- Timestamp:
- Apr 4, 2011 3:07:05 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 7 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r82846 r82878 1 2011-04-04 Martin Robinson <mrobinson@igalia.com> 2 3 Reviewed by Gustavo Noronha Silva. 4 5 [GTK] WebGL support 6 https://bugs.webkit.org/show_bug.cgi?id=31517 7 8 * configure.ac: Update configure.ac to ensure that GL/GLX headers exist. 9 1 10 2011-04-04 Jon Lee <jonlee@apple.com> 2 11 -
trunk/Source/WebCore/ChangeLog
r82870 r82878 1 2011-04-04 Martin Robinson <mrobinson@igalia.com> 2 3 Reviewed by Gustavo Noronha Silva. 4 5 [GTK] WebGL support 6 https://bugs.webkit.org/show_bug.cgi?id=31517 7 8 Add WebGL support for the GTK+ bits of WebCore. 9 10 No new tests. This will be covered by the existing WebGL tests once 11 the bots are capable of running WebGL tests. 12 13 * GNUmakefile.am: Added new files required for WebGL support. 14 * html/HTMLCanvasElement.cpp: 15 (WebCore::HTMLCanvasElement::getContext): Extend #ifdef to cover GTK+ as well, which does not 16 yet support accelerated compositing. 17 * platform/graphics/ANGLEWebKitBridge.h: Update to reflect the fact that ANGLE isn't compiled as 18 a framework for GTK+. 19 * platform/graphics/GraphicsContext3D.h: 20 (WebCore::GraphicsContext3D::platformTexture): Added a declaration of this method for Cairo. 21 (WebCore::GraphicsContext3D::paintsIntoCanvasBuffer): Ditto. 22 * platform/graphics/cairo/GraphicsContext3DCairo.cpp: Added. 23 (WebCore::GraphicsContext3D::getImageData): Added. 24 (WebCore::GraphicsContext3D::paintToCanvas): Added. 25 * platform/graphics/cairo/OpenGLShims.cpp: Added. This file controls loading of GL extension 26 functions dynamically. They have different names across the different vendors' GL implementations. 27 (WebCore::lookupOpenGLFunctionAddress): Added 28 (WebCore::openGLFunctionTable): Added 29 (WebCore::initializeOpenGLShims): Added 30 * platform/graphics/cairo/OpenGLShims.h: Added. 31 * platform/graphics/gtk/DrawingBufferGtk.cpp: Added. 32 (WebCore::DrawingBuffer::DrawingBuffer): Very generic implementation for Cairo. 33 (WebCore::DrawingBuffer::~DrawingBuffer): Ditto. 34 (WebCore::DrawingBuffer::didReset): Ditto. 35 (WebCore::DrawingBuffer::platformColorBuffer): Ditto. 36 * platform/graphics/gtk/GraphicsContext3DGtk.cpp: Added. 37 (WebCore::GraphicsContext3D::create): Initial implementation. 38 (WebCore::GraphicsContext3D::GraphicsContext3D): Ditto. 39 (WebCore::GraphicsContext3D::~GraphicsContext3D): Ditto. 40 (WebCore::GraphicsContext3D::makeContextCurrent): Ditto. 41 (WebCore::GraphicsContext3D::platformGraphicsContext3D): Ditto. 42 (WebCore::GraphicsContext3D::isGLES2Compliant): Ditto. 43 * platform/graphics/gtk/GraphicsContext3DInternal.cpp: Added. 44 (sharedDisplay): Added this shared display which is required by some 45 display drivers. 46 (WebCore::activeGraphicsContexts): This method keeps track of all active GraphicsContext3D 47 contexts, in order to clean them up at exit. This prevents crashes on certain OpenGL drivers. 48 (WebCore::GraphicsContext3DInternal::addActiveGraphicsContext): Ditto. 49 (WebCore::GraphicsContext3DInternal::removeActiveGraphicsContext): Ditto. 50 (WebCore::GraphicsContext3DInternal::cleanupActiveContextsAtExit): Ditto. 51 (WebCore::GraphicsContext3DInternal::create): Figure out the best way to create an OpenGL 52 context given the current environment. 53 (WebCore::GraphicsContext3DInternal::createPbufferContext): Pbuffer context initializer. 54 (WebCore::GraphicsContext3DInternal::createPixmapContext): Pixmap context initializer. 55 (WebCore::GraphicsContext3DInternal::GraphicsContext3DInternal): Initial implementation. 56 (WebCore::GraphicsContext3DInternal::~GraphicsContext3DInternal): Ditto. 57 (WebCore::GraphicsContext3DInternal::makeContextCurrent): Ditto. 58 * platform/graphics/gtk/GraphicsContext3DInternal.h: Added. 59 * platform/graphics/opengl/Extensions3DOpenGL.cpp: Added generic implementation. 60 (WebCore::Extensions3DOpenGL::ensureEnabled): Ditto. 61 * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp: 62 (WebCore::GraphicsContext3D::reshape): Test for the context using the public API rather than 63 the private bits that are specific to the Apple port. 64 1 65 2011-04-04 Alexey Proskuryakov <ap@apple.com> 2 66 -
trunk/Source/WebCore/GNUmakefile.am
r82837 r82878 6 6 7 7 webcore_cppflags += \ 8 -I$(srcdir)/Source/ThirdParty/ANGLE/src \ 9 -I$(srcdir)/Source/ThirdParty/ANGLE/include \ 10 -I$(srcdir)/Source/ThirdParty/ANGLE/include/GLSLANG \ 8 11 -I$(srcdir)/Source/WebCore \ 9 12 -I$(srcdir)/Source/WebCore/accessibility \ … … 41 44 -I$(srcdir)/Source/WebCore/platform/graphics \ 42 45 -I$(srcdir)/Source/WebCore/platform/graphics/filters \ 46 -I$(srcdir)/Source/WebCore/platform/graphics/gpu \ 47 -I$(srcdir)/Source/WebCore/platform/graphics/opengl \ 43 48 -I$(srcdir)/Source/WebCore/platform/graphics/opentype \ 44 49 -I$(srcdir)/Source/WebCore/platform/graphics/transforms \ … … 4895 4900 FEATURE_DEFINES += ENABLE_WEBGL=1 4896 4901 webcore_cppflags += -DENABLE_WEBGL=1 4902 webcore_built_sources += \ 4903 DerivedSources/ANGLE/glslang.cpp \ 4904 DerivedSources/ANGLE/glslang_tab.cpp \ 4905 DerivedSources/ANGLE/glslang_tab.h 4897 4906 webcore_sources += \ 4907 Source/ThirdParty/ANGLE/include/GLSLANG/ShaderLang.h \ 4908 Source/ThirdParty/ANGLE/src/compiler/BaseTypes.h \ 4909 Source/ThirdParty/ANGLE/src/compiler/CodeGenGLSL.cpp \ 4910 Source/ThirdParty/ANGLE/src/compiler/Common.h \ 4911 Source/ThirdParty/ANGLE/src/compiler/Compiler.cpp \ 4912 Source/ThirdParty/ANGLE/src/compiler/ConstantUnion.h \ 4913 Source/ThirdParty/ANGLE/src/compiler/debug.cpp \ 4914 Source/ThirdParty/ANGLE/src/compiler/debug.h \ 4915 Source/ThirdParty/ANGLE/src/compiler/InfoSink.cpp \ 4916 Source/ThirdParty/ANGLE/src/compiler/InfoSink.h \ 4917 Source/ThirdParty/ANGLE/src/compiler/Initialize.cpp \ 4918 Source/ThirdParty/ANGLE/src/compiler/InitializeDll.cpp \ 4919 Source/ThirdParty/ANGLE/src/compiler/InitializeDll.h \ 4920 Source/ThirdParty/ANGLE/src/compiler/InitializeGlobals.h \ 4921 Source/ThirdParty/ANGLE/src/compiler/Initialize.h \ 4922 Source/ThirdParty/ANGLE/src/compiler/InitializeParseContext.h \ 4923 Source/ThirdParty/ANGLE/src/compiler/Intermediate.cpp \ 4924 Source/ThirdParty/ANGLE/src/compiler/intermediate.h \ 4925 Source/ThirdParty/ANGLE/src/compiler/intermOut.cpp \ 4926 Source/ThirdParty/ANGLE/src/compiler/IntermTraverse.cpp \ 4927 Source/ThirdParty/ANGLE/src/compiler/localintermediate.h \ 4928 Source/ThirdParty/ANGLE/src/compiler/MMap.h \ 4929 Source/ThirdParty/ANGLE/src/compiler/osinclude.h \ 4930 Source/ThirdParty/ANGLE/src/compiler/ossource_posix.cpp \ 4931 Source/ThirdParty/ANGLE/src/compiler/OutputGLSL.cpp \ 4932 Source/ThirdParty/ANGLE/src/compiler/OutputGLSL.h \ 4933 Source/ThirdParty/ANGLE/src/compiler/OutputHLSL.cpp \ 4934 Source/ThirdParty/ANGLE/src/compiler/OutputHLSL.h \ 4935 Source/ThirdParty/ANGLE/src/compiler/parseConst.cpp \ 4936 Source/ThirdParty/ANGLE/src/compiler/ParseHelper.cpp \ 4937 Source/ThirdParty/ANGLE/src/compiler/ParseHelper.h \ 4938 Source/ThirdParty/ANGLE/src/compiler/PoolAlloc.cpp \ 4939 Source/ThirdParty/ANGLE/src/compiler/PoolAlloc.h \ 4940 Source/ThirdParty/ANGLE/src/compiler/preprocessor \ 4941 Source/ThirdParty/ANGLE/src/compiler/preprocessor/atom.c \ 4942 Source/ThirdParty/ANGLE/src/compiler/preprocessor/atom.h \ 4943 Source/ThirdParty/ANGLE/src/compiler/preprocessor/compile.h \ 4944 Source/ThirdParty/ANGLE/src/compiler/preprocessor/cpp.c \ 4945 Source/ThirdParty/ANGLE/src/compiler/preprocessor/cpp.h \ 4946 Source/ThirdParty/ANGLE/src/compiler/preprocessor/cppstruct.c \ 4947 Source/ThirdParty/ANGLE/src/compiler/preprocessor/memory.c \ 4948 Source/ThirdParty/ANGLE/src/compiler/preprocessor/memory.h \ 4949 Source/ThirdParty/ANGLE/src/compiler/preprocessor/parser.h \ 4950 Source/ThirdParty/ANGLE/src/compiler/preprocessor/preprocess.h \ 4951 Source/ThirdParty/ANGLE/src/compiler/preprocessor/scanner.c \ 4952 Source/ThirdParty/ANGLE/src/compiler/preprocessor/scanner.h \ 4953 Source/ThirdParty/ANGLE/src/compiler/preprocessor/slglobals.h \ 4954 Source/ThirdParty/ANGLE/src/compiler/preprocessor/symbols.c \ 4955 Source/ThirdParty/ANGLE/src/compiler/preprocessor/symbols.h \ 4956 Source/ThirdParty/ANGLE/src/compiler/preprocessor/tokens.c \ 4957 Source/ThirdParty/ANGLE/src/compiler/preprocessor/tokens.h \ 4958 Source/ThirdParty/ANGLE/src/compiler/QualifierAlive.cpp \ 4959 Source/ThirdParty/ANGLE/src/compiler/QualifierAlive.h \ 4960 Source/ThirdParty/ANGLE/src/compiler/RemoveTree.cpp \ 4961 Source/ThirdParty/ANGLE/src/compiler/RemoveTree.h \ 4962 Source/ThirdParty/ANGLE/src/compiler/SearchSymbol.cpp \ 4963 Source/ThirdParty/ANGLE/src/compiler/SearchSymbol.h \ 4964 Source/ThirdParty/ANGLE/src/compiler/ShaderLang.cpp \ 4965 Source/ThirdParty/ANGLE/src/compiler/ShHandle.h \ 4966 Source/ThirdParty/ANGLE/src/compiler/SymbolTable.cpp \ 4967 Source/ThirdParty/ANGLE/src/compiler/SymbolTable.h \ 4968 Source/ThirdParty/ANGLE/src/compiler/VersionGLSL.cpp \ 4969 Source/ThirdParty/ANGLE/src/compiler/VersionGLSL.h \ 4970 Source/ThirdParty/ANGLE/src/compiler/TranslatorGLSL.cpp \ 4971 Source/ThirdParty/ANGLE/src/compiler/TranslatorGLSL.h \ 4972 Source/ThirdParty/ANGLE/src/compiler/TranslatorHLSL.cpp \ 4973 Source/ThirdParty/ANGLE/src/compiler/TranslatorHLSL.h \ 4974 Source/ThirdParty/ANGLE/src/compiler/Types.h \ 4975 Source/ThirdParty/ANGLE/src/compiler/UnfoldSelect.cpp \ 4976 Source/ThirdParty/ANGLE/src/compiler/UnfoldSelect.h \ 4977 Source/ThirdParty/ANGLE/src/compiler/util.cpp \ 4978 Source/ThirdParty/ANGLE/src/compiler/util.h \ 4979 Source/ThirdParty/ANGLE/src/compiler/ValidateLimitations.cpp \ 4980 Source/ThirdParty/ANGLE/src/compiler/ValidateLimitations.h \ 4981 Source/ThirdParty/ANGLE/src/compiler/VariableInfo.cpp \ 4982 Source/ThirdParty/ANGLE/src/compiler/VariableInfo.h \ 4898 4983 Source/WebCore/html/canvas/WebGLActiveInfo.h \ 4899 4984 Source/WebCore/html/canvas/WebGLBuffer.cpp \ … … 4923 5008 Source/WebCore/html/canvas/WebGLVertexArrayObjectOES.cpp \ 4924 5009 Source/WebCore/html/canvas/WebGLVertexArrayObjectOES.h \ 5010 Source/WebCore/html/canvas/WebGLExtension.cpp \ 5011 Source/WebCore/html/canvas/WebGLExtension.h \ 4925 5012 Source/WebCore/html/canvas/OESStandardDerivatives.cpp \ 4926 5013 Source/WebCore/html/canvas/OESStandardDerivatives.h \ … … 4930 5017 Source/WebCore/html/canvas/OESVertexArrayObject.h \ 4931 5018 Source/WebCore/html/canvas/WebKitLoseContext.cpp \ 4932 Source/WebCore/html/canvas/WebKitLoseContext.h 5019 Source/WebCore/html/canvas/WebKitLoseContext.h \ 5020 Source/WebCore/platform/graphics/ANGLEWebKitBridge.cpp \ 5021 Source/WebCore/platform/graphics/ANGLEWebKitBridge.h \ 5022 Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp \ 5023 Source/WebCore/platform/graphics/cairo/OpenGLShims.cpp \ 5024 Source/WebCore/platform/graphics/cairo/OpenGLShims.h \ 5025 Source/WebCore/platform/graphics/gpu/DrawingBuffer.cpp \ 5026 Source/WebCore/platform/graphics/gpu/DrawingBuffer.h \ 5027 Source/WebCore/platform/graphics/GraphicsContext3D.cpp \ 5028 Source/WebCore/platform/graphics/GraphicsContext3D.h \ 5029 Source/WebCore/platform/graphics/gtk/DrawingBufferGtk.cpp \ 5030 Source/WebCore/platform/graphics/gtk/GraphicsContext3DGtk.cpp \ 5031 Source/WebCore/platform/graphics/gtk/GraphicsContext3DInternal.cpp \ 5032 Source/WebCore/platform/graphics/gtk/GraphicsContext3DInternal.h \ 5033 Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp \ 5034 Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h \ 5035 Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp 4933 5036 endif # END ENABLE_WEBGL 5037 4934 5038 4935 5039 DerivedSources/WebCore/CSSPropertyNames.cpp: DerivedSources/WebCore/CSSPropertyNames.h … … 5043 5147 DerivedSources/WebCore/InjectedScriptSource.h: $(WebCore)/inspector/InjectedScriptSource.js 5044 5148 perl $(WebCore)/inspector/xxd.pl InjectedScriptSource_js $(WebCore)/inspector/InjectedScriptSource.js $(GENSOURCES_WEBCORE)/InjectedScriptSource.h 5149 5150 # ANGLE tokenizer & parser 5151 DerivedSources/ANGLE/glslang.cpp: Source/ThirdParty/ANGLE/src/compiler/glslang.l 5152 $(AM_V_GEN)$(FLEX) --noline --nounistd --outfile="$@" "$<" 5153 5154 DerivedSources/ANGLE/glslang_tab.cpp: Source/ThirdParty/ANGLE/src/compiler/glslang.y 5155 $(AM_V_GEN)$(BISON) --no-lines --defines="DerivedSources/ANGLE/glslang_tab.h" --skeleton=yacc.c --output="$@" $< 5156 DerivedSources/ANGLE/glslang_tab.h: DerivedSources/ANGLE/glslang_tab.cpp 5045 5157 5046 5158 IDL_PATH := \ -
trunk/Source/WebCore/html/HTMLCanvasElement.cpp
r81740 r82878 176 176 Settings* settings = document()->settings(); 177 177 if (settings && settings->webGLEnabled() 178 #if !PLATFORM(CHROMIUM) 178 #if !PLATFORM(CHROMIUM) && !PLATFORM(GTK) 179 179 && settings->acceleratedCompositingEnabled() 180 180 #endif -
trunk/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h
r76324 r82878 27 27 #define ANGLEWebKitBridge_h 28 28 29 #include "PlatformString.h" 30 #include <wtf/text/CString.h> 31 32 #if !PLATFORM(GTK) 29 33 #include "ANGLE/ShaderLang.h" 30 # include "PlatformString.h"31 32 # include <wtf/text/CString.h>34 #else 35 #include "ShaderLang.h" 36 #endif 33 37 34 38 namespace WebCore { -
trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h
r81740 r82878 44 44 #endif 45 45 46 #if PLATFORM(MAC) || PLATFORM(GTK) 47 #include "ANGLEWebKitBridge.h" 48 #endif 49 46 50 #if PLATFORM(MAC) 47 #include "ANGLEWebKitBridge.h"48 51 #include <OpenGL/OpenGL.h> 49 52 #include <wtf/RetainPtr.h> … … 61 64 QT_END_NAMESPACE 62 65 #elif PLATFORM(GTK) 66 typedef struct _cairo cairo_t; 63 67 typedef unsigned int GLuint; 64 68 #endif … … 82 86 class DrawingBuffer; 83 87 class Extensions3D; 84 #if PLATFORM(MAC) 88 #if PLATFORM(MAC) || PLATFORM(GTK) 85 89 class Extensions3DOpenGL; 86 90 #endif … … 96 100 97 101 // FIXME: ideally this would be used on all platforms. 98 #if PLATFORM(CHROMIUM) || PLATFORM(QT) 102 #if PLATFORM(CHROMIUM) || PLATFORM(QT) || PLATFORM(GTK) 99 103 class GraphicsContext3DInternal; 100 104 #endif … … 466 470 PlatformLayer* platformLayer() const; 467 471 #endif 472 #elif PLATFORM(GTK) 473 PlatformGraphicsContext3D platformGraphicsContext3D(); 474 Platform3DObject platformTexture() const { return m_texture; } 468 475 #else 469 476 PlatformGraphicsContext3D platformGraphicsContext3D() const { return NullPlatformGraphicsContext3D; } … … 477 484 PassRefPtr<DrawingBuffer> createDrawingBuffer(const IntSize& = IntSize()); 478 485 479 #if PLATFORM(MAC) || PLATFORM(CHROMIUM) 486 #if PLATFORM(MAC) || PLATFORM(CHROMIUM) || PLATFORM(GTK) 480 487 // With multisampling on, blit from multisampleFBO to regular FBO. 481 488 void prepareTexture(); … … 757 764 void paintToCanvas(const unsigned char* imagePixels, int imageWidth, int imageHeight, 758 765 int canvasWidth, int canvasHeight, CGContextRef context); 766 #elif PLATFORM(GTK) 767 void paintToCanvas(const unsigned char* imagePixels, int imageWidth, int imageHeight, 768 int canvasWidth, int canvasHeight, cairo_t* context); 759 769 #endif 760 770 … … 770 780 #elif PLATFORM(CHROMIUM) 771 781 bool paintsIntoCanvasBuffer() const; 782 #elif PLATFORM(GTK) 783 bool paintsIntoCanvasBuffer() const { return true; } 772 784 #else 773 785 bool paintsIntoCanvasBuffer() const { return false; } … … 860 872 void* destinationData); 861 873 862 #if PLATFORM(MAC) 874 #if PLATFORM(MAC) || PLATFORM(GTK) 863 875 // Take into account the user's requested context creation attributes, 864 876 // in particular stencil and antialias, and determine which could or … … 875 887 876 888 #if PLATFORM(MAC) 889 CGLContextObj m_contextObj; 890 RetainPtr<WebGLLayer> m_webGLLayer; 891 #endif 892 893 #if PLATFORM(MAC) || PLATFORM(GTK) 877 894 typedef struct { 878 895 String source; … … 890 907 Vector<Vector<float> > m_vertexArray; 891 908 892 CGLContextObj m_contextObj;893 RetainPtr<WebGLLayer> m_webGLLayer;894 909 GC3Duint m_texture, m_compositorTexture; 895 910 GC3Duint m_fbo; … … 913 928 914 929 // FIXME: ideally this would be used on all platforms. 915 #if PLATFORM(CHROMIUM) || PLATFORM(QT) 930 #if PLATFORM(CHROMIUM) || PLATFORM(QT) || PLATFORM(GTK) 916 931 friend class GraphicsContext3DInternal; 917 932 OwnPtr<GraphicsContext3DInternal> m_internal; -
trunk/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm
r81740 r82878 91 91 : m_currentWidth(0) 92 92 , m_currentHeight(0) 93 , m_contextObj(0) 93 94 , m_attrs(attrs) 94 , m_contextObj(0)95 95 , m_texture(0) 96 96 , m_compositorTexture(0) -
trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp
r80124 r82878 36 36 #include "ANGLE/ShaderLang.h" 37 37 #include <OpenGL/gl.h> 38 #elif PLATFORM(GTK) 39 #include "OpenGLShims.h" 38 40 #endif 39 41 … … 135 137 { 136 138 m_context->makeContextCurrent(); 137 #if defined GL_APPLE_vertex_array_object&& GL_APPLE_vertex_array_object139 #if !PLATFORM(GTK) && defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object 138 140 GLuint array = 0; 139 141 glGenVertexArraysAPPLE(1, &array); … … 150 152 151 153 m_context->makeContextCurrent(); 152 #if defined GL_APPLE_vertex_array_object&& GL_APPLE_vertex_array_object154 #if !PLATFORM(GTK) && defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object 153 155 glDeleteVertexArraysAPPLE(1, &array); 154 156 #endif … … 161 163 162 164 m_context->makeContextCurrent(); 163 #if defined GL_APPLE_vertex_array_object&& GL_APPLE_vertex_array_object165 #if !PLATFORM(GTK) && defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object 164 166 return glIsVertexArrayAPPLE(array); 165 167 #else … … 174 176 175 177 m_context->makeContextCurrent(); 176 #if defined GL_APPLE_vertex_array_object&& GL_APPLE_vertex_array_object178 #if !PLATFORM(GTK) && defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object 177 179 glBindVertexArrayAPPLE(array); 178 180 #endif -
trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp
r82335 r82878 43 43 #include "NotImplemented.h" 44 44 #include "Uint8Array.h" 45 #include <cstring> 46 #include <wtf/UnusedParam.h> 47 #include <wtf/text/CString.h> 45 48 46 49 #if PLATFORM(MAC) 47 50 #include <OpenGL/gl.h> 51 #elif PLATFORM(GTK) 52 #include "OpenGLShims.h" 48 53 #endif 49 50 #include <wtf/UnusedParam.h>51 #include <wtf/text/CString.h>52 54 53 55 namespace WebCore { … … 164 166 void GraphicsContext3D::reshape(int width, int height) 165 167 { 166 if (! m_contextObj)168 if (!platformGraphicsContext3D()) 167 169 return; 168 170 -
trunk/Source/WebKit/gtk/ChangeLog
r82870 r82878 1 2011-04-04 Martin Robinson <mrobinson@igalia.com> 2 3 Reviewed by Gustavo Noronha Silva. 4 5 [GTK] WebGL support 6 https://bugs.webkit.org/show_bug.cgi?id=31517 7 8 Add support for toggling WebGL at runtime when it's enabled. 9 10 * webkit/webkitwebsettings.cpp: Add the enable-webgl property. When ENABLE_WEBGL 11 is not enabled, it's a no-op. 12 (webkit_web_settings_class_init): Update to support enable-webgl. 13 (webkit_web_settings_set_property): Ditto. 14 (webkit_web_settings_get_property): Ditto. 15 * webkit/webkitwebview.cpp: 16 (webkit_web_view_update_settings): Ditto. 17 1 18 2011-04-04 Alexey Proskuryakov <ap@apple.com> 2 19 -
trunk/Source/WebKit/gtk/GNUmakefile.am
r82599 r82878 99 99 $(LIBXML_LIBS) \ 100 100 $(LIBXSLT_LIBS) \ 101 $(OPENGL_LIBS) \ 101 102 $(PANGO_LIBS) \ 102 103 $(PNG_LIBS) \ -
trunk/Source/WebKit/gtk/webkit/webkitwebsettings.cpp
r80856 r82878 114 114 gboolean enable_fullscreen; 115 115 gboolean enable_dns_prefetching; 116 gboolean enable_webgl; 116 117 }; 117 118 … … 167 168 PROP_ENABLE_HYPERLINK_AUDITING, 168 169 PROP_ENABLE_FULLSCREEN, 169 PROP_ENABLE_DNS_PREFETCHING 170 PROP_ENABLE_DNS_PREFETCHING, 171 PROP_ENABLE_WEBGL 170 172 }; 171 173 … … 913 915 FALSE, 914 916 flags)); 917 /** 918 * WebKitWebSettings:enable-webgl: 919 * 920 * Enable or disable support for WebGL on pages. WebGL is an experimental 921 * proposal for allowing web pages to use OpenGL ES-like calls directly. The 922 * standard is currently a work-in-progress by the Khronos Group. 923 * 924 * Since: 1.3.14 925 */ 926 g_object_class_install_property(gobject_class, 927 PROP_ENABLE_WEBGL, 928 g_param_spec_boolean("enable-webgl", 929 _("Enable WebGL"), 930 _("Whether WebGL content should be rendered"), 931 FALSE, 932 flags)); 915 933 916 934 /** … … 1118 1136 priv->enable_dns_prefetching = g_value_get_boolean(value); 1119 1137 break; 1138 case PROP_ENABLE_WEBGL: 1139 priv->enable_webgl = g_value_get_boolean(value); 1140 break; 1120 1141 default: 1121 1142 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); … … 1270 1291 case PROP_ENABLE_DNS_PREFETCHING: 1271 1292 g_value_set_boolean(value, priv->enable_dns_prefetching); 1293 break; 1294 case PROP_ENABLE_WEBGL: 1295 g_value_set_boolean(value, priv->enable_webgl); 1272 1296 break; 1273 1297 default: -
trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp
r82870 r82878 3249 3249 javaScriptCanAccessClipboard, enableOfflineWebAppCache, 3250 3250 enableUniversalAccessFromFileURI, enableFileAccessFromFileURI, 3251 enableDOMPaste, tabKeyCyclesThroughElements, 3251 enableDOMPaste, tabKeyCyclesThroughElements, enableWebGL, 3252 3252 enableSiteSpecificQuirks, usePageCache, enableJavaApplet, 3253 3253 enableHyperlinkAuditing, enableFullscreen, enableDNSPrefetching; … … 3293 3293 "enable-fullscreen", &enableFullscreen, 3294 3294 "enable-dns-prefetching", &enableDNSPrefetching, 3295 "enable-webgl", &enableWebGL, 3295 3296 NULL); 3296 3297 … … 3330 3331 settings->setJavaEnabled(enableJavaApplet); 3331 3332 settings->setHyperlinkAuditingEnabled(enableHyperlinkAuditing); 3333 settings->setDNSPrefetchingEnabled(enableDNSPrefetching); 3334 3332 3335 #if ENABLE(FULLSCREEN_API) 3333 3336 settings->setFullScreenEnabled(enableFullscreen); 3334 3337 #endif 3338 3335 3339 #if ENABLE(SPELLCHECK) 3336 3340 WebKit::EditorClient* client = static_cast<WebKit::EditorClient*>(core(webView)->editorClient()); 3337 3341 static_cast<WebKit::TextCheckerClientEnchant*>(client->textChecker())->updateSpellCheckingLanguage(defaultSpellCheckingLanguages); 3338 3342 #endif 3339 settings->setDNSPrefetchingEnabled(enableDNSPrefetching); 3343 3344 #if ENABLE(WEBGL) 3345 settings->setWebGLEnabled(enableWebGL); 3346 #endif 3340 3347 3341 3348 Page* page = core(webView); … … 3455 3462 else if (name == g_intern_string("enable-hyperlink-auditing")) 3456 3463 settings->setHyperlinkAuditingEnabled(g_value_get_boolean(&value)); 3464 3457 3465 #if ENABLE(SPELLCHECK) 3458 3466 else if (name == g_intern_string("spell-checking-languages")) { … … 3461 3469 } 3462 3470 #endif 3471 3472 #if ENABLE(WEBGL) 3473 else if (name == g_intern_string("enable-webgl")) 3474 settings->setWebGLEnabled(g_value_get_boolean(&value)); 3475 #endif 3476 3463 3477 else if (!g_object_class_find_property(G_OBJECT_GET_CLASS(webSettings), name)) 3464 3478 g_warning("Unexpected setting '%s'", name); -
trunk/Tools/ChangeLog
r82848 r82878 1 2011-04-04 Martin Robinson <mrobinson@igalia.com> 2 3 Reviewed by Gustavo Noronha Silva. 4 5 [GTK] WebGL support 6 https://bugs.webkit.org/show_bug.cgi?id=31517 7 8 Add support to the DRT for turning on WebGL when a layout tests requests it. 9 10 * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp: 11 (LayoutTestController::overridePreference): Allow turning on WebGL from tests. 12 1 13 2011-04-04 Chang Shu <cshu@webkit.org> 2 14 -
trunk/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
r82774 r82878 779 779 else if (g_str_equal(originalName.get(), "WebKitHyperlinkAuditingEnabled")) 780 780 propertyName = "enable-hyperlink-auditing"; 781 else if (g_str_equal(originalName.get(), "WebKitWebGLEnabled")) 782 propertyName = "enable-webgl"; 781 783 else if (g_str_equal(originalName.get(), "WebKitTabToLinksPreferenceKey")) { 782 784 DumpRenderTreeSupportGtk::setLinksIncludedInFocusChain(!g_ascii_strcasecmp(valueAsString.get(), "true") || !g_ascii_strcasecmp(valueAsString.get(), "1")); -
trunk/configure.ac
r82599 r82878 371 371 [], [enable_webgl="no"]) 372 372 AC_MSG_RESULT([$enable_webgl]) 373 374 if test "$enable_webgl" = "yes"; then 375 AC_CHECK_HEADERS([GL/gl.h], [], AC_MSG_ERROR([OpenGL header not found])) 376 AC_CHECK_HEADERS([GL/glx.h], [], AC_MSG_ERROR([GLX header not found])) 377 OPENGL_LIBS=-lGL 378 fi 379 AC_SUBST([OPENGL_LIBS]) 373 380 374 381 # check whether to enable channel messaging support
Note: See TracChangeset
for help on using the changeset viewer.