summaryrefslogtreecommitdiffstats
path: root/gpu/BUILD.gn
blob: cfa2e4aa56d2e2038fbd1d0b388551852cc79a2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# GYP-to-GN project mappings:
#
#  gpu.gyp:command_buffer_client => //gpu/command_buffer/client
#
#  gpu.gyp:command_buffer_common => //gpu/command_buffer/common
#
#  gpu.gyp:command_buffer_service => //gpu/command_buffer/service

#  gpu/gpu.gyp:gl_in_process_context =>
#      //gpu/command_buffer/client:gl_in_process_context
#
#  gpu.gyp:gles2_cmd_helper => //gpu/command_buffer/client:gles2_cmd_helper
#
#  gpu.gyp:gles2_c_lib => //gpu/command_buffer/client:gles2_c_lib
#
#  gpu.gyp:gles2_implementation =>
#      //gpu/command_buffer/client:gles2_implementation
#
#  gpu.gyp:gpu_config => //gpu/config
#
#  gpu.gyp:gpu_ipc => //gpu/ipc
#
#  gpu.gyp:disk_cache_proto => //gpu/command_buffer/service:disk_cache_proto
#
#  command_buffer/command_buffer.gyp:gles2_utils =>
#     //gpu/command_buffer/common:gles2_utils
#
# gpu/skia_bindings/skia_bindings.gyp:gpu_skia_bindings => //gpu/skia_bindings

import("//testing/test.gni")
import("//build/config/ui.gni")

config("gpu_implementation") {
  defines = [ "GPU_IMPLEMENTATION" ]
}

component("gpu") {
  public_deps = [
    "//gpu/command_buffer/client:client_sources",
    "//gpu/command_buffer/client:gles2_cmd_helper_sources",
    "//gpu/command_buffer/common:common_sources",
    "//gpu/command_buffer/service:service_sources",
    "//gpu/config:config_sources",
    "//gpu/ipc/common:ipc_common_sources",
  ]
}

# GYP version: //gpu/gpu.gyp:command_buffer_gles2
shared_library("command_buffer_gles2") {
  sources = [
    # TODO(hendrikw): Move egl out of gles2_conform_support.
    "gles2_conform_support/egl/config.cc",
    "gles2_conform_support/egl/config.h",
    "gles2_conform_support/egl/display.cc",
    "gles2_conform_support/egl/display.h",
    "gles2_conform_support/egl/egl.cc",
    "gles2_conform_support/egl/surface.cc",
    "gles2_conform_support/egl/surface.h",
    "gles2_conform_support/egl/test_support.cc",
    "gles2_conform_support/egl/test_support.h",
  ]

  deps = [
    ":gpu",
    "//base",
    "//gpu/command_buffer/client:gles2_c_lib",
    "//gpu/command_buffer/client:gles2_implementation",
    "//ui/gl:gl",
  ]

  defines = [
    "COMMAND_BUFFER_GLES_LIB_SUPPORT_ONLY",
    "EGLAPIENTRY=",
  ]
  if (current_os == "win") {
    defines += [ "EGLAPI=__declspec(dllexport)" ]
  } else {
    defines += [ "EGLAPI=__attribute__((visibility(\"default\")))" ]
  }
}

# GYP version: //gpu/gpu.gyp:command_buffer_gles2_tests
test("command_buffer_gles2_tests") {
  sources = [
    "command_buffer/tests/command_buffer_gles2_tests_main.cc",
    "command_buffer/tests/egl_test.cc",
  ]

  deps = [
    ":command_buffer_gles2",
    "//base",
    "//base/test:test_support",
    "//base/third_party/dynamic_annotations",
    "//testing/gmock",
    "//testing/gtest",
  ]

  defines = [
    "COMMAND_BUFFER_GLES_LIB_SUPPORT_ONLY",
    "EGLAPIENTRY=",
  ]
  if (current_os == "win") {
    defines += [ "EGLAPI=__declspec(dllimport)" ]
  } else {
    defines += [ "EGLAPI=" ]
  }

  libs = []

  if (is_android) {
    libs += [ "android" ]
    deps += [ "//ui/android:ui_java" ]
  }
  if (!is_component_build) {
    configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
  }
}

source_set("test_support") {
  testonly = true
  sources = [
    "command_buffer/client/gles2_interface_stub.cc",
    "command_buffer/client/gles2_interface_stub.h",
    "command_buffer/service/error_state_mock.cc",
    "command_buffer/service/gles2_cmd_decoder_mock.cc",
  ]

  public_deps = [
    ":gpu",
    "//gpu/command_buffer/client:gles2_interface",
  ]
  deps = [
    "//testing/gmock",
    "//testing/gtest",
    "//ui/gl:gl_unittest_utils",
  ]
}

