aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/opts/Sk4px_SSE2.h
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2015-05-22 17:18:21 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-05-22 17:18:21 -0700
commitaa999cb952753d373c03befa7fce8c4700ef9308 (patch)
tree187820613cb390da6f4ce7aca7e4da08eab31f69 /src/opts/Sk4px_SSE2.h
parentd23a395d519835f78630aaea3f2a2c30ecdffe87 (diff)
Everyone gets a namespace {}.
If we include Sk4px.h, SkPMFloat.h, or SkNx.h into files with different SIMD flags, that could cause different definitions of the same method. Normally that's moot, because all the code inlines, but in Debug it tends not to. So in Debug, the linker picks one definition for us. That breaks _someone_. Wrapping everything in a namespace {} keeps the definitions separate. Tested locally, it fixes this bug. BUG=skia:3861 This code is not yet enabled in Chrome, so shouldn't affect the roll. NOTREECHECKS=true Review URL: https://codereview.chromium.org/1154523004
Diffstat (limited to 'src/opts/Sk4px_SSE2.h')
-rw-r--r--src/opts/Sk4px_SSE2.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/opts/Sk4px_SSE2.h b/src/opts/Sk4px_SSE2.h
index 9ba510347e..ee58c38ab0 100644
--- a/src/opts/Sk4px_SSE2.h
+++ b/src/opts/Sk4px_SSE2.h
@@ -5,6 +5,8 @@
* found in the LICENSE file.
*/
+namespace { // See Sk4px.h
+
inline Sk4px::Sk4px(SkPMColor px) : INHERITED(_mm_set1_epi32(px)) {}
inline Sk4px Sk4px::Load4(const SkPMColor px[4]) {
@@ -85,3 +87,5 @@ inline Sk4px Sk4px::zeroAlphas() const {
// andnot(a,b) == ~a & b
return Sk16b(_mm_andnot_si128(_mm_set1_epi32(0xFF << SK_A32_SHIFT), this->fVec));
}
+
+} // namespace