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("snapshot") {
8  sources = [
9    "snapshot.h",
10    "snapshot_android.cc",
11    "snapshot_async.cc",
12    "snapshot_async.h",
13    "snapshot_aura.cc",
14    "snapshot_export.h",
15    "snapshot_ios.mm",
16    "snapshot_mac.mm",
17    "snapshot_win.cc",
18    "snapshot_win.h",
19  ]
20
21  defines = [ "SNAPSHOT_IMPLEMENTATION" ]
22
23  deps = [
24    "//base",
25    "//skia",
26    "//ui/base",
27    "//ui/gfx",
28    "//ui/gfx/geometry",
29  ]
30
31  if (use_aura || is_android) {
32    deps += [
33      "//cc",
34      "//gpu/command_buffer/common",
35    ]
36  } else {
37    sources -= [
38      "snapshot_async.cc",
39      "snapshot_async.h",
40    ]
41  }
42
43  if (use_aura) {
44    deps += [
45      "//ui/aura",
46      "//ui/compositor",
47    ]
48  } else {
49    sources -= [
50      "snapshot_aura.cc"
51    ]
52  }
53}
54
55test("snapshot_unittests") {
56  sources = [
57    "snapshot_aura_unittest.cc",
58    "snapshot_mac_unittest.mm",
59    "test/run_all_unittests.cc",
60  ]
61
62  deps = [
63    ":snapshot",
64    "//base",
65    "//base/allocator",
66    "//base/test:test_support",
67    "//skia",
68    "//testing/gtest",
69    "//ui/base",
70    "//ui/gfx",
71    "//ui/gfx/geometry",
72    "//ui/gl",
73  ]
74
75  if (use_aura) {
76    deps += [
77      "//ui/aura:test_support",
78      "//ui/compositor",
79      "//ui/compositor:test_support",
80      "//ui/wm",
81    ]
82  } else {
83    sources -= [ "snapshot_aura_unittest.cc" ]
84  }
85}
86
87if (is_win) {
88  source_set("test_support") {
89    sources = [
90      "test/snapshot_desktop.h",
91      "test/snapshot_desktop_win.cc",
92    ]
93    deps = [
94      ":snapshot",
95    ]
96  }
97}
98