Backed out changeset 3ff6c190426e (bug 1120050) for non-unified bustage on a CLOSED TREE
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Mon, 12 Jan 2015 15:06:46 +0100
changeset 249181 965b5028e41e2a8df77a3c777c396e12807937a4
parent 249180 a7f64e53893ef5d4bed1996acce1e0d459b8df8d
child 249182 a44152aabff48952b4fb78db68d53ce84d323fc3
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1120050
milestone37.0a1
backs out3ff6c190426e945070c0b975f878d94763526491
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
Backed out changeset 3ff6c190426e (bug 1120050) for non-unified bustage on a CLOSED TREE
gfx/2d/convolver.cpp
gfx/2d/convolver.h
gfx/2d/image_operations.cpp
gfx/2d/image_operations.h
--- a/gfx/2d/convolver.cpp
+++ b/gfx/2d/convolver.cpp
@@ -148,18 +148,16 @@ class CircularRowBuffer {
   // The y coordinate of the |next_row_|. This is incremented each time a
   // new row is appended and does not wrap.
   int next_row_coordinate_;
 
   // Buffer used by GetRowAddresses().
   std::vector<unsigned char*> row_addresses_;
 };
 
-}  // namespace
-
 // Convolves horizontally along a single row. The row data is given in
 // |src_data| and continues for the [begin, end) of the filter.
 template<bool has_alpha>
 // This function is miscompiled with gcc 4.5 with pgo. See bug 827946.
 #if defined(__GNUC__) && defined(MOZ_GCC_VERSION_AT_LEAST)
 #if MOZ_GCC_VERSION_AT_LEAST(4, 5, 0) && !MOZ_GCC_VERSION_AT_LEAST(4, 6, 0)
 __attribute__((optimize("-O1")))
 #endif
@@ -270,70 +268,17 @@ void ConvolveVertically(const Convolutio
         out_row[byte_offset + A_OFFSET_IDX] = alpha;
     } else {
       // No alpha channel, the image is opaque.
       out_row[byte_offset + A_OFFSET_IDX] = 0xff;
     }
   }
 }
 
-void ConvolveVertically(const ConvolutionFilter1D::Fixed* filter_values,
-                        int filter_length,
-                        unsigned char* const* source_data_rows,
-                        int width, unsigned char* out_row,
-                        bool has_alpha, bool use_sse2) {
-  int processed = 0;
-
-#if defined(USE_SSE2)
-  // If the binary was not built with SSE2 support, we had to fallback to C version.
-  int simd_width = width & ~3;
-  if (use_sse2 && simd_width) {
-    ConvolveVertically_SSE2(filter_values, filter_length,
-                            source_data_rows, 0, simd_width,
-                            out_row, has_alpha);
-    processed = simd_width;
-  }
-#endif
-    
-  if (width > processed) {
-    if (has_alpha) {
-      ConvolveVertically<true>(filter_values, filter_length, source_data_rows,
-                               processed, width, out_row);
-    } else {
-      ConvolveVertically<false>(filter_values, filter_length, source_data_rows,
-                                processed, width, out_row);
-    }
-  }
-}
-
-void ConvolveHorizontally(const unsigned char* src_data,
-                          const ConvolutionFilter1D& filter,
-                          unsigned char* out_row,
-                          bool has_alpha, bool use_sse2) {
-  int width = filter.num_values();
-  int processed = 0;
-#if defined(USE_SSE2)
-  int simd_width = width & ~3;
-  if (use_sse2 && simd_width) {
-    // SIMD implementation works with 4 pixels at a time.
-    // Therefore we process as much as we can using SSE and then use
-    // C implementation for leftovers
-    ConvolveHorizontally_SSE2(src_data, 0, simd_width, filter, out_row);
-    processed = simd_width;
-  }
-#endif
-
-  if (width > processed) {
-    if (has_alpha) {
-      ConvolveHorizontally<true>(src_data, processed, width, filter, out_row);
-    } else {
-      ConvolveHorizontally<false>(src_data, processed, width, filter, out_row);
-    }
-  }
-}
+}  // namespace
 
 // ConvolutionFilter1D ---------------------------------------------------------
 
 ConvolutionFilter1D::ConvolutionFilter1D()
     : max_filter_(0) {
 }
 
 ConvolutionFilter1D::~ConvolutionFilter1D() {
@@ -518,15 +463,30 @@ void BGRAConvolve2D(const unsigned char*
     unsigned char* const* rows_to_convolve =
         row_buffer.GetRowAddresses(&first_row_in_circular_buffer);
 
     // Now compute the start of the subset of those rows that the filter
     // needs.
     unsigned char* const* first_row_for_filter =
         &rows_to_convolve[filter_offset - first_row_in_circular_buffer];
 
-    ConvolveVertically(filter_values, filter_length,
-                       first_row_for_filter, pixel_width,
-                       cur_output_row, source_has_alpha, use_sse2);
+    int processed = 0;
+#if defined(USE_SSE2)
+    int simd_width = pixel_width & ~3;
+    if (use_sse2 && simd_width) {
+        ConvolveVertically_SSE2(filter_values, filter_length, first_row_for_filter,
+                                0, simd_width, cur_output_row, source_has_alpha);
+        processed = simd_width;
+    }
+#endif
+    if (source_has_alpha) {
+      ConvolveVertically<true>(filter_values, filter_length,
+                               first_row_for_filter,
+                               processed, pixel_width, cur_output_row);
+    } else {
+      ConvolveVertically<false>(filter_values, filter_length,
+                               first_row_for_filter,
+                               processed, pixel_width, cur_output_row);
+    }
   }
 }
 
 }  // namespace skia
