Fix PictureTest for new GPU veto
authorjvanverth <jvanverth@google.com>
Tue, 4 Nov 2014 16:50:15 +0000 (08:50 -0800)
committerCommit bot <commit-bot@chromium.org>
Tue, 4 Nov 2014 16:50:16 +0000 (08:50 -0800)
NOTREECHECKS=true

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

tests/PictureTest.cpp

index ea32805b49eed76c4c63d77c2f7385e712d114ad..1dc37e32edd99f60ea8e7b9cf55d4069cd7b9c22 100644 (file)
@@ -786,7 +786,29 @@ static void test_gpu_veto(skiatest::Reporter* reporter) {
         }
     }
     picture.reset(recorder.endRecording());
-    // A lot of AA concave paths currently render an SkPicture undesireable for GPU rendering
+    // A lot of small AA concave paths should be fine for GPU rendering
+    REPORTER_ASSERT(reporter, picture->suitableForGpuRasterization(NULL));
+
+    canvas = recorder.beginRecording(100, 100);
+    {
+        SkPath path;
+
+        path.moveTo(0, 0);
+        path.lineTo(0, 100);
+        path.lineTo(50, 50);
+        path.lineTo(100, 100);
+        path.lineTo(100, 0);
+        path.close();
+        REPORTER_ASSERT(reporter, !path.isConvex());
+
+        SkPaint paint;
+        paint.setAntiAlias(true);
+        for (int i = 0; i < 50; ++i) {
+            canvas->drawPath(path, paint);
+        }
+    }
+    picture.reset(recorder.endRecording());
+    // A lot of large AA concave paths currently render an SkPicture undesireable for GPU rendering
     REPORTER_ASSERT(reporter, !picture->suitableForGpuRasterization(NULL));
 
     canvas = recorder.beginRecording(100, 100);