Add a version of the skbug6653 unit test that disables explicit resource allocation

We now suspect this bug is in Ganesh, so we're looking to see if this is
related.

Bug: skia:6653
Change-Id: Ic1c61091437903d1ffe0eba4a9f90dae01cedef7
Reviewed-on: https://skia-review.googlesource.com/149440
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/tests/skbug6653.cpp b/tests/skbug6653.cpp
index 0b88a98..1371db4 100644
--- a/tests/skbug6653.cpp
+++ b/tests/skbug6653.cpp
@@ -11,6 +11,7 @@
 #include "SkSurface.h"
 
 #include "GrContext.h"
+#include "GrContextPriv.h"
 #include "GrTest.h"
 #include "Test.h"
 
@@ -29,10 +30,7 @@
                                        kBottomLeft_GrSurfaceOrigin, nullptr);
 }
 
-// Tests that readPixels returns up-to-date results. Demonstrates a bug on Galaxy S6
-// (Mali T760), in MSAA mode.
-DEF_GPUTEST_FOR_RENDERING_CONTEXTS(skbug6653, reporter, ctxInfo) {
-    GrContext* ctx = ctxInfo.grContext();
+static void test_bug_6653(GrContext* ctx, skiatest::Reporter* reporter) {
     SkRect rect = SkRect::MakeWH(50, 50);
 
     SkPaint paint;
@@ -94,3 +92,18 @@
         REPORTER_ASSERT(reporter, match);
     }
 }
+
+// Tests that readPixels returns up-to-date results. This has failed on several GPUs,
+// from multiple vendors, in MSAA mode.
+DEF_GPUTEST_FOR_RENDERING_CONTEXTS(skbug6653, reporter, ctxInfo) {
+    GrContext* ctx = ctxInfo.grContext();
+    test_bug_6653(ctx, reporter);
+}
+
+// Same as above, but without explicit resource allocation.
+DEF_GPUTEST_FOR_RENDERING_CONTEXTS(skbug6653_noExplicitResourceAllocation, reporter, ctxInfo) {
+    GrContext* ctx = ctxInfo.grContext();
+    ctx->flush();
+    ctx->contextPriv().resourceProvider()->testingOnly_setExplicitlyAllocateGPUResources(false);
+    test_bug_6653(ctx, reporter);
+}