--- a/gfx/2d/convolver.h
+++ b/gfx/2d/convolver.h
@@ -181,24 +181,11 @@ class ConvolutionFilter1D {
 void BGRAConvolve2D(const unsigned char* source_data,
                     int source_byte_row_stride,
                     bool source_has_alpha,
                     const ConvolutionFilter1D& xfilter,
                     const ConvolutionFilter1D& yfilter,
                     int output_byte_row_stride,
                     unsigned char* output);
 
-void ConvolveHorizontally(const unsigned char* src_data,
-                          const ConvolutionFilter1D& filter,
-                          unsigned char* out_row,
-                          bool has_alpha, bool use_sse2);
-
-void ConvolveVertically(const ConvolutionFilter1D::Fixed* filter_values,
-                        int filter_length,
-                        unsigned char* const* source_data_rows,
-                        int pixel_width, unsigned char* out_row,
-                        bool has_alpha, bool use_sse2);
-
-
-
 }  // namespace skia
 
 #endif  // SKIA_EXT_CONVOLVER_H_
--- a/gfx/2d/image_operations.cpp
+++ b/gfx/2d/image_operations.cpp
@@ -39,49 +39,206 @@
 #include "convolver.h"
 #include "skia/SkColorPriv.h"
 #include "skia/SkBitmap.h"
 #include "skia/SkRect.h"
 #include "skia/SkFontHost.h"
 
 namespace skia {
 
-namespace resize {
+namespace {
+
+// Returns the ceiling/floor as an integer.
+inline int CeilInt(float val) {
+  return static_cast<int>(ceil(val));
+}
+inline int FloorInt(float val) {
+  return static_cast<int>(floor(val));
+}
+
+// Filter function computation -------------------------------------------------
+
+// Evaluates the box filter, which goes from -0.5 to +0.5.
+float EvalBox(float x) {
+  return (x >= -0.5f && x < 0.5f) ? 1.0f : 0.0f;
+}
+
+// Evaluates the Lanczos filter of the given filter size window for the given
+// position.
+//
+// |filter_size| is the width of the filter (the "window"), outside of which
+// the value of the function is 0. Inside of the window, the value is the
+// normalized sinc function:
+//   lanczos(x) = sinc(x) * sinc(x / filter_size);
+// where
+//   sinc(x) = sin(pi*x) / (pi*x);
+float EvalLanczos(int filter_size, float x) {
+  if (x <= -filter_size || x >= filter_size)
+    return 0.0f;  // Outside of the window.
+  if (x > -std::numeric_limits<float>::epsilon() &&
+      x < std::numeric_limits<float>::epsilon())
+    return 1.0f;  // Special case the discontinuity at the origin.
+  float xpi = x * static_cast<float>(M_PI);
+  return (sin(xpi) / xpi) *  // sinc(x)
+          sin(xpi / filter_size) / (xpi / filter_size);  // sinc(x/filter_size)
+}
+
+// Evaluates the Hamming filter of the given filter size window for the given
+// position.
+//
+// The filter covers [-filter_size, +filter_size]. Outside of this window
+// the value of the function is 0. Inside of the window, the value is sinus
+// cardinal multiplied by a recentered Hamming function. The traditional
+// Hamming formula for a window of size N and n ranging in [0, N-1] is:
+//   hamming(n) = 0.54 - 0.46 * cos(2 * pi * n / (N-1)))
+// In our case we want the function centered for x == 0 and at its minimum
+// on both ends of the window (x == +/- filter_size), hence the adjusted
+// formula:
+//   hamming(x) = (0.54 -
+//                 0.46 * cos(2 * pi * (x - filter_size)/ (2 * filter_size)))
+//              = 0.54 - 0.46 * cos(pi * x / filter_size - pi)
+//              = 0.54 + 0.46 * cos(pi * x / filter_size)
+float EvalHamming(int filter_size, float x) {
+  if (x <= -filter_size || x >= filter_size)
+    return 0.0f;  // Outside of the window.
+  if (x > -std::numeric_limits<float>::epsilon() &&
+      x < std::numeric_limits<float>::epsilon())
+    return 1.0f;  // Special case the sinc discontinuity at the origin.
+  const float xpi = x * static_cast<float>(M_PI);
+
+  return ((sin(xpi) / xpi) *  // sinc(x)
+          (0.54f + 0.46f * cos(xpi / filter_size)));  // hamming(x)
+}
+
+// ResizeFilter ----------------------------------------------------------------
+
+// Encapsulates computation and storage of the filters required for one complete
+// resize operation.
+class ResizeFilter {
+ public:
+  ResizeFilter(ImageOperations::ResizeMethod method,
+               int src_full_width, int src_full_height,
+               int dest_width, int dest_height,
+               const SkIRect& dest_subset);
+
+  // Returns the filled filter values.
+  const ConvolutionFilter1D& x_filter() { return x_filter_; }
+  const ConvolutionFilter1D& y_filter() { return y_filter_; }
+
+ private:
+  // Returns the number of pixels that the filer spans, in filter space (the
+  // destination image).
+  float GetFilterSupport(float scale) {
+    switch (method_) {
+      case ImageOperations::RESIZE_BOX:
+        // The box filter just scales with the image scaling.
+        return 0.5f;  // Only want one side of the filter = /2.
+      case ImageOperations::RESIZE_HAMMING1:
+        // The Hamming filter takes as much space in the source image in
+        // each direction as the size of the window = 1 for Hamming1.
+        return 1.0f;
+      case ImageOperations::RESIZE_LANCZOS2:
+        // The Lanczos filter takes as much space in the source image in
+        // each direction as the size of the window = 2 for Lanczos2.
+        return 2.0f;
+      case ImageOperations::RESIZE_LANCZOS3:
+        // The Lanczos filter takes as much space in the source image in
+        // each direction as the size of the window = 3 for Lanczos3.
+        return 3.0f;
+      default:
+        return 1.0f;
+    }
+  }
+
+  // Computes one set of filters either horizontally or vertically. The caller
+  // will specify the "min" and "max" rather than the bottom/top and
+  // right/bottom so that the same code can be re-used in each dimension.
+  //
+  // |src_depend_lo| and |src_depend_size| gives the range for the source
+  // depend rectangle (horizontally or vertically at the caller's discretion
+  // -- see above for what this means).
+  //
+  // Likewise, the range of destination values to compute and the scale factor
+  // for the transform is also specified.
+  void ComputeFilters(int src_size,
+                      int dest_subset_lo, int dest_subset_size,
+                      float scale, ConvolutionFilter1D* output);
+
+  // Computes the filter value given the coordinate in filter space.
+  inline float ComputeFilter(float pos) {
+    switch (method_) {
+      case ImageOperations::RESIZE_BOX:
+        return EvalBox(pos);
+      case ImageOperations::RESIZE_HAMMING1:
+        return EvalHamming(1, pos);
+      case ImageOperations::RESIZE_LANCZOS2:
+        return EvalLanczos(2, pos);
+      case ImageOperations::RESIZE_LANCZOS3:
+        return EvalLanczos(3, pos);
+      default:
+        return 0;
+    }
+  }
+
+  ImageOperations::ResizeMethod method_;
+
+  // Subset of scaled destination bitmap to compute.
+  SkIRect out_bounds_;
+
+  ConvolutionFilter1D x_filter_;
+  ConvolutionFilter1D y_filter_;
+
+  DISALLOW_COPY_AND_ASSIGN(ResizeFilter);
+};
+
+ResizeFilter::ResizeFilter(ImageOperations::ResizeMethod method,
+                           int src_full_width, int src_full_height,
+                           int dest_width, int dest_height,
+                           const SkIRect& dest_subset)
+    : method_(method),
+      out_bounds_(dest_subset) {
+  // method_ will only ever refer to an "algorithm method".
+  SkASSERT((ImageOperations::RESIZE_FIRST_ALGORITHM_METHOD <= method) &&
+           (method <= ImageOperations::RESIZE_LAST_ALGORITHM_METHOD));
+
+  float scale_x = static_cast<float>(dest_width) /
+                  static_cast<float>(src_full_width);
+  float scale_y = static_cast<float>(dest_height) /
+                  static_cast<float>(src_full_height);
+
+  ComputeFilters(src_full_width, dest_subset.fLeft, dest_subset.width(),
+                 scale_x, &x_filter_);
+  ComputeFilters(src_full_height, dest_subset.fTop, dest_subset.height(),
+                 scale_y, &y_filter_);
+}
 
 // TODO(egouriou): Take advantage of periods in the convolution.
 // Practical resizing filters are periodic outside of the border area.
 // For Lanczos, a scaling by a (reduced) factor of p/q (q pixels in the
 // source become p pixels in the destination) will have a period of p.
 // A nice consequence is a period of 1 when downscaling by an integral
 // factor. Downscaling from typical display resolutions is also bound
 // to produce interesting periods as those are chosen to have multiple
 // small factors.
 // Small periods reduce computational load and improve cache usage if
 // the coefficients can be shared. For periods of 1 we can consider
 // loading the factors only once outside the borders.
-void ComputeFilters(ImageOperations::ResizeMethod method,
-                    int src_size, int dst_size,
-                    int dest_subset_lo, int dest_subset_size,
-                    ConvolutionFilter1D* output) {
-  // method_ will only ever refer to an "algorithm method".
-  SkASSERT((ImageOperations::RESIZE_FIRST_ALGORITHM_METHOD <= method) &&
-           (method <= ImageOperations::RESIZE_LAST_ALGORITHM_METHOD));
-
-  float scale = static_cast<float>(dst_size) / static_cast<float>(src_size);
- 
+void ResizeFilter::ComputeFilters(int src_size,
+                                  int dest_subset_lo, int dest_subset_size,
+                                  float scale, ConvolutionFilter1D* output) {
   int dest_subset_hi = dest_subset_lo + dest_subset_size;  // [lo, hi)
 
   // When we're doing a magnification, the scale will be larger than one. This
   // means the destination pixels are much smaller than the source pixels, and
   // that the range covered by the filter won't necessarily cover any source
   // pixel boundaries. Therefore, we use these clamped values (max of 1) for
   // some computations.
   float clamped_scale = std::min(1.0f, scale);
 
-  float src_support = GetFilterSupport(method, clamped_scale) / clamped_scale;
+  float src_support = GetFilterSupport(clamped_scale) / clamped_scale;
 
   // Speed up the divisions below by turning them into multiplies.
   float inv_scale = 1.0f / scale;
 
   StackVector<float, 64> filter_values;
   StackVector<int16_t, 64> fixed_filter_values;
 
   // Loop over all pixels in the output range. We will generate one set of
@@ -119,17 +276,17 @@ void ComputeFilters(ImageOperations::Res
       // is at (2.5, 2.5).
       float src_filter_dist =
            ((static_cast<float>(cur_filter_pixel) + 0.5f) - src_pixel);
 
       // Since the filter really exists in dest space, map it there.
       float dest_filter_dist = src_filter_dist * clamped_scale;
 
       // Compute the filter value at that location.
-      float filter_value = ComputeFilter(method, dest_filter_dist);
+      float filter_value = ComputeFilter(dest_filter_dist);
       filter_values->push_back(filter_value);
 
       filter_sum += filter_value;
     }
 
     // The filter must be normalized so that we don't affect the brightness of
     // the image. Convert to normalized fixed point.
     int16_t fixed_sum = 0;
@@ -150,18 +307,16 @@ void ComputeFilters(ImageOperations::Res
     // Now it's ready to go.
     output->AddFilter(src_begin, &fixed_filter_values[0],
                       static_cast<int>(fixed_filter_values->size()));
   }
 
   output->PaddingForSIMD(8);
 }
 
-}
-
 ImageOperations::ResizeMethod ResizeMethodToAlgorithmMethod(
     ImageOperations::ResizeMethod method) {
   // Convert any "Quality Method" into an "Algorithm Method"
   if (method >= ImageOperations::RESIZE_FIRST_ALGORITHM_METHOD &&
       method <= ImageOperations::RESIZE_LAST_ALGORITHM_METHOD) {
     return method;
   }
   // The call to ImageOperationsGtv::Resize() above took care of
@@ -181,16 +336,18 @@ ImageOperations::ResizeMethod ResizeMeth
       // an acceptable trade-off between quality and speed.
     case ImageOperations::RESIZE_BETTER:
       return ImageOperations::RESIZE_HAMMING1;
     default:
       return ImageOperations::RESIZE_LANCZOS3;
   }
 }
 
+}  // namespace
+
 // Resize ----------------------------------------------------------------------
 
 // static
 SkBitmap ImageOperations::Resize(const SkBitmap& source,
                                  ResizeMethod method,
                                  int dest_width, int dest_height,
                                  const SkIRect& dest_subset,
                                  void* dest_pixels /* = nullptr */) {
@@ -334,21 +491,18 @@ SkBitmap ImageOperations::ResizeBasic(co
   // Check that we deal with an "algorithm methods" from this point onward.
   SkASSERT((ImageOperations::RESIZE_FIRST_ALGORITHM_METHOD <= method) &&
            (method <= ImageOperations::RESIZE_LAST_ALGORITHM_METHOD));
 
   SkAutoLockPixels locker(source);
   if (!source.readyToDraw())
       return SkBitmap();
 
-  ConvolutionFilter1D x_filter;
-  ConvolutionFilter1D y_filter;
-
-  resize::ComputeFilters(method, source.width(), dest_width, dest_subset.fLeft, dest_subset.width(), &x_filter);
-  resize::ComputeFilters(method, source.height(), dest_height, dest_subset.fTop, dest_subset.height(), &y_filter);
+  ResizeFilter filter(method, source.width(), source.height(),
+                      dest_width, dest_height, dest_subset);
 
   // Get a source bitmap encompassing this touched area. We construct the
   // offsets and row strides such that it looks like a new bitmap, while
   // referring to the old data.
   const uint8_t* source_subset =
       reinterpret_cast<const uint8_t*>(source.getPixels());
 
   // Convolve into the result.
@@ -363,17 +517,17 @@ SkBitmap ImageOperations::ResizeBasic(co
   } else {
     result.allocPixels(info);
   }
 
   if (!result.readyToDraw())
     return SkBitmap();
 
   BGRAConvolve2D(source_subset, static_cast<int>(source.rowBytes()),
-                 !source.isOpaque(), x_filter, y_filter,
+                 !source.isOpaque(), filter.x_filter(), filter.y_filter(),
                  static_cast<int>(result.rowBytes()),
                  static_cast<unsigned char*>(result.getPixels()));
 
   // Preserve the "opaque" flag for use as an optimization later.
   result.setAlphaType(source.alphaType());
 
   return result;
 }
--- a/gfx/2d/image_operations.h
+++ b/gfx/2d/image_operations.h
@@ -26,18 +26,16 @@
 // OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 // SUCH DAMAGE.
 
 #ifndef SKIA_EXT_IMAGE_OPERATIONS_H_
 #define SKIA_EXT_IMAGE_OPERATIONS_H_
 
 #include "skia/SkTypes.h"
 #include "Types.h"
-#include "convolver.h"
-#include "skia/SkRect.h"
 
 class SkBitmap;
 struct SkIRect;
 
 namespace skia {
 
 class ImageOperations {
  public:
@@ -149,137 +147,11 @@ class ImageOperations {
                               void* dest_pixels = nullptr);
 
   // Subpixel renderer.
   static SkBitmap ResizeSubpixel(const SkBitmap& source,
                                  int dest_width, int dest_height,
                                  const SkIRect& dest_subset);
 };
 
-// Returns the ceiling/floor as an integer.
-inline int CeilInt(float val) {
-  return static_cast<int>(ceil(val));
-}
-inline int FloorInt(float val) {
-  return static_cast<int>(floor(val));
-}
-
-// Filter function computation -------------------------------------------------
-
-// Evaluates the box filter, which goes from -0.5 to +0.5.
-inline float EvalBox(float x) {
-  return (x >= -0.5f && x < 0.5f) ? 1.0f : 0.0f;
-}
-
-// Evaluates the Lanczos filter of the given filter size window for the given
-// position.
-//
-// |filter_size| is the width of the filter (the "window"), outside of which
-// the value of the function is 0. Inside of the window, the value is the
-// normalized sinc function:
-//   lanczos(x) = sinc(x) * sinc(x / filter_size);
-// where
-//   sinc(x) = sin(pi*x) / (pi*x);
-inline float EvalLanczos(int filter_size, float x) {
-  if (x <= -filter_size || x >= filter_size)
-    return 0.0f;  // Outside of the window.
-  if (x > -std::numeric_limits<float>::epsilon() &&
-      x < std::numeric_limits<float>::epsilon())
-    return 1.0f;  // Special case the discontinuity at the origin.
-  float xpi = x * static_cast<float>(M_PI);
-  return (sin(xpi) / xpi) *  // sinc(x)
-          sin(xpi / filter_size) / (xpi / filter_size);  // sinc(x/filter_size)
-}
-
-// Evaluates the Hamming filter of the given filter size window for the given
-// position.
-//
-// The filter covers [-filter_size, +filter_size]. Outside of this window
-// the value of the function is 0. Inside of the window, the value is sinus
-// cardinal multiplied by a recentered Hamming function. The traditional
-// Hamming formula for a window of size N and n ranging in [0, N-1] is:
-//   hamming(n) = 0.54 - 0.46 * cos(2 * pi * n / (N-1)))
-// In our case we want the function centered for x == 0 and at its minimum
-// on both ends of the window (x == +/- filter_size), hence the adjusted
-// formula:
-//   hamming(x) = (0.54 -
-//                 0.46 * cos(2 * pi * (x - filter_size)/ (2 * filter_size)))
-//              = 0.54 - 0.46 * cos(pi * x / filter_size - pi)
-//              = 0.54 + 0.46 * cos(pi * x / filter_size)
-inline float EvalHamming(int filter_size, float x) {
-  if (x <= -filter_size || x >= filter_size)
-    return 0.0f;  // Outside of the window.
-  if (x > -std::numeric_limits<float>::epsilon() &&
-      x < std::numeric_limits<float>::epsilon())
-    return 1.0f;  // Special case the sinc discontinuity at the origin.
-  const float xpi = x * static_cast<float>(M_PI);
-
-  return ((sin(xpi) / xpi) *  // sinc(x)
-          (0.54f + 0.46f * cos(xpi / filter_size)));  // hamming(x)
-}
-
-// ResizeFilter ----------------------------------------------------------------
-
-// Encapsulates computation and storage of the filters required for one complete
-// resize operation.
-
-namespace resize {
-
-  // Returns the number of pixels that the filer spans, in filter space (the
-  // destination image).
-  inline float GetFilterSupport(ImageOperations::ResizeMethod method,
-                                float scale) {
-    switch (method) {
-      case ImageOperations::RESIZE_BOX:
-        // The box filter just scales with the image scaling.
-        return 0.5f;  // Only want one side of the filter = /2.
-      case ImageOperations::RESIZE_HAMMING1:
-        // The Hamming filter takes as much space in the source image in
-        // each direction as the size of the window = 1 for Hamming1.
-        return 1.0f;
-      case ImageOperations::RESIZE_LANCZOS2:
-        // The Lanczos filter takes as much space in the source image in
-        // each direction as the size of the window = 2 for Lanczos2.
-        return 2.0f;
-      case ImageOperations::RESIZE_LANCZOS3:
-        // The Lanczos filter takes as much space in the source image in
-        // each direction as the size of the window = 3 for Lanczos3.
-        return 3.0f;
-      default:
-        return 1.0f;
-    }
-  }
-
-  // Computes one set of filters either horizontally or vertically. The caller
-  // will specify the "min" and "max" rather than the bottom/top and
-  // right/bottom so that the same code can be re-used in each dimension.
-  //
-  // |src_depend_lo| and |src_depend_size| gives the range for the source
-  // depend rectangle (horizontally or vertically at the caller's discretion
-  // -- see above for what this means).
-  //
-  // Likewise, the range of destination values to compute and the scale factor
-  // for the transform is also specified.
-  void ComputeFilters(ImageOperations::ResizeMethod method,
-                      int src_size, int dst_size,
-                      int dest_subset_lo, int dest_subset_size,
-                      ConvolutionFilter1D* output);
-
-  // Computes the filter value given the coordinate in filter space.
-  inline float ComputeFilter(ImageOperations::ResizeMethod method, float pos) {
-    switch (method) {
-      case ImageOperations::RESIZE_BOX:
-        return EvalBox(pos);
-      case ImageOperations::RESIZE_HAMMING1:
-        return EvalHamming(1, pos);
-      case ImageOperations::RESIZE_LANCZOS2:
-        return EvalLanczos(2, pos);
-      case ImageOperations::RESIZE_LANCZOS3:
-        return EvalLanczos(3, pos);
-      default:
-        return 0;
-    }
-  }
-}
-
 }  // namespace skia
 
 #endif  // SKIA_EXT_IMAGE_OPERATIONS_H_