test("gl_tests") {
  sources = [
    "command_buffer/tests/compressed_texture_test.cc",
    "command_buffer/tests/es3_misc_functions_unittest.cc",
    "command_buffer/tests/gl_bind_uniform_location_unittest.cc",
    "command_buffer/tests/gl_chromium_framebuffer_mixed_samples_unittest.cc",
    "command_buffer/tests/gl_chromium_framebuffer_multisample_unittest.cc",
    "command_buffer/tests/gl_chromium_path_rendering_unittest.cc",
    "command_buffer/tests/gl_clear_framebuffer_unittest.cc",
    "command_buffer/tests/gl_compressed_copy_texture_CHROMIUM_unittest.cc",
    "command_buffer/tests/gl_copy_tex_image_2d_workaround_unittest.cc",
    "command_buffer/tests/gl_copy_texture_CHROMIUM_unittest.cc",
    "command_buffer/tests/gl_cube_map_texture_unittest.cc",
    "command_buffer/tests/gl_depth_texture_unittest.cc",
    "command_buffer/tests/gl_dynamic_config_unittest.cc",
    "command_buffer/tests/gl_ext_blend_func_extended_unittest.cc",
    "command_buffer/tests/gl_ext_multisample_compatibility_unittest.cc",
    "command_buffer/tests/gl_ext_srgb_unittest.cc",
    "command_buffer/tests/gl_fence_sync_unittest.cc",
    "command_buffer/tests/gl_gpu_memory_buffer_unittest.cc",
    "command_buffer/tests/gl_lose_context_chromium_unittest.cc",
    "command_buffer/tests/gl_manager.cc",
    "command_buffer/tests/gl_manager.h",
    "command_buffer/tests/gl_pointcoord_unittest.cc",
    "command_buffer/tests/gl_program_unittest.cc",
    "command_buffer/tests/gl_query_unittest.cc",
    "command_buffer/tests/gl_readback_unittest.cc",
    "command_buffer/tests/gl_request_extension_unittest.cc",
    "command_buffer/tests/gl_shared_resources_unittest.cc",
    "command_buffer/tests/gl_stream_draw_unittest.cc",
    "command_buffer/tests/gl_test_utils.cc",
    "command_buffer/tests/gl_test_utils.h",
    "command_buffer/tests/gl_tests_main.cc",
    "command_buffer/tests/gl_texture_mailbox_unittest.cc",
    "command_buffer/tests/gl_texture_storage_unittest.cc",
    "command_buffer/tests/gl_unittest.cc",
    "command_buffer/tests/gl_unittests_android.cc",
    "command_buffer/tests/gl_virtual_contexts_unittest.cc",
    "command_buffer/tests/occlusion_query_unittest.cc",
  ]

  defines = [ "GL_GLEXT_PROTOTYPES" ]

  configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]

  deps = [
    ":gpu",
    ":test_support",
    "//base",
    "//base/test:test_support",
    "//base/third_party/dynamic_annotations",
    "//gpu/command_buffer/client:gles2_c_lib",
    "//gpu/command_buffer/client:gles2_implementation",
    "//gpu/command_buffer/common:gles2_utils",
    "//testing/gmock",
    "//testing/gtest",
    "//third_party/angle:translator",
    "//ui/gfx",
    "//ui/gfx:test_support",
    "//ui/gfx/geometry",
    "//ui/gl",
  ]

  libs = []

  if (is_android) {
    libs += [ "android" ]
    deps += [ "//ui/android:ui_java" ]
  }
}

