From a8a845cc0c8992745bcf9e93d99ea174de82fe31 Mon Sep 17 00:00:00 2001 From: Seth Fowler Date: Thu, 30 Jul 2015 19:48:22 -0700 Subject: [PATCH] Bug 1189593 - Only use SSE2 in image::Downscaler if we're running on an SSE2-capable machine. r=tn --- image/Downscaler.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/image/Downscaler.cpp b/image/Downscaler.cpp index 986f62158ad..d1fc0512fe9 100644 --- a/image/Downscaler.cpp +++ b/image/Downscaler.cpp @@ -10,6 +10,7 @@ #include #include "gfxPrefs.h" #include "image_operations.h" +#include "mozilla/SSE.h" #include "convolver.h" #include "skia/include/core/SkTypes.h" @@ -159,7 +160,7 @@ Downscaler::CommitRow() if (mCurrentInLine == inLineToRead) { skia::ConvolveHorizontally(mRowBuffer.get(), *mXFilter, mWindow[mLinesInBuffer++], mHasAlpha, - /* use_sse2 = */ true); + supports_sse2()); } MOZ_ASSERT(mCurrentOutLine < mTargetSize.height, @@ -226,7 +227,7 @@ Downscaler::DownscaleInputLine() &mOutputBuffer[mCurrentOutLine * mTargetSize.width * sizeof(uint32_t)]; skia::ConvolveVertically(static_cast(filterValues), filterLength, mWindow.get(), mXFilter->num_values(), - outputLine, mHasAlpha, /* use_sse2 = */ true); + outputLine, mHasAlpha, supports_sse2()); mCurrentOutLine += 1;