Update blendmode benchmark to allow less than 1000 iterations.

On Mali 400 devices, 1000 iterations is way too many, causing this
benchmark to take five seconds per variation:
http://screen/5AdKPZynP7myjfR

This change should help lighten the load on the tree for older devices.

Change-Id: I3f719093c3f7fdbc81ab41c29ce6d93f36360b7b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/388444
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
diff --git a/bench/BlendmodeBench.cpp b/bench/BlendmodeBench.cpp
index 0154e6e..8eabefd 100644
--- a/bench/BlendmodeBench.cpp
+++ b/bench/BlendmodeBench.cpp
@@ -19,7 +19,7 @@
 public:
     XfermodeBench(SkBlendMode mode, bool aa) : fBlendMode(mode) {
         fAA = aa;
-        fName.printf("blendmode_%s_%s", aa ? "mask" : "rect", SkBlendMode_Name(mode));
+        fName.printf("blendmicro_%s_%s", aa ? "mask" : "rect", SkBlendMode_Name(mode));
     }
 
 protected:
@@ -30,7 +30,7 @@
         size_t len = strlen(text);
         SkISize size = canvas->getBaseLayerSize();
         SkRandom random;
-        for (int i = 0; i < loops; ++i) {
+        while (loops > 0) {
             SkPaint paint;
             paint.setBlendMode(fBlendMode);
             paint.setColor(random.nextU());
@@ -41,9 +41,11 @@
                 SkScalar x = random.nextRangeScalar(0, (SkScalar)size.fWidth),
                          y = random.nextRangeScalar(0, (SkScalar)size.fHeight);
                 auto blob = SkTextBlob::MakeFromText(text, len, font, SkTextEncoding::kUTF8);
-                for (int j = 0; j < 1000; ++j) {
+                int iterations = std::min(1000, loops);
+                for (int j = 0; j < iterations; ++j) {
                     canvas->drawTextBlob(blob, x, y, paint);
                 }
+                loops -= iterations;
             } else {
                 // Draw rects to exercise non-AA code paths.
                 SkScalar w = random.nextRangeScalar(50, 100);
@@ -54,9 +56,11 @@
                     w,
                     h
                 );
-                for (int j = 0; j < 1000; ++j) {
+                int iterations = std::min(1000, loops);
+                for (int j = 0; j < iterations; ++j) {
                     canvas->drawRect(rect, paint);
                 }
+                loops -= iterations;
             }
         }
     }