Changeset 181321 in webkit


Ignore:
Timestamp:
Mar 10, 2015 6:19:35 AM (9 years ago)
Author:
Carlos Garcia Campos
Message:

[GTK] Add a configure option to build with OpenGL ES 2
https://bugs.webkit.org/show_bug.cgi?id=142498

Patch by Carlos Garcia Campos <cgarcia@igalia.com> and José Dapena Paz <jdapena@igalia.com> on 2015-03-10
Reviewed by Martin Robinson.

.:

Add ENABLE_GLES2 option. It's disabled by default, but if passed
GLES2 is required and OpenGL is not even searched. Otherwise we
search for OpenGL as usual, using it only if present.

  • Source/cmake/OptionsGTK.cmake:

Source/WebCore:

Build GLES or GL specific files depending on the build options.

  • PlatformGTK.cmake:
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r181318 r181321  
     12015-03-10  Carlos Garcia Campos  <cgarcia@igalia.com> and José Dapena Paz  <jdapena@igalia.com>
     2
     3        [GTK] Add a configure option to build with OpenGL ES 2
     4        https://bugs.webkit.org/show_bug.cgi?id=142498
     5
     6        Reviewed by Martin Robinson.
     7
     8        Add ENABLE_GLES2 option. It's disabled by default, but if passed
     9        GLES2 is required and OpenGL is not even searched. Otherwise we
     10        search for OpenGL as usual, using it only if present.
     11
     12        * Source/cmake/OptionsGTK.cmake:
     13
    1142015-03-10  Csaba Osztrogonác  <ossy@webkit.org>
    215
  • trunk/Source/WebCore/ChangeLog

    r181320 r181321  
     12015-03-10  Carlos Garcia Campos  <cgarcia@igalia.com> and José Dapena Paz  <jdapena@igalia.com>
     2
     3        [GTK] Add a configure option to build with OpenGL ES 2
     4        https://bugs.webkit.org/show_bug.cgi?id=142498
     5
     6        Reviewed by Martin Robinson.
     7
     8        Build GLES or GL specific files depending on the build options.
     9
     10        * PlatformGTK.cmake:
     11
    1122015-03-10  Zan Dobersek  <zdobersek@igalia.com>
    213
  • trunk/Source/WebCore/PlatformGTK.cmake

    r179111 r181321  
    6666    platform/graphics/GraphicsContext3DPrivate.cpp
    6767    platform/graphics/ImageSource.cpp
    68     platform/graphics/OpenGLShims.cpp
    6968    platform/graphics/WOFFFileFormat.cpp
    7069
     
    117116    platform/graphics/harfbuzz/HarfBuzzShaper.cpp
    118117
    119     platform/graphics/opengl/Extensions3DOpenGL.cpp
    120118    platform/graphics/opengl/Extensions3DOpenGLCommon.cpp
    121     platform/graphics/opengl/Extensions3DOpenGLES.cpp
    122     platform/graphics/opengl/GraphicsContext3DOpenGL.cpp
    123119    platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp
    124120    platform/graphics/opengl/TemporaryOpenGLSetting.cpp
     
    403399    list(APPEND WebCore_LIBRARIES
    404400        ${EGL_LIBRARY}
     401    )
     402endif ()
     403
     404if (WTF_USE_OPENGL_ES_2)
     405    list(APPEND WebCore_SOURCES
     406        platform/graphics/opengl/Extensions3DOpenGLES.cpp
     407        platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp
     408    )
     409endif ()
     410
     411if (WTF_USE_OPENGL)
     412    list(APPEND WebCore_SOURCES
     413        platform/graphics/OpenGLShims.cpp
     414
     415        platform/graphics/opengl/Extensions3DOpenGL.cpp
     416        platform/graphics/opengl/GraphicsContext3DOpenGL.cpp
    405417    )
    406418endif ()
  • trunk/Source/cmake/OptionsGTK.cmake

    r180502 r181321  
    1717set(ENABLE_WAYLAND_TARGET OFF CACHE BOOL "Whether to enable support for the Wayland windowing target.")
    1818set(ENABLE_INTROSPECTION ON CACHE BOOL "Whether to enable GObject introspection.")
     19set(ENABLE_GLES2 OFF CACHE BOOL "Whether to enable OpenGL ES 2.0.")
    1920
    2021# These are shared variables, but we special case their definition so that we can use the
     
    4748find_package(ATSPI 2.5.3)
    4849find_package(GObjectIntrospection)
    49 find_package(OpenGL)
    5050find_package(EGL)
    5151find_package(GeoClue2 2.1.5)
     
    5555if (NOT GEOCLUE2_FOUND)
    5656    find_package(GeoClue)
     57endif ()
     58
     59if (ENABLE_GLES2)
     60    find_package(OpenGLES2 REQUIRED)
     61    if (OPENGLES2_FOUND AND NOT(EGL_FOUND))
     62        message(FATAL_ERROR "EGL is needed for OpenGL ES 2.0.")
     63    endif ()
     64else ()
     65    find_package(OpenGL)
    5766endif ()
    5867
     
    6271    # will fail.
    6372    find_package(X11 REQUIRED)
    64     # We don't use find_package for GLX because it is part of -lGL, unlike EGL.
    65     check_include_files("GL/glx.h" GLX_FOUND)
     73    if (OPENGL_FOUND)
     74        # We don't use find_package for GLX because it is part of -lGL, unlike EGL.
     75        check_include_files("GL/glx.h" GLX_FOUND)
     76    endif ()
    6677endif ()
    6778
     
    6980WEBKIT_OPTION_DEFINE(ENABLE_PLUGIN_PROCESS_GTK2 "Whether to build WebKitPluginProcess2 to load GTK2 based plugins." ON)
    7081
    71 if (OPENGL_FOUND AND (GLX_FOUND OR EGL_FOUND))
     82if ((OPENGL_FOUND OR OPENGLES2_FOUND) AND (GLX_FOUND OR EGL_FOUND))
    7283    WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEBGL ON)
    7384
    74     if (GLX_FOUND)
    75         list(APPEND CAIRO_GL_COMPONENTS cairo-glx)
    76     endif ()
    77     if (EGL_FOUND)
    78         list(APPEND CAIRO_GL_COMPONENTS cairo-egl)
    79     endif ()
    80     find_package(CairoGL 1.10.2 COMPONENTS ${CAIRO_GL_COMPONENTS})
    81     if (CAIRO_GL_FOUND)
    82         WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ACCELERATED_2D_CANVAS ON)
     85    if (OPENGL_FOUND)
     86        if (GLX_FOUND)
     87            list(APPEND CAIRO_GL_COMPONENTS cairo-glx)
     88        endif ()
     89        if (EGL_FOUND)
     90            list(APPEND CAIRO_GL_COMPONENTS cairo-egl)
     91        endif ()
     92        find_package(CairoGL 1.10.2 COMPONENTS ${CAIRO_GL_COMPONENTS})
     93        if (CAIRO_GL_FOUND)
     94            WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ACCELERATED_2D_CANVAS ON)
     95        else ()
     96            WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ACCELERATED_2D_CANVAS OFF)
     97        endif ()
    8398    else ()
     99        # FIXME: Should we search for cairo-glesv2 instead of cairo-gl in this case?
    84100        WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ACCELERATED_2D_CANVAS OFF)
    85101    endif ()
     
    316332endif ()
    317333
    318 if (OPENGL_FOUND AND (GLX_FOUND OR EGL_FOUND))
     334if ((OPENGL_FOUND OR OPENGLES2_FOUND) AND (GLX_FOUND OR EGL_FOUND))
    319335    set(ENABLE_TEXTURE_MAPPER 1)
    320336    set(WTF_USE_3D_GRAPHICS 1)
    321337
    322     add_definitions(-DWTF_USE_OPENGL=1)
    323338    add_definitions(-DWTF_USE_3D_GRAPHICS=1)
    324339    add_definitions(-DWTF_USE_TEXTURE_MAPPER=1)
    325340    add_definitions(-DWTF_USE_TEXTURE_MAPPER_GL=1)
    326341    add_definitions(-DENABLE_3D_RENDERING=1)
     342
     343    if (OPENGLES2_FOUND)
     344        set(WTF_USE_OPENGL_ES_2 1)
     345        add_definitions(-DWTF_USE_OPENGL_ES_2=1)
     346    else ()
     347        set(WTF_USE_OPENGL 1)
     348        add_definitions(-DWTF_USE_OPENGL=1)
     349    endif ()
    327350
    328351    if (EGL_FOUND)
Note: See TracChangeset for help on using the changeset viewer.