2011-06-10 Lucas De Marchi <lucas.demarchi@profusion.mobi>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Jun 2011 11:32:38 +0000 (11:32 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Jun 2011 11:32:38 +0000 (11:32 +0000)
        Reviewed by Kenneth Rohde Christiansen.

        [CMAKE] Add generic support for building with WebGL
        https://bugs.webkit.org/show_bug.cgi?id=62376

        Add files that need to be compiled in every port for supporting WebGL.
        Each port still needs to add its specific files to
        CMakeLists${PORT}.txt. Therefore we do not enable WebGL in any port
        yet.

        * Source/CMakeLists.txt: Add files needed to support WebGL.
        * Source/cmake/OptionsCommon.cmake: Find required OpenGL package.
        * Source/cmakeconfig.h.cmake: define ENABLE_WEBGL this feature is
        enabled.
2011-06-10  Lucas De Marchi  <lucas.demarchi@profusion.mobi>

        Reviewed by Kenneth Rohde Christiansen.

        [CMAKE] Add generic support for building with WebGL
        https://bugs.webkit.org/show_bug.cgi?id=62376

        Set new THIRDPARTY_DIR variable to compile sources under ThirdParty.

        No change in functionality so no new tests.

        * CMakeLists.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@88539 268f45cc-cd09-0410-ab3c-d52691b4dbfc

ChangeLog
Source/CMakeLists.txt
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/cmake/OptionsCommon.cmake
Source/cmakeconfig.h.cmake

index 9849cd3..1dc0edf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2011-06-10  Lucas De Marchi  <lucas.demarchi@profusion.mobi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [CMAKE] Add generic support for building with WebGL
+        https://bugs.webkit.org/show_bug.cgi?id=62376
+
+        Add files that need to be compiled in every port for supporting WebGL.
+        Each port still needs to add its specific files to
+        CMakeLists${PORT}.txt. Therefore we do not enable WebGL in any port
+        yet.
+
+        * Source/CMakeLists.txt: Add files needed to support WebGL.
+        * Source/cmake/OptionsCommon.cmake: Find required OpenGL package.
+        * Source/cmakeconfig.h.cmake: define ENABLE_WEBGL this feature is
+        enabled.
+
 2011-06-09  Lucas De Marchi  <lucas.demarchi@profusion.mobi>
 
         Reviewed by Antonio Gomes.
index cdaa555..237e479 100644 (file)
@@ -12,6 +12,7 @@ SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
 SET(JAVASCRIPTCORE_DIR "${CMAKE_SOURCE_DIR}/JavaScriptCore")
 SET(WEBCORE_DIR "${CMAKE_SOURCE_DIR}/WebCore")
 SET(WEBKIT_DIR "${CMAKE_SOURCE_DIR}/WebKit")
+SET(THIRDPARTY_DIR "${CMAKE_SOURCE_DIR}/ThirdParty")
 SET(TOOLS_DIR "${CMAKE_SOURCE_DIR}/../Tools")
 SET(DERIVED_SOURCES_WEBCORE_DIR "${CMAKE_BINARY_DIR}/DerivedSources/WebCore")
 SET(DERIVED_SOURCES_JAVASCRIPTCORE_DIR "${CMAKE_BINARY_DIR}/DerivedSources/JavaScriptCore")
index dba57e7..85cfe36 100644 (file)
@@ -847,6 +847,7 @@ SET(WebCore_SOURCES
 
     html/canvas/ArrayBuffer.cpp
     html/canvas/ArrayBufferView.cpp
+    html/canvas/CanvasContextAttributes.cpp
     html/canvas/CanvasGradient.cpp
     html/canvas/CanvasPattern.cpp
     html/canvas/CanvasPixelArray.cpp
@@ -1980,6 +1981,84 @@ IF (ENABLE_MHTML)
    )
 ENDIF ()
 
+IF (ENABLE_WEBGL)
+    LIST(APPEND WebCore_INCLUDE_DIRECTORIES
+        ${OPENGL_INCLUDE_DIR}
+        ${THIRDPARTY_DIR}/ANGLE/src
+        ${THIRDPARTY_DIR}/ANGLE/include
+        ${THIRDPARTY_DIR}/ANGLE/include/GLSLANG
+    )
+    LIST(APPEND WebCore_LIBRARIES
+        ${OPENGL_gl_LIBRARY}
+    )
+    LIST(APPEND WebCore_SOURCES
+        ${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/Compiler.cpp
+        ${THIRDPARTY_DIR}/ANGLE/src/compiler/debug.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/ossource_posix.cpp
+        ${THIRDPARTY_DIR}/ANGLE/src/compiler/OutputGLSL.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
+        ${THIRDPARTY_DIR}/ANGLE/src/compiler/preprocessor/memory.c
+        ${THIRDPARTY_DIR}/ANGLE/src/compiler/preprocessor/scanner.c
+        ${THIRDPARTY_DIR}/ANGLE/src/compiler/preprocessor/symbols.c
+        ${THIRDPARTY_DIR}/ANGLE/src/compiler/preprocessor/tokens.c
+        ${THIRDPARTY_DIR}/ANGLE/src/compiler/QualifierAlive.cpp
+        ${THIRDPARTY_DIR}/ANGLE/src/compiler/RemoveTree.cpp
+        ${THIRDPARTY_DIR}/ANGLE/src/compiler/SearchSymbol.cpp
+        ${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/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
+
+        bindings/js/JSWebGLRenderingContextCustom.cpp
+
+        html/canvas/WebGLBuffer.cpp
+        html/canvas/WebGLContextAttributes.cpp
+        html/canvas/WebGLContextEvent.cpp
+        html/canvas/WebGLFramebuffer.cpp
+        html/canvas/WebGLGetInfo.cpp
+        html/canvas/WebGLObject.cpp
+        html/canvas/WebGLProgram.cpp
+        html/canvas/WebGLRenderbuffer.cpp
+        html/canvas/WebGLRenderingContext.cpp
+        html/canvas/WebGLShader.cpp
+        html/canvas/WebGLTexture.cpp
+        html/canvas/WebGLUniformLocation.cpp
+        html/canvas/WebGLVertexArrayObjectOES.cpp
+        html/canvas/WebGLExtension.cpp
+        html/canvas/OESStandardDerivatives.cpp
+        html/canvas/OESTextureFloat.cpp
+        html/canvas/OESVertexArrayObject.cpp
+        html/canvas/WebKitLoseContext.cpp
+
+        platform/graphics/ANGLEWebKitBridge.cpp
+        platform/graphics/gpu/DrawingBuffer.cpp
+        platform/graphics/GraphicsContext3D.cpp
+        platform/graphics/opengl/Extensions3DOpenGL.cpp
+        platform/graphics/opengl/GraphicsContext3DOpenGL.cpp
+    )
+ENDIF ()
+
 # Modules that the bindings generator scripts may use
 SET(SCRIPTS_BINDINGS
     ${WEBCORE_DIR}/bindings/scripts/IDLParser.pm
@@ -1994,6 +2073,20 @@ SET(WebCore_LIBRARIES ${JavaScriptCore_LIBRARY_NAME})
 SET(WebCore_LINK_FLAGS "")
 INCLUDE_IF_EXISTS(${WEBCORE_DIR}/CMakeLists${PORT}.txt)
 
+# ANGLE tokenizer & parser
+ADD_CUSTOM_COMMAND(
+    OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/glslang.cpp
+    MAIN_DEPENDENCY ${THIRDPARTY_DIR}/ANGLE/src/compiler/glslang.l
+    COMMAND ${FLEX_EXECUTABLE} --noline --nounistd --outfile=glslang.cpp ${THIRDPARTY_DIR}/ANGLE/src/compiler/glslang.l
+    WORKING_DIRECTORY ${DERIVED_SOURCES_WEBCORE_DIR}
+    VERBATIM)
+
+ADD_CUSTOM_COMMAND(
+    OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/glslang_tab.cpp ${DERIVED_SOURCES_WEBCORE_DIR}/glslang_tab.h
+    MAIN_DEPENDENCY ${THIRDPARTY_DIR}/ANGLE/src/compiler/glslang.y
+    COMMAND ${BISON_EXECUTABLE} --no-lines --defines=glslang_tab.h --skeleton=yacc.c --output=glslang_tab.cpp ${THIRDPARTY_DIR}/ANGLE/src/compiler/glslang.y
+    WORKING_DIRECTORY ${DERIVED_SOURCES_WEBCORE_DIR}
+    VERBATIM)
 
 # All Web Inspector generated files are created with this one call to CodeGeneratorInspector.pm
 ADD_CUSTOM_COMMAND(
index 5015aa1..98a62a6 100644 (file)
@@ -1,3 +1,16 @@
+2011-06-10  Lucas De Marchi  <lucas.demarchi@profusion.mobi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [CMAKE] Add generic support for building with WebGL
+        https://bugs.webkit.org/show_bug.cgi?id=62376
+
+        Set new THIRDPARTY_DIR variable to compile sources under ThirdParty.
+
+        No change in functionality so no new tests.
+
+        * CMakeLists.txt:
+
 2011-06-10  Ryuan Choi  <ryuan.choi@samsung.com>
 
         Reviewed by Andreas Kling.
index 0e2429c..27a5e82 100644 (file)
@@ -10,3 +10,7 @@ IF (MSVC)
 ELSE ()
     SET(CODE_GENERATOR_PREPROCESSOR "${CMAKE_CXX_COMPILER} -E -P -x c++")
 ENDIF ()
+
+IF (ENABLE_WEBGL)
+    FIND_PACKAGE(OpenGL REQUIRED)
+ENDIF ()
index 33ea3a2..9ac6e26 100644 (file)
@@ -37,6 +37,7 @@
 #cmakedefine01 ENABLE_SVG_USE
 #cmakedefine01 ENABLE_TOUCH_EVENTS
 #cmakedefine01 ENABLE_VIDEO
+#cmakedefine01 ENABLE_WEBGL
 #cmakedefine01 ENABLE_WEB_SOCKETS
 #cmakedefine01 ENABLE_WORKERS
 #cmakedefine01 ENABLE_XHTMLMP