From d23341bb5e7c231680d0c6ce1a3539a3992ddf5e Mon Sep 17 00:00:00 2001 From: Mike Klein Date: Mon, 7 Nov 2016 16:56:53 -0500 Subject: [PATCH] GN: turn on libpng SSE2 filters I was profiling and remembered GN hasn't turned on much CPU-specific code. I looked at zlib, then libpng, then libjpeg-turbo: - zlib was easy but not useful. No routine we use in decoding changes significantly. - libpng was easy and useful, and we were already using NEON filters on ARM. - libjpeg-turbo requires yasm and is annoying. BUG=skia:5875 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4531 Change-Id: Ie072a457da41ee6538eebacb5eb5dbe5a6eb585e Reviewed-on: https://skia-review.googlesource.com/4531 Commit-Queue: Mike Klein Reviewed-by: Matt Sarett --- third_party/libpng/BUILD.gn | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/third_party/libpng/BUILD.gn b/third_party/libpng/BUILD.gn index 2e3c01c..3e97f55 100644 --- a/third_party/libpng/BUILD.gn +++ b/third_party/libpng/BUILD.gn @@ -17,6 +17,7 @@ if (skia_use_system_libpng) { third_party("libpng") { public_include_dirs = [ "." ] + defines = [] deps = [ "//third_party/zlib", ] @@ -44,5 +45,13 @@ if (skia_use_system_libpng) { "arm/filter_neon_intrinsics.c", ] } + + if (current_cpu == "x86" || current_cpu == "x64") { + defines += [ "PNG_INTEL_SSE" ] + sources += [ + "contrib/intel/filter_sse2_intrinsics.c", + "contrib/intel/intel_init.c", + ] + } } } -- 2.7.4