| OLD | NEW | 
| (Empty) |  | 
 |    1 # Copyright 2014 The Chromium Authors. All rights reserved. | 
 |    2 # Use of this source code is governed by a BSD-style license that can be | 
 |    3 # found in the LICENSE file. | 
 |    4  | 
 |    5 import("//build/config/ui.gni") | 
 |    6  | 
 |    7 gl_binding_output_dir = target_gen_dir | 
 |    8  | 
 |    9 config("gl_config") { | 
 |   10   if (use_x11) { | 
 |   11     defines = [ "GL_GLEXT_PROTOTYPES" ] | 
 |   12   } | 
 |   13 } | 
 |   14  | 
 |   15 component("gl") { | 
 |   16   output_name = "gl_wrapper"  # Avoid colliding with OS X"s libGL.dylib. | 
 |   17  | 
 |   18   sources = [ | 
 |   19     "android/gl_jni_registrar.cc", | 
 |   20     "android/gl_jni_registrar.h", | 
 |   21     "android/scoped_java_surface.cc", | 
 |   22     "android/scoped_java_surface.h", | 
 |   23     "android/surface_texture.cc", | 
 |   24     "android/surface_texture.h", | 
 |   25     "android/surface_texture_listener.cc", | 
 |   26     "android/surface_texture_listener.h", | 
 |   27     "android/surface_texture_tracker.cc", | 
 |   28     "android/surface_texture_tracker.h", | 
 |   29     "gl_bindings.h", | 
 |   30     "gl_bindings_skia_in_process.cc", | 
 |   31     "gl_bindings_skia_in_process.h", | 
 |   32     "gl_context.cc", | 
 |   33     "gl_context.h", | 
 |   34     "gl_context_android.cc", | 
 |   35     "gl_context_mac.mm", | 
 |   36     "gl_context_osmesa.cc", | 
 |   37     "gl_context_osmesa.h", | 
 |   38     "gl_context_stub.cc", | 
 |   39     "gl_context_stub.h", | 
 |   40     "gl_context_stub_with_extensions.cc", | 
 |   41     "gl_context_stub_with_extensions.h", | 
 |   42     "gl_context_win.cc", | 
 |   43     "gl_context_x11.cc", | 
 |   44     "gl_export.h", | 
 |   45     "gl_fence.cc", | 
 |   46     "gl_fence.h", | 
 |   47     "gl_gl_api_implementation.cc", | 
 |   48     "gl_gl_api_implementation.h", | 
 |   49     "gl_image.cc", | 
 |   50     "gl_image.h", | 
 |   51     "gl_image_android.cc", | 
 |   52     "gl_image_mac.cc", | 
 |   53     "gl_image_shm.cc", | 
 |   54     "gl_image_shm.h", | 
 |   55     "gl_image_stub.cc", | 
 |   56     "gl_image_stub.h", | 
 |   57     "gl_image_win.cc", | 
 |   58     "gl_image_x11.cc", | 
 |   59     "gl_implementation.cc", | 
 |   60     "gl_implementation.h", | 
 |   61     "gl_implementation_android.cc", | 
 |   62     "gl_implementation_mac.cc", | 
 |   63     "gl_implementation_win.cc", | 
 |   64     "gl_implementation_x11.cc", | 
 |   65     "gl_osmesa_api_implementation.cc", | 
 |   66     "gl_osmesa_api_implementation.h", | 
 |   67     "gl_share_group.cc", | 
 |   68     "gl_share_group.h", | 
 |   69     "gl_state_restorer.cc", | 
 |   70     "gl_state_restorer.h", | 
 |   71     "gl_surface.cc", | 
 |   72     "gl_surface.h", | 
 |   73     "gl_surface_android.cc", | 
 |   74     "gl_surface_mac.cc", | 
 |   75     "gl_surface_stub.cc", | 
 |   76     "gl_surface_stub.h", | 
 |   77     "gl_surface_win.cc", | 
 |   78     "gl_surface_x11.cc", | 
 |   79     "gl_surface_osmesa.cc", | 
 |   80     "gl_surface_osmesa.h", | 
 |   81     "gl_switches.cc", | 
 |   82     "gl_switches.h", | 
 |   83     "gl_version_info.cc", | 
 |   84     "gl_version_info.h", | 
 |   85     "gpu_switching_manager.cc", | 
 |   86     "gpu_switching_manager.h", | 
 |   87     "io_surface_support_mac.cc", | 
 |   88     "io_surface_support_mac.h", | 
 |   89     "scoped_binders.cc", | 
 |   90     "scoped_binders.h", | 
 |   91     "scoped_make_current.cc", | 
 |   92     "scoped_make_current.h", | 
 |   93     "sync_control_vsync_provider.cc", | 
 |   94     "sync_control_vsync_provider.h", | 
 |   95     "$gl_binding_output_dir/gl_bindings_autogen_gl.cc", | 
 |   96     "$gl_binding_output_dir/gl_bindings_autogen_gl.h", | 
 |   97     "$gl_binding_output_dir/gl_bindings_autogen_osmesa.cc", | 
 |   98     "$gl_binding_output_dir/gl_bindings_autogen_osmesa.h", | 
 |   99   ] | 
 |  100  | 
 |  101   defines = [ "GL_IMPLEMENTATION" ] | 
 |  102  | 
 |  103   include_dirs = [ | 
 |  104     "//third_party/switfshader/include", | 
 |  105     "//third_party/khronos", | 
 |  106     "//third_party/mesa/src/include", | 
 |  107     gl_binding_output_dir, | 
 |  108   ] | 
 |  109  | 
 |  110   all_dependent_configs = [ ":gl_config" ] | 
 |  111  | 
 |  112   deps = [ | 
 |  113     ":generate_gl_bindings", | 
 |  114     "//base", | 
 |  115     "//base/third_party/dynamic_annotations", | 
 |  116     "//gpu/command_buffer:gles2_utils", | 
 |  117     "//skia", | 
 |  118     # TODO(GYP) hook up once this is converted. | 
 |  119     # Also uncomment forward statement below. | 
 |  120     #"//third_party/mesa:mesa_headers", | 
 |  121     "//ui/gfx", | 
 |  122     "//ui/gfx/geometry", | 
 |  123   ] | 
 |  124  | 
 |  125   # TODO(GYP) hook up once this is converted. | 
 |  126   #forward_dependent_configs_from = [ "//third_party/mesa:mesa_headers" ] | 
 |  127  | 
 |  128   if (is_win || is_android || is_linux) { | 
 |  129     sources += [ | 
 |  130       "egl_util.cc", | 
 |  131       "egl_util.h", | 
 |  132       "gl_context_egl.cc", | 
 |  133       "gl_context_egl.h", | 
 |  134       "gl_image_egl.cc", | 
 |  135       "gl_image_egl.h", | 
 |  136       "gl_surface_egl.cc", | 
 |  137       "gl_surface_egl.h", | 
 |  138       "$gl_binding_output_dir/gl_bindings_autogen_egl.cc", | 
 |  139       "$gl_binding_output_dir/gl_bindings_autogen_egl.h", | 
 |  140     ] | 
 |  141   } | 
 |  142   if (is_android || is_linux) { | 
 |  143     sources += [ | 
 |  144       "gl_implementation_osmesa.cc", | 
 |  145       "gl_implementation_osmesa.h", | 
 |  146     ] | 
 |  147   } | 
 |  148   if (use_x11) { | 
 |  149     sources += [ | 
 |  150       "gl_context_glx.cc", | 
 |  151       "gl_context_glx.h", | 
 |  152       "gl_glx_api_implementation.cc", | 
 |  153       "gl_glx_api_implementation.h", | 
 |  154       "gl_image_glx.cc", | 
 |  155       "gl_image_glx.h", | 
 |  156       "gl_surface_glx.cc", | 
 |  157       "gl_surface_glx.h", | 
 |  158       "gl_egl_api_implementation.cc", | 
 |  159       "gl_egl_api_implementation.h", | 
 |  160       "$gl_binding_output_dir/gl_bindings_autogen_glx.cc", | 
 |  161       "$gl_binding_output_dir/gl_bindings_autogen_glx.h", | 
 |  162     ] | 
 |  163  | 
 |  164     configs += [ | 
 |  165       "//build/config/linux:x11", | 
 |  166       "//build/config/linux:xcomposite", | 
 |  167       "//build/config/linux:xext", | 
 |  168     ] | 
 |  169  | 
 |  170     deps += [ | 
 |  171       "//ui/gfx/x", | 
 |  172     ] | 
 |  173   } | 
 |  174   if (is_win) { | 
 |  175     sources += [ | 
 |  176       "gl_context_wgl.cc", | 
 |  177       "gl_context_wgl.h", | 
 |  178       "gl_egl_api_implementation.cc", | 
 |  179       "gl_egl_api_implementation.h", | 
 |  180       "gl_surface_wgl.cc", | 
 |  181       "gl_surface_wgl.h", | 
 |  182       "gl_wgl_api_implementation.cc", | 
 |  183       "gl_wgl_api_implementation.h", | 
 |  184       "$gl_binding_output_dir/gl_bindings_autogen_wgl.cc", | 
 |  185       "$gl_binding_output_dir/gl_bindings_autogen_wgl.h", | 
 |  186     ] | 
 |  187  | 
 |  188     libs = [ "dwmapi.lib" ] | 
 |  189     ldflags = [ "/DELAYLOAD:dwmapi.dll" ] | 
 |  190   } | 
 |  191   if (is_mac) { | 
 |  192     sources += [ | 
 |  193       "gl_context_cgl.cc", | 
 |  194       "gl_context_cgl.h", | 
 |  195       "gl_image_io_surface.cc", | 
 |  196       "gl_image_io_surface.h", | 
 |  197       "gl_surface_cgl.cc", | 
 |  198       "gl_surface_cgl.h", | 
 |  199       "scoped_cgl.cc", | 
 |  200       "scoped_cgl.h", | 
 |  201     ] | 
 |  202  | 
 |  203     libs = [ "OpenGL.framework" ] | 
 |  204   } | 
 |  205   if (is_android) { | 
 |  206     sources += [ | 
 |  207       "gl_egl_api_implementation.cc", | 
 |  208       "gl_egl_api_implementation.h", | 
 |  209       "gl_image_android_native_buffer.cc", | 
 |  210       "gl_image_android_native_buffer.h", | 
 |  211       "gl_image_surface_texture.cc", | 
 |  212       "gl_image_surface_texture.h", | 
 |  213     ] | 
 |  214  | 
 |  215     defines += [ | 
 |  216       "GL_GLEXT_PROTOTYPES", | 
 |  217       "EGL_EGLEXT_PROTOTYPES", | 
 |  218     ] | 
 |  219  | 
 |  220     libs = [ "android" ] | 
 |  221   } | 
 |  222   if (use_ozone) { | 
 |  223     sources += [ | 
 |  224       "gl_context_ozone.cc", | 
 |  225       "gl_image_ozone.cc", | 
 |  226       "gl_implementation_ozone.cc", | 
 |  227       "gl_surface_ozone.cc", | 
 |  228     ] | 
 |  229     deps += [ | 
 |  230       "//ui/gfx/ozone", | 
 |  231       "//ui/ozone", | 
 |  232     ] | 
 |  233   } | 
 |  234  | 
 |  235   # TODO(GYP) enable this dependency once its written. | 
 |  236   #if (is_android && !android_webview_build) { | 
 |  237   #  deps += [ "//ui/android:ui_java" ] | 
 |  238   #} | 
 |  239 } | 
 |  240  | 
 |  241 action("generate_gl_bindings") { | 
 |  242   script = "generate_bindings.py" | 
 |  243  | 
 |  244   # TODO(brettw) make this dynamic. The GYP version calls "generate_bindings.py | 
 |  245   # --inputs" to get the list here. What should happen is that the script | 
 |  246   # should generate a .d file, which we should declare here. That will | 
 |  247   # eliminate the need bot both hardcoding the list here or calling the script | 
 |  248   # during GN-time. | 
 |  249   source_prereqs = [ | 
 |  250     "EGL/eglextchromium.h", | 
 |  251     "GL/glextchromium.h", | 
 |  252     "//third_party/mesa/src/include/GL/glext.h", | 
 |  253     "//third_party/khronos/GLES2/gl2ext.h", | 
 |  254     "//gpu/GLES2/gl2chromium.h", | 
 |  255     "//gpu/GLES2/gl2extchromium.h", | 
 |  256     "//third_party/khronos/EGL/eglext.h", | 
 |  257     "//third_party/mesa/src/include/GL/wglext.h", | 
 |  258     "//third_party/mesa/src/include/GL/glx.h", | 
 |  259     "//third_party/mesa/src/include/GL/glxext.h", | 
 |  260   ] | 
 |  261  | 
 |  262   outputs = [ | 
 |  263     "$gl_binding_output_dir/gl_bindings_autogen_egl.cc", | 
 |  264     "$gl_binding_output_dir/gl_bindings_autogen_egl.h", | 
 |  265     "$gl_binding_output_dir/gl_bindings_api_autogen_egl.h", | 
 |  266     "$gl_binding_output_dir/gl_bindings_autogen_gl.cc", | 
 |  267     "$gl_binding_output_dir/gl_bindings_autogen_gl.h", | 
 |  268     "$gl_binding_output_dir/gl_bindings_api_autogen_gl.h", | 
 |  269     "$gl_binding_output_dir/gl_bindings_autogen_glx.cc", | 
 |  270     "$gl_binding_output_dir/gl_bindings_autogen_glx.h", | 
 |  271     "$gl_binding_output_dir/gl_bindings_api_autogen_glx.h", | 
 |  272     "$gl_binding_output_dir/gl_bindings_autogen_mock.cc", | 
 |  273     "$gl_binding_output_dir/gl_bindings_autogen_mock.h", | 
 |  274     "$gl_binding_output_dir/gl_bindings_autogen_osmesa.cc", | 
 |  275     "$gl_binding_output_dir/gl_bindings_autogen_osmesa.h", | 
 |  276     "$gl_binding_output_dir/gl_bindings_api_autogen_osmesa.h", | 
 |  277     "$gl_binding_output_dir/gl_bindings_autogen_wgl.cc", | 
 |  278     "$gl_binding_output_dir/gl_bindings_autogen_wgl.h", | 
 |  279     "$gl_binding_output_dir/gl_bindings_api_autogen_wgl.h", | 
 |  280     "$gl_binding_output_dir/gl_mock_autogen_gl.h", | 
 |  281   ] | 
 |  282  | 
 |  283   args = [ | 
 |  284     "--header-paths=" + | 
 |  285         rebase_path("//third_party/khronos", root_build_dir) + ":" + | 
 |  286         rebase_path("//third_party/mesa/src/include", root_build_dir), | 
 |  287     rebase_path(gl_binding_output_dir, root_build_dir), | 
 |  288   ] | 
 |  289 } | 
| OLD | NEW |