aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2017-10-12 12:27:11 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-10-12 17:02:41 +0000
commit177e695589edb1f776cc5c28b9d3eee244d48284 (patch)
treeeaa617f0300127c65a90a6aea03dc85f7d136d46 /tools
parent18e5cbbe65cc70c6818cc6b135ff45f4653f960b (diff)
Add flag on GrBackendTexture to say whether texture is mipped or not
Bug: skia: Change-Id: Ia684e3daf779ec2feaaec64c04dabf5cb03cd07a Reviewed-on: https://skia-review.googlesource.com/57821 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/gpu/GrTest.cpp8
-rw-r--r--tools/gpu/GrTest.h2
2 files changed, 6 insertions, 4 deletions
diff --git a/tools/gpu/GrTest.cpp b/tools/gpu/GrTest.cpp
index 3a74b6fe54..32e2cfa91d 100644
--- a/tools/gpu/GrTest.cpp
+++ b/tools/gpu/GrTest.cpp
@@ -55,21 +55,23 @@ void SetupAlwaysEvictAtlas(GrContext* context) {
}
GrBackendTexture CreateBackendTexture(GrBackend backend, int width, int height,
- GrPixelConfig config, GrBackendObject handle) {
+ GrPixelConfig config, GrMipMapped mipMapped,
+ GrBackendObject handle) {
switch (backend) {
#ifdef SK_VULKAN
case kVulkan_GrBackend: {
GrVkImageInfo* vkInfo = (GrVkImageInfo*)(handle);
+ SkASSERT((GrMipMapped::kYes == mipMapped) == (vkInfo->fLevelCount > 1));
return GrBackendTexture(width, height, *vkInfo);
}
#endif
case kOpenGL_GrBackend: {
GrGLTextureInfo* glInfo = (GrGLTextureInfo*)(handle);
- return GrBackendTexture(width, height, config, *glInfo);
+ return GrBackendTexture(width, height, config, mipMapped, *glInfo);
}
case kMock_GrBackend: {
GrMockTextureInfo* mockInfo = (GrMockTextureInfo*)(handle);
- return GrBackendTexture(width, height, config, *mockInfo);
+ return GrBackendTexture(width, height, config, mipMapped, *mockInfo);
}
default:
return GrBackendTexture();
diff --git a/tools/gpu/GrTest.h b/tools/gpu/GrTest.h
index d4a4c6dfac..612245f07b 100644
--- a/tools/gpu/GrTest.h
+++ b/tools/gpu/GrTest.h
@@ -19,7 +19,7 @@ namespace GrTest {
void SetupAlwaysEvictAtlas(GrContext*);
GrBackendTexture CreateBackendTexture(GrBackend, int width, int height,
- GrPixelConfig, GrBackendObject);
+ GrPixelConfig, GrMipMapped, GrBackendObject);
};
#endif