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.
4
5import("//build/config/ui.gni")
6
7component("compositor") {
8  sources = [
9    "closure_animation_observer.cc",
10    "closure_animation_observer.h",
11    "compositor.cc",
12    "compositor.h",
13    "compositor_animation_observer.h",
14    "compositor_export.h",
15    "compositor_observer.cc",
16    "compositor_observer.h",
17    "compositor_vsync_manager.cc",
18    "compositor_vsync_manager.h",
19    "compositor_switches.cc",
20    "compositor_switches.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.h",
47    "scoped_animation_duration_scale_mode.cc",
48    "scoped_animation_duration_scale_mode.h",
49    "scoped_layer_animation_settings.cc",
50    "scoped_layer_animation_settings.h",
51    "transform_animation_curve_adapter.cc",
52    "transform_animation_curve_adapter.h",
53  ]
54
55  defines = [ "COMPOSITOR_IMPLEMENTATION" ]
56
57  deps = [
58    "//base",
59    "//base/third_party/dynamic_annotations",
60    "//cc",
61    "//cc/surfaces",
62    "//gpu/command_buffer/common",
63    "//skia",
64    "//ui/gfx",
65    "//ui/gfx/geometry",
66    "//ui/gl",
67  ]
68
69  if (is_win && use_aura) {
70    # TODO(sky): before we make this real need to remove
71    # IDR_BITMAP_BRUSH_IMAGE.
72    deps += [
73      "//ui/resources",
74      "//third_party/angle:libEGL",
75      "//third_party/angle:libGLESv2",
76    ]
77  }
78}
79
80source_set("test_support") {
81  testonly = true
82  sources = [
83    "test/context_factories_for_test.cc",
84    "test/context_factories_for_test.h",
85    "test/draw_waiter_for_test.cc",
86    "test/draw_waiter_for_test.h",
87    "test/in_process_context_factory.cc",
88    "test/in_process_context_factory.h",
89    "test/layer_animator_test_controller.cc",
90    "test/layer_animator_test_controller.h",
91    "test/test_compositor_host.h",
92    "test/test_compositor_host_mac.mm",
93    "test/test_compositor_host_win.cc",
94    "test/test_layer_animation_delegate.cc",
95    "test/test_layer_animation_delegate.h",
96    "test/test_layer_animation_observer.cc",
97    "test/test_layer_animation_observer.h",
98    "test/test_layers.cc",
99    "test/test_layers.h",
100    "test/test_suite.cc",
101    "test/test_suite.h",
102    "test/test_utils.cc",
103    "test/test_utils.h",
104  ]
105
106  public_deps = [
107    ":compositor",
108  ]
109  deps = [
110    "//base/test:test_support",
111    "//cc",
112    "//cc:test_support",
113    "//skia",
114    "//testing/gtest",
115    "//third_party/WebKit/public:blink_minimal",
116    "//ui/base",
117    "//ui/gfx",
118    "//ui/gfx/geometry",
119    "//ui/gl",
120    "//webkit/common/gpu",
121  ]
122
123  if (use_x11) {
124    configs += [ "//build/config/linux:x11" ]
125    deps += [ "//ui/gfx/x" ]
126  }
127
128  if (use_ozone) {
129    sources += [ "test/test_compositor_host_ozone.cc" ]
130  } else if (use_x11) {
131    sources += [ "test/test_compositor_host_x11.cc" ]
132  }
133}
134
135# TODO(GYP) enable this when all dependencies are complete and it links.
136#test("compositor_unittests") {
137#  sources = [
138#    "layer_animation_element_unittest.cc",
139#    "layer_animation_sequence_unittest.cc",
140#    "layer_animator_unittest.cc",
141#    "layer_owner_unittest.cc",
142#    "layer_unittest.cc",
143#    "run_all_unittests.cc",
144#    "transform_animation_curve_adapter_unittest.cc",
145#  ]
146#
147#  deps = [
148#    ":compositor",
149#    ":test_support",
150#    "//base",
151#    "//base/allocator",
152#    "//base/test:test_support",
153#    "//cc",
154#    "//cc:test_support",
155#    "//skia",
156#    "//testing/gtest",
157#    "//ui/base",
158#    "//ui/gfx",
159#    "//ui/gfx/geometry",
160#    "//ui/gl",
161#    "//ui/resources",
162#  ]
163#
164#  if (is_linux) {
165#    deps += [ "//third_party/mesa:osmesa" ]
166#  }
167#}
168