Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 if (is_android) { | 5 if (is_android) { |
| 6 import("//build/config/android/config.gni") | 6 import("//build/config/android/config.gni") |
| 7 } | 7 } |
| 8 | 8 |
| 9 declare_args() { | 9 declare_args() { |
| 10 # Uses system libjpeg. If true, overrides use_libjpeg_turbo. | 10 # Uses system libjpeg. If true, overrides use_libjpeg_turbo. |
| 11 use_system_libjpeg = false | 11 use_system_libjpeg = false |
| 12 | 12 |
| 13 # Uses libjpeg_turbo as the jpeg implementation. Has no effect if | 13 # Uses libjpeg_turbo as the jpeg implementation. Has no effect if |
| 14 # use_system_libjpeg is set. | 14 # use_system_libjpeg is set. |
| 15 use_libjpeg_turbo = true | 15 use_libjpeg_turbo = true |
| 16 } | 16 } |
| 17 | 17 |
| 18 config("system_libjpeg_config") { | 18 config("system_libjpeg_config") { |
| 19 defines = [ "USE_SYSTEM_LIBJPEG" ] | 19 defines = [ "USE_SYSTEM_LIBJPEG" ] |
| 20 } | 20 } |
| 21 | 21 |
| 22 config("libjpeg_turbo_config") { | 22 config("libjpeg_turbo_config") { |
| 23 defines = [ "USE_LIBJPEG_TURBO" ] | 23 # Only used by ui/gfx/codec/jpeg_codec.cc. Chrome OS requires IJG for |
| 24 # robustly decoding login screen images. | |
| 25 # TODO(jorgelo): make sure this works on Chrome OS. | |
| 26 if (!is_chromeos) { | |
|
sky
2014/10/06 18:21:28
Wouldn't it be better to wrap the config in the if
Ed Baker
2014/10/30 23:29:48
Done.
| |
| 27 defines = [ "USE_LIBJPEG_TURBO" ] | |
| 28 } | |
| 24 } | 29 } |
| 25 | 30 |
| 26 # This is a meta target that forwards to the system's libjpeg, | 31 # This is a meta target that forwards to the system's libjpeg, |
| 27 # third_party/libjpeg, or third_party/libjpeg_turbo depending on the build args | 32 # third_party/libjpeg, or third_party/libjpeg_turbo depending on the build args |
| 28 # declared in this file. | 33 # declared in this file. |
| 29 group("jpeg") { | 34 group("jpeg") { |
| 30 if (use_system_libjpeg) { | 35 if (use_system_libjpeg) { |
| 31 libs = [ "jpeg" ] | 36 libs = [ "jpeg" ] |
| 32 direct_dependent_configs = [ ":system_libjpeg_config" ] | 37 direct_dependent_configs = [ ":system_libjpeg_config" ] |
| 33 } else if (use_libjpeg_turbo) { | 38 } else if (use_libjpeg_turbo) { |
| 34 deps = [ "//third_party/libjpeg_turbo:libjpeg" ] | 39 deps = [ "//third_party/libjpeg_turbo:libjpeg" ] |
| 35 direct_dependent_configs = [ ":libjpeg_turbo_config" ] | 40 direct_dependent_configs = [ ":libjpeg_turbo_config" ] |
| 36 } else { | 41 } else { |
| 37 deps = [ "//third_party/libjpeg:libjpeg" ] | 42 deps = [ "//third_party/libjpeg:libjpeg" ] |
| 38 } | 43 } |
| 39 } | 44 } |
| OLD | NEW |