Don't preload rarely seen large images
[chromium-blink-merge.git] / gpu / gles2_conform_support / BUILD.gn
blobc91ecb317950c7060bd74d5ae84d84d4c82edea1
1 # Copyright 2015 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/allocator.gni")
6 import("//testing/test.gni")
8 # GYP version: gpu/gles2_conform_support/gles2_conform_support.gyp:gles2_conform_support
9 executable("gles2_conform_support") {
10   sources = [
11     "gles2_conform_support.c",
12     "native/egl_native.cc",
13     "native/egl_native_win.cc",
14     "native/main.cc",
15   ]
16   defines = [
17     "GLES2_CONFORM_SUPPORT_ONLY",
18     "GTF_GLES20",
19     "EGLAPI=",
20     "EGLAPIENTRY=",
21   ]
22   deps = [
23     "//base",
24     "//gpu/gles2_conform_support/egl",
25     "//base/third_party/dynamic_annotations",
26     "//ui/gl",
27     "//gpu/command_buffer/client:gles2_c_lib_nocheck",
28   ]
29   if (is_linux) {
30     sources += [
31       "native/egl_native_aura.cc",
32       "native/egl_native_x11.cc",
33     ]
34   }
35   if (use_allocator != "none") {
36     # See http://crbug.com/162998#c4 for why this is needed.
37     deps += [ "//base/allocator" ]
38   }
41 if (internal_gles2_conform_tests) {
42   action("generate_gles2_conform_embedded_data") {
43     script = "generate_gles2_embedded_data.py"
44     output = [
45       "$target_gen_dir/gles2_conform_test_embedded_data/FilesData.c",
46       "$target_gen_dir/gles2_conform_test_embedded_data/FilesData.h",
47       "$target_gen_dir/gles2_conform_test_embedded_data/FilesTOC.c",
48     ]
49     args = [
50       "../../third_party/gles2_conform/GTF_ES/glsl/GTF",
51       "$target_gen_dir/gles2_conform_test_embedded_data",
52     ]
53   }
54   gles2_conform_gypi = exec_script("//build/gypi_to_gn.py",
55                                    [ rebase_path("gles2_conform_gypi") ],
56                                    "scoped",
57                                    [ "gles2_conform_gypi" ])
58   executable("gles2_conform_test_windowless") {
59     testonly = true
60     sources = [
61       # Include a dummy c++ file to force linking of libstdc++.
62       "dummy.cc",
63       gles2_conform_gypi.gtf_es_sources,
64     ]
65     defines = [
66       "GTF_API=GTF_GLES20",
67       "HKEMBEDDEDFILESYSTEM",
68     ]
69     deps = [
70       ":generate_gles2_conform_embedded_data",
71       "//gpu/gles2_conform_support/egl",
72       "//gpu/gles2_conform_support/native:windowless",
73       "//gpu/command_buffer/client:gles2_c_libnocheck",
74     ]
75     if (is_linux) {
76       if (!is_chromeos) {
77         deps += [ "//build/linux/system/gtk" ]
79         if (is_clang) {
80           cflags = [
81             "-Wno-array-bounds",
82             "-Wno-implicit-function-declaration",
83             "-Wno-incompatible-pointer-types",
84             "-Wno-parentheses-equality",
85             "-Wno-pointer-sign",
86             "-Wno-return-type",
87             "-Wno-sizeof-pointer-memaccess",
88             "-Wno-tautological-compare",
89           ]
90         }
91       }
92     }
93     if (is_win) {
94       deps += [
95         "//third_party/angle:libEGL",
96         "//third_party/angle:libGLESv2",
97       ]
98       defines = [
99         "EGLAPI=",
100         "EGLAPIENTRY=",
101       ]
102       defines -= [ "NOMINMAX" ]
103       cflags = [
104         "/wd4018",  # signed/unsigned mismatch
105         "/wd4101",  # unreferenced local variable
106         "/wd4715",  # not all control paths return a value
107         "/wd4267",  # size_t/unsigned int conversion
108       ]
109     }
110     if (is_mac) {
111       defines = [
112         "_STDINT",
113         "_STDINT_H",
114       ]
115       if (is_clang) {
116         cflags = [
117           "-Wno-pointer-sign",
118           "-Wno-array-bounds",
119           "-Wno-sizeof-pointer-memaccess",
120           "-Wno-implicit-function-declaration",
121           "-Wno-logical-op-parentheses",
122           "-Wno-tautological-compare",
123           "-Wno-parentheses-equality",
124           "-Wno-return-type",
125         ]
126         #"xcode_settings": {
127         #"LD": "clang++",
128         #"WARNING_CFLAGS": [
129         #"-Wno-pointer-sign",
130         #"-Wno-array-bounds",
131         #"-Wno-sizeof-pointer-memaccess",
132         #"-Wno-implicit-function-declaration",
133         #"-Wno-logical-op-parentheses",
134         #"-Wno-tautological-compare",
135         #"-Wno-parentheses-equality",
136         #"-Wno-return-type",
137         #],
138         #},
139       }
140     }
142     #'run_as': {
143     #     'conditions': [
144     #       ['OS=="win"', {
145     #         'action': [
146     #           '$(TargetPath)',
147     #           '-noimagefileio',
148     #           '-run=<(DEPTH)/third_party/gles2_conform/GTF_ES/glsl/GTF/mustpass.run',
149     #         ],
150     #       }],
151     #     ],
152     #    },
153   }
156 test("gles2_conform_test") {
157   sources = [
158     "gles2_conform_test.cc",
159   ]
160   deps = [
161     "//base",
162     "//gpu/config",
163     "//testing/gtest",
164   ]
165   if (internal_gles2_conform_tests) {
166     deps += [ "gles2_conform_test_windowless" ]
167   }