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>
This commit is contained in:
Brian Osman 2018-08-27 10:02:00 -04:00 committed by Skia Commit-Bot
parent cd700e9ab7
commit dd04bec39c

View File

@ -11,6 +11,7 @@
#include "SkSurface.h"
#include "GrContext.h"
#include "GrContextPriv.h"
#include "GrTest.h"
#include "Test.h"
@ -29,10 +30,7 @@ static sk_sp<SkSurface> make_surface(GrContext* context) {
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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(skbug6653, reporter, ctxInfo) {
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);
}