OLD | NEW |
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 enable_printing = true # TODO(brettw) pass this feature flag in somehow. | 5 enable_printing = true # TODO(brettw) pass this feature flag in somehow. |
6 skia_support_gpu = !is_ios | 6 skia_support_gpu = !is_ios |
7 skia_support_pdf = !is_ios && enable_printing | 7 skia_support_pdf = !is_ios && enable_printing |
8 | 8 |
9 # External-facing config for dependent code. | 9 # External-facing config for dependent code. |
10 config("skia_config") { | 10 config("skia_config") { |
(...skipping 20 matching lines...) Expand all Loading... |
31 defines = [ | 31 defines = [ |
32 "SK_ENABLE_INST_COUNT=0", | 32 "SK_ENABLE_INST_COUNT=0", |
33 "GR_GL_CUSTOM_SETUP_HEADER=\"GrGLConfig_chrome.h\"", | 33 "GR_GL_CUSTOM_SETUP_HEADER=\"GrGLConfig_chrome.h\"", |
34 ] | 34 ] |
35 | 35 |
36 if (skia_support_gpu) { | 36 if (skia_support_gpu) { |
37 include_dirs += [ | 37 include_dirs += [ |
38 "//third_party/skia/include/gpu", | 38 "//third_party/skia/include/gpu", |
39 "//third_party/skia/src/gpu", | 39 "//third_party/skia/src/gpu", |
40 ] | 40 ] |
41 defines += "SK_SUPPORT_GPU=1" | 41 defines += [ "SK_SUPPORT_GPU=1" ] |
42 } else { | 42 } else { |
43 defines += "SK_SUPPORT_GPU=0" | 43 defines += [ "SK_SUPPORT_GPU=0" ] |
44 } | 44 } |
45 | 45 |
46 # For POSIX platforms, prefer the Mutex implementation provided by Skia | 46 # For POSIX platforms, prefer the Mutex implementation provided by Skia |
47 # since it does not generate static initializers. | 47 # since it does not generate static initializers. |
48 if (is_posix) { | 48 if (is_posix) { |
49 defines += "SK_USE_POSIX_THREADS" | 49 defines += [ "SK_USE_POSIX_THREADS" ] |
50 } | 50 } |
51 | 51 |
52 if (is_android) { | 52 if (is_android) { |
53 defines += [ | 53 defines += [ |
54 "SK_BUILD_FOR_ANDROID", | 54 "SK_BUILD_FOR_ANDROID", |
55 "USE_CHROMIUM_SKIA", | 55 "USE_CHROMIUM_SKIA", |
56 ] | 56 ] |
57 } | 57 } |
58 } | 58 } |
59 | 59 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 "ext/skia_utils_win.cc", | 104 "ext/skia_utils_win.cc", |
105 "ext/skia_utils_win.h", | 105 "ext/skia_utils_win.h", |
106 "ext/vector_canvas.cc", | 106 "ext/vector_canvas.cc", |
107 "ext/vector_canvas.h", | 107 "ext/vector_canvas.h", |
108 "ext/vector_platform_device_emf_win.cc", | 108 "ext/vector_platform_device_emf_win.cc", |
109 "ext/vector_platform_device_emf_win.h", | 109 "ext/vector_platform_device_emf_win.h", |
110 "ext/vector_platform_device_skia.cc", | 110 "ext/vector_platform_device_skia.cc", |
111 "ext/vector_platform_device_skia.h", | 111 "ext/vector_platform_device_skia.h", |
112 ] | 112 ] |
113 if (is_posix) { | 113 if (is_posix) { |
114 skia_chrome_sources -= "ext/SkThread_chrome.cc" | 114 skia_chrome_sources -= [ "ext/SkThread_chrome.cc" ] |
115 } | 115 } |
116 if (is_ios) { | 116 if (is_ios) { |
117 skia_chrome_sources -= "ext/vector_platform_device_skia.cc" | 117 skia_chrome_sources -= [ "ext/vector_platform_device_skia.cc" ] |
118 } | 118 } |
119 if (is_win) { | 119 if (is_win) { |
120 skia_chrome_sources -= "ext/SkThread_chrome.cc" | 120 skia_chrome_sources -= [ "ext/SkThread_chrome.cc" ] |
121 } | 121 } |
122 if (is_android && !enable_printing) { | 122 if (is_android && !enable_printing) { |
123 skia_chrome_sources -= [ | 123 skia_chrome_sources -= [ |
124 "ext/skia_utils_base.cc", | 124 "ext/skia_utils_base.cc", |
125 "ext/vector_platform_device_skia.cc" | 125 "ext/vector_platform_device_skia.cc" |
126 ] | 126 ] |
127 } | 127 } |
128 | 128 |
129 # Internal-facing config for Skia library code. | 129 # Internal-facing config for Skia library code. |
130 config("skia_library_config") { | 130 config("skia_library_config") { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 } | 172 } |
173 | 173 |
174 if (is_android) { | 174 if (is_android) { |
175 defines += [ | 175 defines += [ |
176 # Android devices are typically more memory constrained, so default to a | 176 # Android devices are typically more memory constrained, so default to a |
177 # smaller glyph cache (it may be overriden at runtime when the renderer | 177 # smaller glyph cache (it may be overriden at runtime when the renderer |
178 # starts up, depending on the actual device memory). | 178 # starts up, depending on the actual device memory). |
179 "SK_DEFAULT_FONT_CACHE_LIMIT=1048576" # 1024 * 1024 | 179 "SK_DEFAULT_FONT_CACHE_LIMIT=1048576" # 1024 * 1024 |
180 ] | 180 ] |
181 } else { | 181 } else { |
182 defines += "SK_DEFAULT_FONT_CACHE_LIMIT=20971520" # 20 * 1024 * 1024 | 182 defines += [ "SK_DEFAULT_FONT_CACHE_LIMIT=20971520" ] # 20 * 1024 * 1024 |
183 } | 183 } |
184 | 184 |
185 if (is_win) { | 185 if (is_win) { |
186 include_dirs = [ | 186 include_dirs = [ |
187 "//third_party/skia/include/utils/win", | 187 "//third_party/skia/include/utils/win", |
188 "//third_party/skia/src/utils/win", | 188 "//third_party/skia/src/utils/win", |
189 ] | 189 ] |
190 | 190 |
191 defines += "SK_FONTHOST_USES_FONTMGR" | 191 defines += [ "SK_FONTHOST_USES_FONTMGR" ] |
192 | 192 |
193 cflags = [ | 193 cflags = [ |
194 # TODO(brettw) comment what these are. | 194 # TODO(brettw) comment what these are. |
195 "/wd4244", | 195 "/wd4244", |
196 "/wd4267", | 196 "/wd4267", |
197 "/wd4341", | 197 "/wd4341", |
198 "/wd4345", | 198 "/wd4345", |
199 "/wd4390", | 199 "/wd4390", |
200 "/wd4554", | 200 "/wd4554", |
201 "/wd4748", | 201 "/wd4748", |
(...skipping 913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1115 static_library("skia_library") { | 1115 static_library("skia_library") { |
1116 external = true | 1116 external = true |
1117 sources = skia_library_sources | 1117 sources = skia_library_sources |
1118 | 1118 |
1119 deps = [ | 1119 deps = [ |
1120 ":skia_opts", | 1120 ":skia_opts", |
1121 "//third_party/zlib", | 1121 "//third_party/zlib", |
1122 ] | 1122 ] |
1123 | 1123 |
1124 if (skia_support_pdf) { | 1124 if (skia_support_pdf) { |
1125 deps += "//third_party/sfntly" | 1125 deps += [ "//third_party/sfntly" ] |
1126 } else { | 1126 } else { |
1127 # TODO(brettw) remove PDF sources. | 1127 # TODO(brettw) remove PDF sources. |
1128 } | 1128 } |
1129 | 1129 |
1130 configs -= "//build/config/compiler:chromium_code" | 1130 configs -= [ "//build/config/compiler:chromium_code" ] |
1131 configs += [ | 1131 configs += [ |
1132 ":skia_config", | 1132 ":skia_config", |
1133 ":skia_library_config", | 1133 ":skia_library_config", |
1134 "//build/config/compiler:no_chromium_code" | 1134 "//build/config/compiler:no_chromium_code" |
1135 ] | 1135 ] |
1136 | 1136 |
1137 if (is_linux) { | 1137 if (is_linux) { |
1138 configs += [ | 1138 configs += [ |
1139 "//build/config/linux:fontconfig", | 1139 "//build/config/linux:fontconfig", |
1140 "//build/config/linux:freetype2", | 1140 "//build/config/linux:freetype2", |
1141 "//build/config/linux:pangocairo", | 1141 "//build/config/linux:pangocairo", |
1142 ] | 1142 ] |
1143 deps += [ | 1143 deps += [ |
1144 "//third_party/icu:icuuc", | 1144 "//third_party/icu:icuuc", |
1145 ] | 1145 ] |
1146 } | 1146 } |
1147 } | 1147 } |
1148 | 1148 |
1149 config("skia_chrome_config") { | 1149 config("skia_chrome_config") { |
1150 include_dirs = [ "ext" ] | 1150 include_dirs = [ "ext" ] |
1151 } | 1151 } |
1152 | 1152 |
1153 static_library("skia_chrome") { | 1153 static_library("skia_chrome") { |
1154 external = true | 1154 external = true |
1155 sources = skia_chrome_sources | 1155 sources = skia_chrome_sources |
1156 | 1156 |
1157 configs -= "//build/config/compiler:chromium_code" | 1157 configs -= [ "//build/config/compiler:chromium_code" ] |
1158 configs += [ | 1158 configs += [ |
1159 ":skia_config", | 1159 ":skia_config", |
1160 "//build/config/compiler:no_chromium_code", | 1160 "//build/config/compiler:no_chromium_code", |
1161 ] | 1161 ] |
1162 direct_dependent_configs = [ ":skia_chrome_config" ] | 1162 direct_dependent_configs = [ ":skia_chrome_config" ] |
1163 | 1163 |
1164 deps = [ | 1164 deps = [ |
1165 ":skia_library", | 1165 ":skia_library", |
1166 ":skia_chrome_opts", | 1166 ":skia_chrome_opts", |
1167 "//base", | 1167 "//base", |
(...skipping 28 matching lines...) Expand all Loading... |
1196 defines = [ | 1196 defines = [ |
1197 "SKIA_DLL", | 1197 "SKIA_DLL", |
1198 ] | 1198 ] |
1199 } | 1199 } |
1200 | 1200 |
1201 shared_library("skia") { | 1201 shared_library("skia") { |
1202 sources = skia_library_sources + skia_chrome_sources | 1202 sources = skia_library_sources + skia_chrome_sources |
1203 | 1203 |
1204 defines = [ "SKIA_IMPLEMENTATION=1", ] | 1204 defines = [ "SKIA_IMPLEMENTATION=1", ] |
1205 | 1205 |
1206 configs -= "//build/config/compiler:chromium_code" | 1206 configs -= [ "//build/config/compiler:chromium_code" ] |
1207 configs += [ | 1207 configs += [ |
1208 ":skia_config", | 1208 ":skia_config", |
1209 ":skia_library_config", | 1209 ":skia_library_config", |
1210 "//build/config/compiler:no_chromium_code", | 1210 "//build/config/compiler:no_chromium_code", |
1211 ] | 1211 ] |
1212 | 1212 |
1213 direct_dependent_configs = [ ":skia_shared_library_config" ] | 1213 direct_dependent_configs = [ ":skia_shared_library_config" ] |
1214 | 1214 |
1215 deps = [ | 1215 deps = [ |
1216 ":skia_chrome_opts", | 1216 ":skia_chrome_opts", |
(...skipping 27 matching lines...) Expand all Loading... |
1244 } else { | 1244 } else { |
1245 sse_cflags = [] | 1245 sse_cflags = [] |
1246 } | 1246 } |
1247 | 1247 |
1248 | 1248 |
1249 static_library("skia_chrome_opts") { | 1249 static_library("skia_chrome_opts") { |
1250 sources = [ | 1250 sources = [ |
1251 "ext/convolver_SSE2.cc", | 1251 "ext/convolver_SSE2.cc", |
1252 ] | 1252 ] |
1253 | 1253 |
1254 configs -= "//build/config/compiler:chromium_code" | 1254 configs -= [ "//build/config/compiler:chromium_code" ] |
1255 configs += [ | 1255 configs += [ |
1256 ":skia_config", | 1256 ":skia_config", |
1257 "//build/config/compiler:no_chromium_code" | 1257 "//build/config/compiler:no_chromium_code" |
1258 ] | 1258 ] |
1259 | 1259 |
1260 cflags = sse_cflags | 1260 cflags = sse_cflags |
1261 | 1261 |
1262 #'target_arch == "mipsel"',{ | 1262 #'target_arch == "mipsel"',{ |
1263 # 'cflags': [ | 1263 # 'cflags': [ |
1264 # '-fomit-frame-pointer', | 1264 # '-fomit-frame-pointer', |
1265 # ], | 1265 # ], |
1266 # 'sources': [ | 1266 # 'sources': [ |
1267 # 'ext/convolver_mips_dspr2.cc', | 1267 # 'ext/convolver_mips_dspr2.cc', |
1268 # ], | 1268 # ], |
1269 # }], | 1269 # }], |
1270 } | 1270 } |
1271 | 1271 |
1272 static_library("skia_opts") { | 1272 static_library("skia_opts") { |
1273 # TODO(brettw) ARM and MIPS. | 1273 # TODO(brettw) ARM and MIPS. |
1274 sources = [ | 1274 sources = [ |
1275 "//third_party/skia/src/opts/SkBitmapProcState_opts_SSE2.cpp", | 1275 "//third_party/skia/src/opts/SkBitmapProcState_opts_SSE2.cpp", |
1276 "//third_party/skia/src/opts/SkBlitRect_opts_SSE2.cpp", | 1276 "//third_party/skia/src/opts/SkBlitRect_opts_SSE2.cpp", |
1277 "//third_party/skia/src/opts/SkBlitRow_opts_SSE2.cpp", | 1277 "//third_party/skia/src/opts/SkBlitRow_opts_SSE2.cpp", |
1278 "//third_party/skia/src/opts/SkUtils_opts_SSE2.cpp", | 1278 "//third_party/skia/src/opts/SkUtils_opts_SSE2.cpp", |
1279 "//third_party/skia/src/opts/SkBitmapFilter_opts_SSE2.cpp", | 1279 "//third_party/skia/src/opts/SkBitmapFilter_opts_SSE2.cpp", |
1280 ] | 1280 ] |
1281 | 1281 |
1282 configs -= "//build/config/compiler:chromium_code" | 1282 configs -= [ "//build/config/compiler:chromium_code" ] |
1283 configs += [ | 1283 configs += [ |
1284 ":skia_config", | 1284 ":skia_config", |
1285 "//build/config/compiler:no_chromium_code" | 1285 "//build/config/compiler:no_chromium_code" |
1286 ] | 1286 ] |
1287 | 1287 |
1288 cflags = sse_cflags | 1288 cflags = sse_cflags |
1289 | 1289 |
1290 deps = [ ":skia_opts_ssse3" ] | 1290 deps = [ ":skia_opts_ssse3" ] |
1291 } | 1291 } |
1292 | 1292 |
1293 static_library("skia_opts_ssse3") { | 1293 static_library("skia_opts_ssse3") { |
1294 # TODO(brettw) ARM and MIPS. | 1294 # TODO(brettw) ARM and MIPS. |
1295 sources = [ | 1295 sources = [ |
1296 "//third_party/skia/src/opts/SkBitmapProcState_opts_SSSE3.cpp", | 1296 "//third_party/skia/src/opts/SkBitmapProcState_opts_SSSE3.cpp", |
1297 ] | 1297 ] |
1298 | 1298 |
1299 configs -= "//build/config/compiler:chromium_code" | 1299 configs -= [ "//build/config/compiler:chromium_code" ] |
1300 configs += [ | 1300 configs += [ |
1301 ":skia_config", | 1301 ":skia_config", |
1302 "//build/config/compiler:no_chromium_code" | 1302 "//build/config/compiler:no_chromium_code" |
1303 ] | 1303 ] |
1304 | 1304 |
1305 if (is_linux) { | 1305 if (is_linux) { |
1306 cflags = [ "-msse3" ] | 1306 cflags = [ "-msse3" ] |
1307 } else if (is_mac) { | 1307 } else if (is_mac) { |
1308 cflags = [ "-mssse3" ] # Note the third 's'. | 1308 cflags = [ "-mssse3" ] # Note the third 's'. |
1309 } | 1309 } |
1310 } | 1310 } |
OLD | NEW |