Skip to content

Commit

Permalink
Run GrTextureMipMapInvalidationTest on rendering contexts
Browse files Browse the repository at this point in the history
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 <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
  • Loading branch information
brianosman authored and Skia Commit-Bot committed Mar 26, 2019
1 parent 7c59774 commit 7eae5d7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/GrTextureMipMapInvalidationTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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,
Expand Down

0 comments on commit 7eae5d7

Please sign in to comment.