Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / ui / ozone / platform / drm / BUILD.gn
blob42d8cc7de4e9b36efbf035c396f00464b722e0d1
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.
5 import("//build/config/linux/pkg_config.gni")
6 import("//ui/ozone/ozone.gni")
8 declare_args() {
9   use_mesa_platform_null = false
10   use_drm_atomic = false
13 pkg_config("libdrm") {
14   packages = [ "libdrm" ]
17 source_set("drm_common") {
18   sources = [
19     "common/drm_util.cc",
20     "common/drm_util.h",
21     "common/scoped_drm_types.cc",
22     "common/scoped_drm_types.h",
23     "gpu/crtc_controller.cc",
24     "gpu/crtc_controller.h",
25     "gpu/display_change_observer.h",
26     "gpu/drm_buffer.cc",
27     "gpu/drm_buffer.h",
28     "gpu/drm_console_buffer.cc",
29     "gpu/drm_console_buffer.h",
30     "gpu/drm_device.cc",
31     "gpu/drm_device.h",
32     "gpu/drm_device_generator.cc",
33     "gpu/drm_device_generator.h",
34     "gpu/drm_device_manager.cc",
35     "gpu/drm_device_manager.h",
36     "gpu/drm_display.cc",
37     "gpu/drm_display.h",
38     "gpu/drm_gpu_display_manager.cc",
39     "gpu/drm_gpu_display_manager.h",
40     "gpu/drm_gpu_platform_support.cc",
41     "gpu/drm_gpu_platform_support.h",
42     "gpu/drm_surface.cc",
43     "gpu/drm_surface.h",
44     "gpu/drm_surface_factory.cc",
45     "gpu/drm_surface_factory.h",
46     "gpu/drm_vsync_provider.cc",
47     "gpu/drm_vsync_provider.h",
48     "gpu/drm_window.cc",
49     "gpu/drm_window.h",
50     "gpu/hardware_display_controller.cc",
51     "gpu/hardware_display_controller.h",
52     "gpu/hardware_display_plane.cc",
53     "gpu/hardware_display_plane.h",
54     "gpu/hardware_display_plane_manager.cc",
55     "gpu/hardware_display_plane_manager.h",
56     "gpu/hardware_display_plane_manager_legacy.cc",
57     "gpu/hardware_display_plane_manager_legacy.h",
58     "gpu/overlay_plane.cc",
59     "gpu/overlay_plane.h",
60     "gpu/page_flip_request.cc",
61     "gpu/page_flip_request.h",
62     "gpu/scanout_buffer.h",
63     "gpu/screen_manager.cc",
64     "gpu/screen_manager.h",
65     "host/channel_observer.h",
66     "host/drm_cursor.cc",
67     "host/drm_cursor.h",
68     "host/drm_device_handle.cc",
69     "host/drm_device_handle.h",
70     "host/drm_display_host.cc",
71     "host/drm_display_host.h",
72     "host/drm_display_host_manager.cc",
73     "host/drm_display_host_manager.h",
74     "host/drm_gpu_platform_support_host.cc",
75     "host/drm_gpu_platform_support_host.h",
76     "host/drm_native_display_delegate.cc",
77     "host/drm_native_display_delegate.h",
78     "host/drm_overlay_candidates_host.cc",
79     "host/drm_overlay_candidates_host.h",
80     "host/drm_overlay_manager.cc",
81     "host/drm_overlay_manager.h",
82     "host/drm_window_host.cc",
83     "host/drm_window_host.h",
84     "host/drm_window_host_manager.cc",
85     "host/drm_window_host_manager.h",
86   ]
88   defines = [ "OZONE_IMPLEMENTATION" ]
90   if (use_drm_atomic) {
91     defines += [ "USE_DRM_ATOMIC" ]
92     sources += [
93       "gpu/hardware_display_plane_atomic.cc",
94       "gpu/hardware_display_plane_atomic.h",
95       "gpu/hardware_display_plane_manager_atomic.cc",
96       "gpu/hardware_display_plane_manager_atomic.h",
97     ]
98   }
100   deps = [
101     "//base",
102     "//skia",
103     "//ipc",
104     "//ui/base",
105     "//ui/display/types",
106     "//ui/display/util",
107     "//ui/events",
108     "//ui/events/devices",
109     "//ui/events/ozone:events_ozone_evdev",
110     "//ui/events/ozone:events_ozone_layout",
111     "//ui/events/platform",
112     "//ui/gfx",
113     "//ui/gfx/geometry",
114   ]
116   public_configs = [ ":libdrm" ]
119 if (ozone_platform_drm) {
120   source_set("drm") {
121     sources = [
122       "ozone_platform_drm.cc",
123       "ozone_platform_drm.h",
124     ]
126     deps = [
127       ":drm_common",
128       "//base",
129       "//skia",
130       "//ui/events/ozone:events_ozone_evdev",
131       "//ui/events/ozone:events_ozone_layout",
132     ]
133   }
135   source_set("drm_unittests") {
136     testonly = true
137     sources = [
138       "gpu/drm_surface_unittest.cc",
139       "gpu/drm_window_unittest.cc",
140       "gpu/hardware_display_controller_unittest.cc",
141       "gpu/hardware_display_plane_manager_unittest.cc",
142       "gpu/screen_manager_unittest.cc",
143       "test/mock_drm_device.cc",
144       "test/mock_drm_device.h",
145     ]
147     deps = [
148       "//skia",
149       "//testing/gtest",
150       "//ui/ozone",
151     ]
153     public_configs = [ ":libdrm" ]
154   }
157 if (ozone_platform_gbm) {
158   pkg_config("libgbm") {
159     packages = [ "gbm" ]
160   }
162   source_set("gbm") {
163     sources = [
164       "gpu/gbm_buffer.cc",
165       "gpu/gbm_buffer.h",
166       "gpu/gbm_buffer_base.cc",
167       "gpu/gbm_buffer_base.h",
168       "gpu/gbm_device.cc",
169       "gpu/gbm_device.h",
170       "gpu/gbm_surface.cc",
171       "gpu/gbm_surface.h",
172       "gpu/gbm_surface_factory.cc",
173       "gpu/gbm_surface_factory.h",
174       "gpu/gbm_surfaceless.cc",
175       "gpu/gbm_surfaceless.h",
176       "ozone_platform_gbm.cc",
177       "ozone_platform_gbm.h",
178     ]
180     deps = [
181       ":drm_common",
182       "//base",
183       "//skia",
184       "//ui/events/ozone:events_ozone_evdev",
185       "//ui/events/ozone:events_ozone_layout",
186     ]
188     public_configs = [
189       ":libgbm",
190       "//third_party/khronos:khronos_headers",
191     ]
193     if (use_mesa_platform_null) {
194       defines += [ "USE_MESA_PLATFORM_NULL" ]
195     }
196   }