x11: Use scoped_ptr<> for X11 objects where it makes sense.
[chromium-blink-merge.git] / ui / compositor / BUILD.gn
blobdcc4782bec95615832760593d9f28297026031aa
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/ui.gni")
6 import("//testing/test.gni")
8 component("compositor") {
9   sources = [
10     "closure_animation_observer.cc",
11     "closure_animation_observer.h",
12     "compositor.cc",
13     "compositor.h",
14     "compositor_animation_observer.h",
15     "compositor_export.h",
16     "compositor_observer.h",
17     "compositor_switches.cc",
18     "compositor_switches.h",
19     "compositor_vsync_manager.cc",
20     "compositor_vsync_manager.h",
21     "debug_utils.cc",
22     "debug_utils.h",
23     "dip_util.cc",
24     "dip_util.h",
25     "float_animation_curve_adapter.cc",
26     "float_animation_curve_adapter.h",
27     "layer.cc",
28     "layer.h",
29     "layer_animation_delegate.h",
30     "layer_animation_element.cc",
31     "layer_animation_element.h",
32     "layer_animation_observer.cc",
33     "layer_animation_observer.h",
34     "layer_animation_sequence.cc",
35     "layer_animation_sequence.h",
36     "layer_animator.cc",
37     "layer_animator.h",
38     "layer_animator_collection.cc",
39     "layer_animator_collection.h",
40     "layer_delegate.h",
41     "layer_owner.cc",
42     "layer_owner.h",
43     "layer_tree_owner.cc",
44     "layer_tree_owner.h",
45     "layer_type.h",
46     "reflector.cc",
47     "reflector.h",
48     "scoped_animation_duration_scale_mode.cc",
49     "scoped_animation_duration_scale_mode.h",
50     "scoped_layer_animation_settings.cc",
51     "scoped_layer_animation_settings.h",
52     "transform_animation_curve_adapter.cc",
53     "transform_animation_curve_adapter.h",
54   ]
56   defines = [ "COMPOSITOR_IMPLEMENTATION" ]
58   deps = [
59     "//base",
60     "//base/third_party/dynamic_annotations",
61     "//cc",
62     "//cc/surfaces",
63     "//cc/surfaces:surface_id",
64     "//gpu/command_buffer/common",
65     "//skia",
66     "//ui/gfx",
67     "//ui/gfx/geometry",
68     "//ui/gl",
69   ]
71   if (is_win && use_aura) {
72     # TODO(sky): before we make this real need to remove
73     # IDR_BITMAP_BRUSH_IMAGE.
74     deps += [
75       "//ui/resources",
76       "//third_party/angle:libEGL",
77       "//third_party/angle:libGLESv2",
78     ]
79   }
82 source_set("test_support") {
83   testonly = true
84   sources = [
85     "test/context_factories_for_test.cc",
86     "test/context_factories_for_test.h",
87     "test/draw_waiter_for_test.cc",
88     "test/draw_waiter_for_test.h",
89     "test/in_process_context_factory.cc",
90     "test/in_process_context_factory.h",
91     "test/in_process_context_provider.cc",
92     "test/in_process_context_provider.h",
93     "test/layer_animator_test_controller.cc",
94     "test/layer_animator_test_controller.h",
95     "test/test_compositor_host.h",
96     "test/test_compositor_host_mac.mm",
97     "test/test_compositor_host_win.cc",
98     "test/test_layer_animation_delegate.cc",
99     "test/test_layer_animation_delegate.h",
100     "test/test_layer_animation_observer.cc",
101     "test/test_layer_animation_observer.h",
102     "test/test_layers.cc",
103     "test/test_layers.h",
104     "test/test_suite.cc",
105     "test/test_suite.h",
106     "test/test_utils.cc",
107     "test/test_utils.h",
108   ]
110   public_deps = [
111     ":compositor",
112   ]
113   deps = [
114     "//base/test:test_support",
115     "//cc",
116     "//cc/surfaces",
117     "//cc:test_support",
118     "//gpu/command_buffer/client:gl_in_process_context",
119     "//gpu/command_buffer/client:gles2_c_lib",
120     "//gpu/command_buffer/client:gles2_implementation",
121     "//gpu/command_buffer/common:gles2_utils",
122     "//gpu/skia_bindings",
123     "//skia",
124     "//testing/gtest",
125     "//third_party/WebKit/public:blink_minimal",
126     "//ui/base",
127     "//ui/gfx",
128     "//ui/gfx/geometry",
129     "//ui/gl",
130   ]
132   if (use_x11) {
133     configs += [ "//build/config/linux:x11" ]
134     deps += [ "//ui/gfx/x" ]
135   }
137   if (use_ozone) {
138     sources += [ "test/test_compositor_host_ozone.cc" ]
139   } else if (use_x11) {
140     sources += [ "test/test_compositor_host_x11.cc" ]
141   }
144 if (!is_android) {
145   test("compositor_unittests") {
146     sources = [
147       "layer_animation_element_unittest.cc",
148       "layer_animation_sequence_unittest.cc",
149       "layer_animator_unittest.cc",
150       "layer_owner_unittest.cc",
151       "layer_unittest.cc",
152       "run_all_unittests.cc",
153       "transform_animation_curve_adapter_unittest.cc",
154     ]
156     deps = [
157       ":compositor",
158       ":test_support",
159       "//base",
160       "//base/allocator",
161       "//base/test:test_support",
162       "//cc",
163       "//cc:test_support",
164       "//skia",
165       "//testing/gtest",
166       "//ui/base",
167       "//ui/gfx",
168       "//ui/gfx/geometry",
169       "//ui/gl",
170       "//ui/resources",
171     ]
173     if (is_linux) {
174       deps += [ "//third_party/mesa:osmesa" ]
175     }
176   }