add method to compute max count for a given buffer size in the bitmap shader.
fix bug in quad loop of fill_sequential where we were going one quad too far.



git-svn-id: http://skia.googlecode.com/svn/trunk@322 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/core/SkBitmapProcState.h b/src/core/SkBitmapProcState.h
index 2790a6c..9db62f0 100644
--- a/src/core/SkBitmapProcState.h
+++ b/src/core/SkBitmapProcState.h
@@ -91,6 +91,16 @@
      */
     void platformProcs();
 
+    /** Given the size of a buffer, to be used for calling the matrix and
+        sample procs, this return the maximum count that can be stored in the
+        buffer, taking into account that filtering and scale-vs-affine affect
+        this value.
+     
+        Only valid to call after chooseProcs (setContext) has been called. It is
+        safe to call this inside the shader's shadeSpan() method.
+     */
+    int maxCountForBufferSize(size_t bufferSize) const;
+
 private:
     friend class SkBitmapProcShader;