Index: src/opts/SkBitmapFilter_opts_SSE2.cpp |
diff --git a/src/opts/SkBitmapFilter_opts_SSE2.cpp b/src/opts/SkBitmapFilter_opts_SSE2.cpp |
index 2996f535d97abe1413cb7ed810f631668b29033d..de3dd3b8e9e04161b642c12d27412719a600d90c 100644 |
--- a/src/opts/SkBitmapFilter_opts_SSE2.cpp |
+++ b/src/opts/SkBitmapFilter_opts_SSE2.cpp |
@@ -40,78 +40,6 @@ static inline void print128f(__m128 value) { |
} |
#endif |
-// because the border is handled specially, this is guaranteed to have all 16 pixels |
-// available to it without running off the bitmap's edge. |
- |
-void highQualityFilter_SSE2(const SkBitmapProcState& s, int x, int y, |
- SkPMColor* SK_RESTRICT colors, int count) { |
- |
- const int maxX = s.fBitmap->width(); |
- const int maxY = s.fBitmap->height(); |
- SkAutoTMalloc<SkScalar> xWeights(maxX); |
- const SkBitmapFilter* filter = s.getBitmapFilter(); |
- |
- while (count-- > 0) { |
- SkPoint srcPt; |
- s.fInvProc(s.fInvMatrix, x + 0.5f, y + 0.5f, &srcPt); |
- srcPt.fX -= SK_ScalarHalf; |
- srcPt.fY -= SK_ScalarHalf; |
- |
- __m128 weight = _mm_setzero_ps(); |
- __m128 accum = _mm_setzero_ps(); |
- |
- int y0 = SkClampMax(SkScalarCeilToInt(srcPt.fY - filter->width()), maxY); |
- int y1 = SkClampMax(SkScalarFloorToInt(srcPt.fY + filter->width() + 1), maxY); |
- int x0 = SkClampMax(SkScalarCeilToInt(srcPt.fX - filter->width()), maxX); |
- int x1 = SkClampMax(SkScalarFloorToInt(srcPt.fX + filter->width()) + 1, maxX); |
- |
- for (int srcX = x0; srcX < x1 ; srcX++) { |
- // Looking these up once instead of each loop is a ~15% speedup. |
- xWeights[srcX - x0] = filter->lookupScalar((srcPt.fX - srcX)); |
- } |
- |
- for (int srcY = y0; srcY < y1; srcY++) { |
- SkScalar yWeight = filter->lookupScalar((srcPt.fY - srcY)); |
- |
- for (int srcX = x0; srcX < x1 ; srcX++) { |
- SkScalar xWeight = xWeights[srcX - x0]; |
- |
- SkScalar combined_weight = SkScalarMul(xWeight, yWeight); |
- __m128 weightVector = _mm_set1_ps(combined_weight); |
- weight = _mm_add_ps( weight, weightVector ); |
- |
- SkPMColor color = *s.fBitmap->getAddr32(srcX, srcY); |
- if (!color) { |
- continue; |
- } |
- |
- __m128i c = _mm_cvtsi32_si128(color); |
- c = _mm_unpacklo_epi8(c, _mm_setzero_si128()); |
- c = _mm_unpacklo_epi16(c, _mm_setzero_si128()); |
- __m128 cfloat = _mm_cvtepi32_ps(c); |
- |
- accum = _mm_add_ps(accum, _mm_mul_ps(cfloat, weightVector)); |
- } |
- } |
- |
- accum = _mm_div_ps(accum, weight); |
- accum = _mm_add_ps(accum, _mm_set1_ps(0.5f)); |
- __m128i accumInt = _mm_cvttps_epi32(accum); |
- accumInt = _mm_packs_epi32(accumInt, _mm_setzero_si128()); |
- accumInt = _mm_packus_epi16(accumInt, _mm_setzero_si128()); |
- SkPMColor c = _mm_cvtsi128_si32(accumInt); |
- |
- int a = SkClampMax(SkGetPackedA32(c), 255); |
- int r = SkClampMax(SkGetPackedR32(c), a); |
- int g = SkClampMax(SkGetPackedG32(c), a); |
- int b = SkClampMax(SkGetPackedB32(c), a); |
- |
- *colors++ = SkPackARGB32(a, r, g, b); |
- |
- x++; |
- } |
-} |
- |
// Convolves horizontally along a single row. The row data is given in |
// |src_data| and continues for the num_values() of the filter. |
void convolveHorizontally_SSE2(const unsigned char* src_data, |