summaryrefslogtreecommitdiff
path: root/chromium/gpu/ipc/service/BUILD.gn
blob: c85062b8d7cc68abcbe6ee4f254486defca63e09 (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
# Copyright 2016 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.

import("//testing/test.gni")
import("//build/config/ui.gni")
if (is_mac) {
  import("//build/config/mac/mac_sdk.gni")
}

group("service") {
  if (is_component_build) {
    public_deps = [
      "//gpu",
    ]
  } else {
    public_deps = [
      ":ipc_service_sources",
    ]
  }
}

if (is_component_build) {
  link_target_type = "source_set"
} else {
  link_target_type = "static_library"
}
target(link_target_type, "ipc_service_sources") {
  visibility = [ "//gpu/*" ]
  sources = [
    "gpu_channel.cc",
    "gpu_channel.h",
    "gpu_channel_manager.cc",
    "gpu_channel_manager.h",
    "gpu_channel_manager_delegate.h",
    "gpu_command_buffer_stub.cc",
    "gpu_command_buffer_stub.h",
    "gpu_config.h",
    "gpu_init.cc",
    "gpu_init.h",
    "gpu_memory_buffer_factory.cc",
    "gpu_memory_buffer_factory.h",
    "gpu_memory_manager.cc",
    "gpu_memory_manager.h",
    "gpu_memory_tracking.cc",
    "gpu_memory_tracking.h",
    "gpu_vsync_provider_win.cc",
    "gpu_vsync_provider_win.h",
    "gpu_watchdog_thread.cc",
    "gpu_watchdog_thread.h",
    "image_transport_surface.h",
    "image_transport_surface_delegate.cc",
    "image_transport_surface_delegate.h",
    "pass_through_image_transport_surface.cc",
    "pass_through_image_transport_surface.h",
    "switches.cc",
    "switches.h",
  ]
  configs += [ "//gpu:gpu_implementation" ]
  public_deps = [
    "//base",
    "//ipc",
    "//ui/base",
    "//ui/events:events_base",
    "//ui/gfx",
    "//ui/gfx/geometry",
    "//ui/gl",
    "//ui/gl/init",
    "//url",
  ]
  deps = [
    "//base/third_party/dynamic_annotations",
    "//gpu/command_buffer/common:common_sources",
    "//gpu/command_buffer/service:service_sources",
    "//gpu/config:config_sources",
    "//gpu/ipc/common:ipc_common_sources",
  ]
  libs = []
  if (is_win) {
    sources += [
      "child_window_surface_win.cc",
      "child_window_surface_win.h",
      "child_window_win.cc",
      "child_window_win.h",
      "direct_composition_surface_win.cc",
      "direct_composition_surface_win.h",
      "image_transport_surface_win.cc",
    ]
  }
  if (is_mac) {
    sources += [
      "gpu_memory_buffer_factory_io_surface.cc",
      "gpu_memory_buffer_factory_io_surface.h",
      "image_transport_surface_mac.mm",
      "image_transport_surface_overlay_mac.h",
      "image_transport_surface_overlay_mac.mm",
    ]
    deps += [ "//ui/accelerated_widget_mac" ]
    lib_dirs = [ "$mac_sdk_path/usr/lib" ]
    libs += [
      "QuartzCore.framework",
      "CoreGraphics.framework",
    ]
  }
  if (is_android) {
    sources += [
      "image_transport_surface_android.cc",
      "stream_texture_android.cc",
      "stream_texture_android.h",
    ]
    libs += [ "android" ]
  }
  if (is_linux && ui_compositor_image_transport) {
    sources += [ "image_transport_surface_linux.cc" ]
  }
  if (use_x11) {
    sources += [ "x_util.h" ]
  }
  if (use_ozone) {
    sources += [
      "gpu_memory_buffer_factory_ozone_native_pixmap.cc",
      "gpu_memory_buffer_factory_ozone_native_pixmap.h",
    ]
    deps += [ "//ui/ozone" ]
  }
}

source_set("test_support") {
  testonly = true
  sources = [
    "gpu_memory_buffer_factory_test_template.h",
  ]
  public_deps = [
    ":service",
    "//testing/gtest:gtest",
  ]
  deps = [
    "//gpu/ipc/common",
  ]
}

test("gpu_ipc_service_unittests") {
  configs += [ "//build/config:precompiled_headers" ]
  sources = [
    "gpu_channel_manager_unittest.cc",
    "gpu_channel_test_common.cc",
    "gpu_channel_test_common.h",
    "gpu_channel_unittest.cc",
    "gpu_vsync_provider_unittest_win.cc",
  ]
  deps = [
    ":service",
    ":test_support",
    "//base",
    "//base/test:test_support",
    "//gpu:test_support",
    "//gpu/command_buffer/common",
    "//gpu/command_buffer/common:gles2_utils",
    "//gpu/command_buffer/service",
    "//gpu/config",
    "//gpu/ipc/common",
    "//ipc:run_all_unittests",
    "//ipc:test_support",
    "//skia",
    "//testing/gmock",
    "//testing/gtest",
    "//third_party/mesa:mesa_headers",
    "//ui/gfx:test_support",
    "//ui/gl:gl_unittest_utils",
    "//ui/gl:test_support",
    "//url",
  ]
  libs = []
  if (is_android) {
    deps += [ "//ui/android:ui_java" ]
  }
  if (is_mac) {
    sources += [ "gpu_memory_buffer_factory_io_surface_unittest.cc" ]
  }
  if (use_ozone) {
    sources += [ "gpu_memory_buffer_factory_ozone_native_pixmap_unittest.cc" ]
    deps += [ "//ui/ozone" ]
  }
}