aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/GrMipMappedTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/GrMipMappedTest.cpp')
-rw-r--r--tests/GrMipMappedTest.cpp37
1 files changed, 0 insertions, 37 deletions
diff --git a/tests/GrMipMappedTest.cpp b/tests/GrMipMappedTest.cpp
index ee4838d2ce..3c47598e38 100644
--- a/tests/GrMipMappedTest.cpp
+++ b/tests/GrMipMappedTest.cpp
@@ -289,40 +289,3 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrImageSnapshotMipMappedTest, reporter, ctxIn
}
}
}
-
-// Test that we don't create a mip mapped texture if the size is 1x1 even if the filter mode is set
-// to use mips. This test passes by not crashing or hitting asserts in code.
-DEF_GPUTEST_FOR_RENDERING_CONTEXTS(Gr1x1TextureMipMappedTest, reporter, ctxInfo) {
- GrContext* context = ctxInfo.grContext();
- if (!context->contextPriv().caps()->mipMapSupport()) {
- return;
- }
-
- // Make surface to draw into
- SkImageInfo info = SkImageInfo::MakeN32(16, 16, kPremul_SkAlphaType);
- sk_sp<SkSurface> surface = SkSurface::MakeRenderTarget(context, SkBudgeted::kNo, info);
-
- // Make 1x1 raster bitmap
- SkBitmap bmp;
- bmp.allocN32Pixels(1, 1);
- SkPMColor* pixel = reinterpret_cast<SkPMColor*>(bmp.getPixels());
- *pixel = 0;
-
- sk_sp<SkImage> bmpImage = SkImage::MakeFromBitmap(bmp);
-
- // Make sure we scale so we don't optimize out the use of mips.
- surface->getCanvas()->scale(0.5f, 0.5f);
-
- SkPaint paint;
- // This should upload the image to a non mipped GrTextureProxy.
- surface->getCanvas()->drawImage(bmpImage, 0, 0, &paint);
- surface->flush();
-
- // Now set the filter quality to high so we use mip maps. We should find the non mipped texture
- // in the cache for the SkImage. Since the texture is 1x1 we should just use that texture
- // instead of trying to do a copy to a mipped texture.
- paint.setFilterQuality(kHigh_SkFilterQuality);
- surface->getCanvas()->drawImage(bmpImage, 0, 0, &paint);
- surface->flush();
-}
-