Wrap SkNx types in anonymous namespace again.
This should make each compilation unit's SkNx types distinct from each other's as far as C++ cares. This keeps us from violating the One Definition Rule with different implementations for the same function.
Here's an example I like. Sk4i SkNx_cast(Sk4b) has at least 4 different sensible implementations:
- SSE2: punpcklbw xmm, zero; punpcklbw xmm, zero
- SSSE3: load mask; pshufb xmm, mask
- SSE4.1: pmovzxbd
- AVX2: vpmovzxbd
We really want all these to inline, but if for some reason they don't (Debug build, poor inliner) and they're compiled in SkOpts.cpp, SkOpts_ssse3.cpp, SkOpts_sse41.cpp, SkOpts_hsw.cpp... boom!
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3461
Change-Id: I0088ebfd7640c1b0de989738ed43c81b530dc0d9
Reviewed-on: https://skia-review.googlesource.com/3461
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
diff --git a/src/core/Sk4x4f.h b/src/core/Sk4x4f.h
index 9bd9197..0fd6b38 100644
--- a/src/core/Sk4x4f.h
+++ b/src/core/Sk4x4f.h
@@ -10,6 +10,8 @@
#include "SkNx.h"
+namespace {
+
struct Sk4x4f {
Sk4f r,g,b,a;
@@ -150,4 +152,6 @@
#endif
+} // namespace
+
#endif//Sk4x4f_DEFINED