add compile-time not-supported checks to runtime CPU checks

There's no reason to call Init_ssse3() if we know Skia's built globally
with SSSE3.  And there's definitely no reason to call Init_ssse3() if
Skia's build globally with SSE4.1+.

These are the only places the Init_foo() methods are called, and those
in turn are the only places that refer to their optimized routines, so
guarding like this allows redundant routines to be dead-code stripped by
the linker.

There are still situations where we end up with two copies of the same
routine, compiled at _the same_ optimization level.  If you're on a Mac
and have SSSE3 or SSE4.1 as your global baseline instruction set, you'll
get two copies, one from SkOpts.o's defaults, and one from
SkOpts_{ssse3,sse41}.o's "better" routines.  I'm still thinking about
how to best fix this.  Might just be as simple as removing "static" and
letting the linker dedup.

This cuts off about 70K of code on a build of ok.

Change-Id: Ia349d2c5299072bbd43966132798500de059b9ca
Reviewed-on: https://skia-review.googlesource.com/37600
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
1 file changed