test("gpu_unittests") {
  sources = [
    "command_buffer/client/buffer_tracker_unittest.cc",
    "command_buffer/client/client_test_helper.cc",
    "command_buffer/client/client_test_helper.h",
    "command_buffer/client/cmd_buffer_helper_test.cc",
    "command_buffer/client/fenced_allocator_test.cc",
    "command_buffer/client/gles2_implementation_unittest.cc",
    "command_buffer/client/mapped_memory_unittest.cc",
    "command_buffer/client/program_info_manager_unittest.cc",
    "command_buffer/client/query_tracker_unittest.cc",
    "command_buffer/client/ring_buffer_test.cc",
    "command_buffer/client/transfer_buffer_unittest.cc",
    "command_buffer/client/vertex_array_object_manager_unittest.cc",
    "command_buffer/common/bitfield_helpers_test.cc",
    "command_buffer/common/command_buffer_mock.cc",
    "command_buffer/common/command_buffer_mock.h",
    "command_buffer/common/command_buffer_shared_test.cc",
    "command_buffer/common/debug_marker_manager_unittest.cc",
    "command_buffer/common/gles2_cmd_format_test.cc",
    "command_buffer/common/gles2_cmd_format_test_autogen.h",
    "command_buffer/common/gles2_cmd_utils_unittest.cc",
    "command_buffer/common/id_allocator_test.cc",
    "command_buffer/common/id_type_unittest.cc",
    "command_buffer/common/unittest_main.cc",
    "command_buffer/service/buffer_manager_unittest.cc",
    "command_buffer/service/cmd_parser_test.cc",
    "command_buffer/service/command_buffer_service_unittest.cc",
    "command_buffer/service/command_executor_unittest.cc",
    "command_buffer/service/common_decoder_unittest.cc",
    "command_buffer/service/context_group_unittest.cc",
    "command_buffer/service/context_state_unittest.cc",
    "command_buffer/service/feature_info_unittest.cc",
    "command_buffer/service/framebuffer_manager_unittest.cc",
    "command_buffer/service/gl_context_mock.cc",
    "command_buffer/service/gl_context_mock.h",
    "command_buffer/service/gl_surface_mock.cc",
    "command_buffer/service/gl_surface_mock.h",
    "command_buffer/service/gles2_cmd_decoder_unittest.cc",
    "command_buffer/service/gles2_cmd_decoder_unittest.h",
    "command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h",
    "command_buffer/service/gles2_cmd_decoder_unittest_1.cc",
    "command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h",
    "command_buffer/service/gles2_cmd_decoder_unittest_2.cc",
    "command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h",
    "command_buffer/service/gles2_cmd_decoder_unittest_3.cc",
    "command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h",
    "command_buffer/service/gles2_cmd_decoder_unittest_attribs.cc",
    "command_buffer/service/gles2_cmd_decoder_unittest_base.cc",
    "command_buffer/service/gles2_cmd_decoder_unittest_base.h",
    "command_buffer/service/gles2_cmd_decoder_unittest_buffers.cc",
    "command_buffer/service/gles2_cmd_decoder_unittest_context_lost.cc",
    "command_buffer/service/gles2_cmd_decoder_unittest_context_state.cc",
    "command_buffer/service/gles2_cmd_decoder_unittest_drawing.cc",
    "command_buffer/service/gles2_cmd_decoder_unittest_extensions.cc",
    "command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc",
    "command_buffer/service/gles2_cmd_decoder_unittest_programs.cc",
    "command_buffer/service/gles2_cmd_decoder_unittest_textures.cc",
    "command_buffer/service/gles2_cmd_decoder_unittest_valuebuffer.cc",
    "command_buffer/service/gpu_service_test.cc",
    "command_buffer/service/gpu_service_test.h",
    "command_buffer/service/gpu_tracer_unittest.cc",
    "command_buffer/service/id_manager_unittest.cc",
    "command_buffer/service/mailbox_manager_unittest.cc",
    "command_buffer/service/memory_program_cache_unittest.cc",
    "command_buffer/service/mocks.cc",
    "command_buffer/service/mocks.h",
    "command_buffer/service/path_manager_unittest.cc",
    "command_buffer/service/program_cache_unittest.cc",
    "command_buffer/service/program_manager_unittest.cc",
    "command_buffer/service/query_manager_unittest.cc",
    "command_buffer/service/renderbuffer_manager_unittest.cc",
    "command_buffer/service/shader_manager_unittest.cc",
    "command_buffer/service/shader_translator_cache_unittest.cc",
    "command_buffer/service/shader_translator_unittest.cc",
    "command_buffer/service/sync_point_manager_unittest.cc",
    "command_buffer/service/test_helper.cc",
    "command_buffer/service/test_helper.h",
    "command_buffer/service/texture_manager_unittest.cc",
    "command_buffer/service/transfer_buffer_manager_unittest.cc",
    "command_buffer/service/valuebuffer_manager_unittest.cc",
    "command_buffer/service/vertex_array_manager_unittest.cc",
    "command_buffer/service/vertex_attrib_manager_unittest.cc",
    "config/gpu_blacklist_unittest.cc",
    "config/gpu_control_list_entry_unittest.cc",
    "config/gpu_control_list_number_info_unittest.cc",
    "config/gpu_control_list_os_info_unittest.cc",
    "config/gpu_control_list_unittest.cc",
    "config/gpu_control_list_version_info_unittest.cc",
    "config/gpu_driver_bug_list_unittest.cc",
    "config/gpu_info_collector_unittest.cc",
    "config/gpu_info_unittest.cc",
    "config/gpu_test_config_unittest.cc",
    "config/gpu_test_expectations_parser_unittest.cc",
    "config/gpu_util_unittest.cc",
  ]

  configs += [
    "//build/config:precompiled_headers",

    # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
    "//build/config/compiler:no_size_t_to_int_warning",
  ]

  deps = [
    ":gpu",
    ":test_support",
    "//base",
    "//base/test:test_support",
    "//base/third_party/dynamic_annotations",
    "//gpu/command_buffer/client:gles2_c_lib",
    "//gpu/command_buffer/client:gles2_implementation",
    "//gpu/command_buffer/common:gles2_utils",
    "//testing/gmock",
    "//testing/gtest",
    "//third_party/angle:translator",
    "//ui/gfx",
    "//ui/gfx:test_support",
    "//ui/gfx/geometry",
    "//ui/gl",
    "//ui/gl:gl_unittest_utils",
    "//ui/gl:test_support",
  ]
}

test("gpu_perftests") {
  sources = [
    "perftests/measurements.cc",
    "perftests/run_all_tests.cc",
    "perftests/texture_upload_perftest.cc",
  ]

  deps = [
    "//base",
    "//base/test:test_support",
    "//gpu/command_buffer/service",
    "//testing/gmock",
    "//testing/gtest",
    "//testing/perf",
    "//ui/gfx/geometry",
    "//ui/gl",
  ]
}