Bug 1260351 - Image: Enable ConvolveVertically/Horizontally in LS3 MMI. r=tnikkel
authorHeiher <r@hev.cc>
Wed, 13 Apr 2016 21:40:33 +0800
changeset 332889 041577d97132aea17fe52583feccc157dac3f84e
parent 332888 6e11636c6aa2193cdf842e6fd00442e0342ce6f3
child 332890 3bcaa74cc73a490cc7f2c309b72009dd229a41dc
push id1146
push userCallek@gmail.com
push dateMon, 25 Jul 2016 16:35:44 +0000
treeherdermozilla-release@a55778f9cd5a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstnikkel
bugs1260351
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1260351 - Image: Enable ConvolveVertically/Horizontally in LS3 MMI. r=tnikkel --- image/Downscaler.cpp | 5 +++-- image/DownscalingFilter.h | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-)
image/Downscaler.cpp
image/DownscalingFilter.h
--- a/image/Downscaler.cpp
+++ b/image/Downscaler.cpp
@@ -6,16 +6,17 @@
 
 #include "Downscaler.h"
 
 #include <algorithm>
 #include <ctime>
 #include "gfxPrefs.h"
 #include "image_operations.h"
 #include "mozilla/SSE.h"
+#include "mozilla/mips.h"
 #include "convolver.h"
 #include "skia/include/core/SkTypes.h"
 
 using std::max;
 using std::swap;
 
 namespace mozilla {
 namespace image {
@@ -223,17 +224,17 @@ Downscaler::CommitRow()
     GetFilterOffsetAndLength(mYFilter, mCurrentOutLine,
                              &filterOffset, &filterLength);
 
     int32_t inLineToRead = filterOffset + mLinesInBuffer;
     MOZ_ASSERT(mCurrentInLine <= inLineToRead, "Reading past end of input");
     if (mCurrentInLine == inLineToRead) {
       skia::ConvolveHorizontally(mRowBuffer.get(), *mXFilter,
                                  mWindow[mLinesInBuffer++], mHasAlpha,
-                                 supports_sse2());
+                                 supports_sse2() || supports_mmi());
     }
 
     MOZ_ASSERT(mCurrentOutLine < mTargetSize.height,
                "Writing past end of output");
 
     while (mLinesInBuffer == filterLength) {
       DownscaleInputLine();
 
@@ -311,17 +312,17 @@ Downscaler::DownscaleInputLine()
                          ? mTargetSize.height - (mCurrentOutLine + 1)
                          : mCurrentOutLine;
   MOZ_ASSERT(currentOutLine >= 0);
 
   uint8_t* outputLine =
     &mOutputBuffer[currentOutLine * mTargetSize.width * sizeof(uint32_t)];
   skia::ConvolveVertically(static_cast<const FilterValue*>(filterValues),
                            filterLength, mWindow.get(), mXFilter->num_values(),
-                           outputLine, mHasAlpha, supports_sse2());
+                           outputLine, mHasAlpha, supports_sse2() || supports_mmi());
 
   mCurrentOutLine += 1;
 
   if (mCurrentOutLine == mTargetSize.height) {
     // We're done.
     return;
   }
 
--- a/image/DownscalingFilter.h
+++ b/image/DownscalingFilter.h
@@ -18,16 +18,17 @@
 
 #include <algorithm>
 #include <ctime>
 #include <stdint.h>
 #include <string.h>
 
 #include "mozilla/Maybe.h"
 #include "mozilla/SSE.h"
+#include "mozilla/mips.h"
 #include "mozilla/UniquePtr.h"
 #include "mozilla/gfx/2D.h"
 #include "gfxPrefs.h"
 
 #ifdef MOZ_ENABLE_SKIA
 #include "convolver.h"
 #include "image_operations.h"
 #include "skia/include/core/SkTypes.h"
@@ -231,17 +232,17 @@ public:
     GetFilterOffsetAndLength(mYFilter, mOutputRow,
                              &filterOffset, &filterLength);
 
     int32_t inputRowToRead = filterOffset + mRowsInWindow;
     MOZ_ASSERT(mInputRow <= inputRowToRead, "Reading past end of input");
     if (mInputRow == inputRowToRead) {
       skia::ConvolveHorizontally(mRowBuffer.get(), *mXFilter,
                                  mWindow[mRowsInWindow++], mHasAlpha,
-                                 supports_sse2());
+                                 supports_sse2() || supports_mmi());
     }
 
     MOZ_ASSERT(mOutputRow < mNext.InputSize().height,
                "Writing past end of output");
 
     while (mRowsInWindow == filterLength) {
       DownscaleInputRow();
 
@@ -306,17 +307,17 @@ private:
     auto filterValues =
       mYFilter->FilterForValue(mOutputRow, &filterOffset, &filterLength);
 
     mNext.template WriteRows<uint32_t>([&](uint32_t* aRow, uint32_t aLength)
             -> Maybe<WriteState> {
       skia::ConvolveVertically(static_cast<const FilterValue*>(filterValues),
                                filterLength, mWindow.get(), mXFilter->num_values(),
                                reinterpret_cast<uint8_t*>(aRow), mHasAlpha,
-                               supports_sse2());
+                               supports_sse2() || supports_mmi());
       return Some(WriteState::NEED_MORE_DATA);
     });
 
     mOutputRow++;
 
     if (mOutputRow == mNext.InputSize().height) {
       return;  // We're done.
     }