Add GrBackendTexture & GrBackendRenderTarget access methods to GrTexture and GrRenderTarget
Change-Id: I627fcc2cab1d04169f49e33a6c17e161e9a9772a
Reviewed-on: https://skia-review.googlesource.com/84621
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/tests/GrMipMappedTest.cpp b/tests/GrMipMappedTest.cpp
index 7caa4bb..58faec4 100644
--- a/tests/GrMipMappedTest.cpp
+++ b/tests/GrMipMappedTest.cpp
@@ -159,21 +159,19 @@
return;
}
- GrBackendObject genBackendObject = genTexture->getTextureHandle();
+ GrBackendTexture genBackendTex = genTexture->getBackendTexture();
- if (kOpenGL_GrBackend == context->contextPriv().getBackend()) {
+ if (const GrGLTextureInfo* genTexInfo = genBackendTex.getGLTextureInfo()) {
const GrGLTextureInfo* origTexInfo = backendTex.getGLTextureInfo();
- GrGLTextureInfo* genTexInfo = (GrGLTextureInfo*)genBackendObject;
if (willUseMips && GrMipMapped::kNo == mipMapped) {
// We did a copy so the texture IDs should be different
REPORTER_ASSERT(reporter, origTexInfo->fID != genTexInfo->fID);
} else {
REPORTER_ASSERT(reporter, origTexInfo->fID == genTexInfo->fID);
}
- } else if (kVulkan_GrBackend == context->contextPriv().getBackend()) {
#ifdef SK_VULKAN
+ } else if (const GrVkImageInfo* genImageInfo = genBackendTex.getVkImageInfo()) {
const GrVkImageInfo* origImageInfo = backendTex.getVkImageInfo();
- GrVkImageInfo* genImageInfo = (GrVkImageInfo*)genBackendObject;
if (willUseMips && GrMipMapped::kNo == mipMapped) {
// We did a copy so the texture IDs should be different
REPORTER_ASSERT(reporter, origImageInfo->fImage != genImageInfo->fImage);
@@ -181,8 +179,6 @@
REPORTER_ASSERT(reporter, origImageInfo->fImage == genImageInfo->fImage);
}
#endif
- } else if (kMetal_GrBackend == context->contextPriv().getBackend()) {
- REPORTER_ASSERT(reporter, false);
} else {
REPORTER_ASSERT(reporter, false);
}