The image resampling code has been transplanted from Chrome; it's incredibly fast.

We've tested this CL plumbed into Chrome and done benchmarking with excellent results.

This CL can land independent of any Chrome changes; it's completely internal to skia.

BUG=
R=reed@google.com

Review URL: https://codereview.chromium.org/19335002

git-svn-id: http://skia.googlecode.com/svn/trunk@10206 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gm/downsamplebitmap.cpp b/gm/downsamplebitmap.cpp
index a59e5b8..e34effa 100644
--- a/gm/downsamplebitmap.cpp
+++ b/gm/downsamplebitmap.cpp
@@ -75,7 +75,7 @@
             curWidth = (int) (fBM.width() * curScale + 2);
             curX += curWidth;
             curScale *= 0.75f;
-        } while (curX < 4*fBM.width());
+        } while (curWidth >= 2 && curX < 4*fBM.width());
     }
 
 private: