Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(877)

Unified Diff: src/opts/SkBitmapFilter_opts_SSE2.cpp

Issue 530673002: Remove dead code in SkBitmapFilter_opts_SSE2.h/cpp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/opts/SkBitmapFilter_opts_SSE2.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/opts/SkBitmapFilter_opts_SSE2.cpp
diff --git a/src/opts/SkBitmapFilter_opts_SSE2.cpp b/src/opts/SkBitmapFilter_opts_SSE2.cpp
index b0405669218ba635017e36d308374235eae44953..b831e298d044ad53ac9f399e422bea7451116952 100644
--- a/src/opts/SkBitmapFilter_opts_SSE2.cpp
+++ b/src/opts/SkBitmapFilter_opts_SSE2.cpp
@@ -108,74 +108,6 @@ void highQualityFilter_SSE2(const SkBitmapProcState& s, int x, int y,
}
}
-void highQualityFilter_ScaleOnly_SSE2(const SkBitmapProcState &s, int x, int y,
- SkPMColor *SK_RESTRICT colors, int count) {
- const int maxX = s.fBitmap->width() - 1;
- const int maxY = s.fBitmap->height() - 1;
-
- SkPoint srcPt;
- s.fInvProc(s.fInvMatrix, SkIntToScalar(x),
- SkIntToScalar(y), &srcPt);
- srcPt.fY -= SK_ScalarHalf;
- int sy = SkScalarFloorToInt(srcPt.fY);
-
- int y0 = SkTMax(0, int(ceil(sy-s.getBitmapFilter()->width() + 0.5f)));
- int y1 = SkTMin(maxY, int(floor(sy+s.getBitmapFilter()->width() + 0.5f)));
-
- while (count-- > 0) {
- srcPt.fX -= SK_ScalarHalf;
- srcPt.fY -= SK_ScalarHalf;
-
- int sx = SkScalarFloorToInt(srcPt.fX);
-
- float weight = 0;
- __m128 accum = _mm_setzero_ps();
-
- int x0 = SkTMax(0, int(ceil(sx-s.getBitmapFilter()->width() + 0.5f)));
- int x1 = SkTMin(maxX, int(floor(sx+s.getBitmapFilter()->width() + 0.5f)));
-
- for (int src_y = y0; src_y <= y1; src_y++) {
- float yweight = SkScalarToFloat(s.getBitmapFilter()->lookupScalar(srcPt.fY - src_y));
-
- for (int src_x = x0; src_x <= x1 ; src_x++) {
- float xweight = SkScalarToFloat(s.getBitmapFilter()->lookupScalar(srcPt.fX - src_x));
-
- float combined_weight = xweight * yweight;
-
- SkPMColor color = *s.fBitmap->getAddr32(src_x, src_y);
-
- __m128 c = _mm_set_ps((float)SkGetPackedB32(color),
- (float)SkGetPackedG32(color),
- (float)SkGetPackedR32(color),
- (float)SkGetPackedA32(color));
-
- __m128 weightVector = _mm_set1_ps(combined_weight);
-
- accum = _mm_add_ps(accum, _mm_mul_ps(c, weightVector));
- weight += combined_weight;
- }
- }
-
- __m128 totalWeightVector = _mm_set1_ps(weight);
- accum = _mm_div_ps(accum, totalWeightVector);
- accum = _mm_add_ps(accum, _mm_set1_ps(0.5f));
-
- float localResult[4];
- _mm_storeu_ps(localResult, accum);
- int a = SkClampMax(int(localResult[0]), 255);
- int r = SkClampMax(int(localResult[1]), a);
- int g = SkClampMax(int(localResult[2]), a);
- int b = SkClampMax(int(localResult[3]), a);
-
- *colors++ = SkPackARGB32(a, r, g, b);
-
- x++;
-
- s.fInvProc(s.fInvMatrix, SkIntToScalar(x),
- SkIntToScalar(y), &srcPt);
- }
-}
-
// 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,
« no previous file with comments | « src/opts/SkBitmapFilter_opts_SSE2.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698