Convert GrPorterDuff test from NullGL to Mock context
Bug: skia: Change-Id: Id403aabcae1dbf38e55381bb3b4353e85a12a745 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203705 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
This commit is contained in:
parent
7eae5d74cd
commit
d2ca31218b
@ -68,6 +68,7 @@ struct GrMockOptions {
|
||||
int fMaxVertexSamplers = 0;
|
||||
int fMaxFragmentSamplers = 8;
|
||||
bool fShaderDerivativeSupport = true;
|
||||
bool fDualSourceBlendingSupport = false;
|
||||
|
||||
// GrMockGpu options.
|
||||
bool fFailTextureAllocations = false;
|
||||
|
@ -31,6 +31,7 @@ public:
|
||||
fShaderCaps->fFlatInterpolationSupport = options.fFlatInterpolationSupport;
|
||||
fShaderCaps->fMaxFragmentSamplers = options.fMaxFragmentSamplers;
|
||||
fShaderCaps->fShaderDerivativeSupport = options.fShaderDerivativeSupport;
|
||||
fShaderCaps->fDualSourceBlendingSupport = options.fDualSourceBlendingSupport;
|
||||
|
||||
this->applyOptionsOverrides(contextOptions);
|
||||
}
|
||||
|
@ -27,8 +27,12 @@ static void test_color_opaque_no_coverage(skiatest::Reporter* reporter, const Gr
|
||||
static void test_lcd_coverage(skiatest::Reporter* reporter, const GrCaps& caps);
|
||||
static void test_lcd_coverage_fallback_case(skiatest::Reporter* reporter, const GrCaps& caps);
|
||||
|
||||
DEF_GPUTEST_FOR_NULLGL_CONTEXT(GrPorterDuff, reporter, ctxInfo) {
|
||||
const GrCaps& caps = *ctxInfo.grContext()->priv().getGpu()->caps();
|
||||
DEF_GPUTEST(GrPorterDuff, reporter, /*ctxInfo*/) {
|
||||
GrMockOptions mockOptions;
|
||||
mockOptions.fDualSourceBlendingSupport = true;
|
||||
auto context = GrContext::MakeMock(&mockOptions, GrContextOptions());
|
||||
const GrCaps& caps = *context->priv().getGpu()->caps();
|
||||
|
||||
if (!caps.shaderCaps()->dualSourceBlendingSupport()) {
|
||||
SK_ABORT("Null context does not support dual source blending.");
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user