From 7eae5d74cd1eeb67e0034a435386ac72d5873811 Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Tue, 26 Mar 2019 11:21:55 -0400 Subject: [PATCH] Run GrTextureMipMapInvalidationTest on rendering contexts The logic being tested is implemented in the various Gr*Gpu classes, so running it on the NullGL context seems like an oversight. Bug: skia: Change-Id: I629010f0abde9347f06602a6b8774df7a19a3da7 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203704 Commit-Queue: Brian Osman Reviewed-by: Robert Phillips --- tests/GrTextureMipMapInvalidationTest.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/GrTextureMipMapInvalidationTest.cpp b/tests/GrTextureMipMapInvalidationTest.cpp index 465721e3ce8f2..d651e35cdeb1e 100644 --- a/tests/GrTextureMipMapInvalidationTest.cpp +++ b/tests/GrTextureMipMapInvalidationTest.cpp @@ -14,7 +14,12 @@ #include "Test.h" // Tests that MIP maps are created and invalidated as expected when drawing to and from GrTextures. -DEF_GPUTEST_FOR_NULLGL_CONTEXT(GrTextureMipMapInvalidationTest, reporter, ctxInfo) { +DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrTextureMipMapInvalidationTest, reporter, ctxInfo) { + GrContext* context = ctxInfo.grContext(); + if (!context->priv().caps()->mipMapSupport()) { + return; + } + auto isMipped = [] (SkSurface* surf) { const GrTexture* texture = surf->makeImageSnapshot()->getTexture(); return GrMipMapped::kYes == texture->texturePriv().mipMapped(); @@ -24,7 +29,6 @@ DEF_GPUTEST_FOR_NULLGL_CONTEXT(GrTextureMipMapInvalidationTest, reporter, ctxInf return surf->makeImageSnapshot()->getTexture()->texturePriv().mipMapsAreDirty(); }; - GrContext* context = ctxInfo.grContext(); auto info = SkImageInfo::MakeN32Premul(256, 256); for (auto allocateMips : {false, true}) { auto surf1 = SkSurface::MakeRenderTarget(context, SkBudgeted::kYes, info, 0,