Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(235)

Side by Side Diff: ui/gl/BUILD.gn

Issue 1723303002: Implement GLX for Ozone X11. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase/refactor. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 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 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import("//build/config/ui.gni") 5 import("//build/config/ui.gni")
6 import("//ui/ozone/ozone.gni")
6 import("//testing/test.gni") 7 import("//testing/test.gni")
7 8
8 if (is_android) { 9 if (is_android) {
9 import("//build/config/android/config.gni") 10 import("//build/config/android/config.gni")
10 import("//build/config/android/rules.gni") 11 import("//build/config/android/rules.gni")
11 } 12 }
12 13
13 config("gl_config") { 14 config("gl_config") {
14 if (use_x11) { 15 defines = []
15 defines = [ "GL_GLEXT_PROTOTYPES" ] 16 if (use_x11 || ozone_platform_x11) {
17 defines += [
18 "GL_GLEXT_PROTOTYPES",
19 "USE_GLX",
20 ]
21 }
22 if (is_win || is_android || is_linux) {
23 defines += [ "USE_EGL" ]
16 } 24 }
17 } 25 }
18 26
19 component("gl") { 27 component("gl") {
20 output_name = "gl_wrapper" # Avoid colliding with OS X"s libGL.dylib. 28 output_name = "gl_wrapper" # Avoid colliding with OS X"s libGL.dylib.
21 29
22 sources = [ 30 sources = [
23 "android/gl_jni_registrar.cc", 31 "android/gl_jni_registrar.cc",
24 "android/gl_jni_registrar.h", 32 "android/gl_jni_registrar.h",
25 "android/scoped_java_surface.cc", 33 "android/scoped_java_surface.cc",
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 ] 143 ]
136 144
137 if (is_win || is_android || is_linux) { 145 if (is_win || is_android || is_linux) {
138 sources += [ 146 sources += [
139 "egl_util.cc", 147 "egl_util.cc",
140 "egl_util.h", 148 "egl_util.h",
141 "gl_bindings_autogen_egl.cc", 149 "gl_bindings_autogen_egl.cc",
142 "gl_bindings_autogen_egl.h", 150 "gl_bindings_autogen_egl.h",
143 "gl_context_egl.cc", 151 "gl_context_egl.cc",
144 "gl_context_egl.h", 152 "gl_context_egl.h",
153 "gl_egl_api_implementation.cc",
154 "gl_egl_api_implementation.h",
145 "gl_fence_egl.cc", 155 "gl_fence_egl.cc",
146 "gl_fence_egl.h", 156 "gl_fence_egl.h",
147 "gl_image_egl.cc", 157 "gl_image_egl.cc",
148 "gl_image_egl.h", 158 "gl_image_egl.h",
149 "gl_surface_egl.cc", 159 "gl_surface_egl.cc",
150 "gl_surface_egl.h", 160 "gl_surface_egl.h",
151 ] 161 ]
152 } 162 }
153 if (is_android || is_linux) { 163 if (is_android || is_linux) {
154 sources += [ 164 sources += [
155 "gl_implementation_osmesa.cc", 165 "gl_implementation_osmesa.cc",
156 "gl_implementation_osmesa.h", 166 "gl_implementation_osmesa.h",
157 ] 167 ]
158 } 168 }
159 if (!is_android) { # TODO(GYP) Enable on Android when osmesa links. 169 if (!is_android) { # TODO(GYP) Enable on Android when osmesa links.
160 deps += [ "//third_party/mesa:osmesa" ] 170 deps += [ "//third_party/mesa:osmesa" ]
161 } 171 }
162 if (use_x11) { 172 if (use_x11) {
163 sources += [ 173 sources += [
174 "gl_context_x11.cc",
175 "gl_implementation_x11.cc",
176 "gl_surface_egl_x11.cc",
177 "gl_surface_egl_x11.h",
178 "gl_surface_x11.cc",
179 ]
180
181 data_deps = [
182 "//third_party/angle:libEGL",
183 "//third_party/angle:libGLESv2",
184 ]
185 }
186 if (use_ozone) {
187 sources += [
188 "gl_context_ozone.cc",
189 "gl_image_ozone_native_pixmap.cc",
190 "gl_image_ozone_native_pixmap.h",
191 "gl_implementation_ozone.cc",
192 "gl_surface_ozone.cc",
193 ]
194 deps += [ "//ui/ozone" ]
195 }
196 if (use_x11 || ozone_platform_x11) {
197 sources += [
164 "gl_bindings_autogen_glx.cc", 198 "gl_bindings_autogen_glx.cc",
165 "gl_bindings_autogen_glx.h", 199 "gl_bindings_autogen_glx.h",
166 "gl_context_glx.cc", 200 "gl_context_glx.cc",
167 "gl_context_glx.h", 201 "gl_context_glx.h",
168 "gl_context_x11.cc",
169 "gl_egl_api_implementation.cc",
170 "gl_egl_api_implementation.h",
171 "gl_glx_api_implementation.cc", 202 "gl_glx_api_implementation.cc",
172 "gl_glx_api_implementation.h", 203 "gl_glx_api_implementation.h",
173 "gl_image_glx.cc", 204 "gl_image_glx.cc",
174 "gl_image_glx.h", 205 "gl_image_glx.h",
175 "gl_implementation_x11.cc",
176 "gl_surface_egl_x11.cc",
177 "gl_surface_egl_x11.h",
178 "gl_surface_glx.cc", 206 "gl_surface_glx.cc",
179 "gl_surface_glx.h", 207 "gl_surface_glx.h",
180 "gl_surface_x11.cc",
181 ] 208 ]
182 209
183 configs += [ 210 configs += [
184 "//build/config/linux:x11", 211 "//build/config/linux:x11",
185 "//build/config/linux:xcomposite", 212 "//build/config/linux:xcomposite",
186 "//build/config/linux:xext", 213 "//build/config/linux:xext",
187 ] 214 ]
188 215
189 deps += [ "//ui/gfx/x" ] 216 deps += [ "//ui/gfx/x" ]
190 data_deps = [ 217 }
191 "//third_party/angle:libEGL", 218 if (ozone_platform_x11) {
192 "//third_party/angle:libGLESv2", 219 deps += [ "//ui/events/platform/x11" ]
193 ]
194 } 220 }
195 if (is_win) { 221 if (is_win) {
196 sources += [ 222 sources += [
197 "angle_platform_impl.cc", 223 "angle_platform_impl.cc",
198 "angle_platform_impl.h", 224 "angle_platform_impl.h",
199 "gl_bindings_autogen_wgl.cc", 225 "gl_bindings_autogen_wgl.cc",
200 "gl_bindings_autogen_wgl.h", 226 "gl_bindings_autogen_wgl.h",
201 "gl_context_wgl.cc", 227 "gl_context_wgl.cc",
202 "gl_context_wgl.h", 228 "gl_context_wgl.h",
203 "gl_egl_api_implementation.cc",
204 "gl_egl_api_implementation.h",
205 "gl_surface_wgl.cc", 229 "gl_surface_wgl.cc",
206 "gl_surface_wgl.h", 230 "gl_surface_wgl.h",
207 "gl_wgl_api_implementation.cc", 231 "gl_wgl_api_implementation.cc",
208 "gl_wgl_api_implementation.h", 232 "gl_wgl_api_implementation.h",
209 "vsync_provider_win.cc", 233 "vsync_provider_win.cc",
210 "vsync_provider_win.h", 234 "vsync_provider_win.h",
211 ] 235 ]
212 236
213 libs = [ "dwmapi.lib" ] 237 libs = [ "dwmapi.lib" ]
214 ldflags = [ "/DELAYLOAD:dwmapi.dll" ] 238 ldflags = [ "/DELAYLOAD:dwmapi.dll" ]
(...skipping 17 matching lines...) Expand all
232 ] 256 ]
233 257
234 libs = [ 258 libs = [
235 "IOSurface.framework", 259 "IOSurface.framework",
236 "OpenGL.framework", 260 "OpenGL.framework",
237 "Quartz.framework", 261 "Quartz.framework",
238 ] 262 ]
239 } 263 }
240 if (is_android) { 264 if (is_android) {
241 sources += [ 265 sources += [
242 "gl_egl_api_implementation.cc",
243 "gl_egl_api_implementation.h",
244 "gl_image_surface_texture.cc", 266 "gl_image_surface_texture.cc",
245 "gl_image_surface_texture.h", 267 "gl_image_surface_texture.h",
246 ] 268 ]
247 269
248 defines += [ 270 defines += [
249 "GL_GLEXT_PROTOTYPES", 271 "GL_GLEXT_PROTOTYPES",
250 "EGL_EGLEXT_PROTOTYPES", 272 "EGL_EGLEXT_PROTOTYPES",
251 ] 273 ]
252 274
253 libs = [ "android" ] 275 libs = [ "android" ]
254 276
255 deps += [ 277 deps += [
256 ":gl_jni_headers", 278 ":gl_jni_headers",
257 "//ui/android:ui_java", 279 "//ui/android:ui_java",
258 ] 280 ]
259 } 281 }
260 if (use_ozone) {
261 sources += [
262 "gl_context_ozone.cc",
263 "gl_egl_api_implementation.cc",
264 "gl_egl_api_implementation.h",
265 "gl_image_ozone_native_pixmap.cc",
266 "gl_image_ozone_native_pixmap.h",
267 "gl_implementation_ozone.cc",
268 "gl_surface_ozone.cc",
269 ]
270 deps += [ "//ui/ozone" ]
271 }
272 } 282 }
273 283
274 source_set("gl_unittest_utils") { 284 source_set("gl_unittest_utils") {
275 testonly = true 285 testonly = true
276 sources = [ 286 sources = [
277 "gl_bindings_autogen_mock.cc", 287 "gl_bindings_autogen_mock.cc",
278 "gl_bindings_autogen_mock.h", 288 "gl_bindings_autogen_mock.h",
279 "gl_mock.cc", 289 "gl_mock.cc",
280 "gl_mock.h", 290 "gl_mock.h",
281 "gl_mock_autogen_gl.h", 291 "gl_mock_autogen_gl.h",
(...skipping 24 matching lines...) Expand all
306 316
307 configs += [ "//third_party/khronos:khronos_headers" ] 317 configs += [ "//third_party/khronos:khronos_headers" ]
308 318
309 public_deps = [ 319 public_deps = [
310 ":gl", 320 ":gl",
311 ] 321 ]
312 deps = [ 322 deps = [
313 "//testing/gtest", 323 "//testing/gtest",
314 ] 324 ]
315 325
316 if (use_x11) { 326 if (use_x11 || ozone_platform_x11) {
317 configs += [ "//build/config/linux:x11" ] 327 configs += [ "//build/config/linux:x11" ]
318 deps += [ 328 deps += [
319 "//ui/gfx/x", 329 "//ui/gfx/x",
320 "//ui/platform_window/x11", 330 "//ui/platform_window/x11",
321 ] 331 ]
322 } 332 }
323 } 333 }
324 334
325 test("gl_unittests") { 335 test("gl_unittests") {
326 sources = [ 336 sources = [
327 "gl_api_unittest.cc", 337 "gl_api_unittest.cc",
328 "gl_image_ref_counted_memory_unittest.cc", 338 "gl_image_ref_counted_memory_unittest.cc",
329 "gl_image_shared_memory_unittest.cc", 339 "gl_image_shared_memory_unittest.cc",
330 "gpu_timing_unittest.cc", 340 "gpu_timing_unittest.cc",
331 "test/run_all_unittests.cc", 341 "test/run_all_unittests.cc",
332 ] 342 ]
333 343
334 if (is_win || is_android || is_linux) { 344 if (is_win || is_android || is_linux) {
335 sources += [ 345 sources += [
336 "egl_api_unittest.cc", 346 "egl_api_unittest.cc",
337 "test/egl_initialization_displays_unittest.cc", 347 "test/egl_initialization_displays_unittest.cc",
338 ] 348 ]
339 } 349 }
340 350
341 if (use_x11) { 351 if (use_x11 || ozone_platform_x11) {
342 sources += [ "glx_api_unittest.cc" ] 352 sources += [ "glx_api_unittest.cc" ]
343 } 353 }
344 354
345 if (use_ozone) { 355 if (use_ozone) {
346 sources += [ "gl_image_ozone_native_pixmap_unittest.cc" ] 356 sources += [ "gl_image_ozone_native_pixmap_unittest.cc" ]
347 } 357 }
348 358
349 if (is_mac) { 359 if (is_mac) {
350 sources += [ "gl_image_io_surface_unittest.cc" ] 360 sources += [ "gl_image_io_surface_unittest.cc" ]
351 } 361 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 sources = [ 393 sources = [
384 "../android/java/src/org/chromium/ui/gl/SurfaceTextureListener.java", 394 "../android/java/src/org/chromium/ui/gl/SurfaceTextureListener.java",
385 "../android/java/src/org/chromium/ui/gl/SurfaceTexturePlatformWrapper.java ", 395 "../android/java/src/org/chromium/ui/gl/SurfaceTexturePlatformWrapper.java ",
386 ] 396 ]
387 public_deps = [ 397 public_deps = [
388 ":surface_jni_headers", 398 ":surface_jni_headers",
389 ] 399 ]
390 jni_package = "ui/gl" 400 jni_package = "ui/gl"
391 } 401 }
392 } 402 }
OLDNEW
« no previous file with comments | « ui/gfx/x/x11_types.h ('k') | ui/gl/gl.gyp » ('j') | ui/gl/gl_implementation_ozone.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698