diff options
author | Greg Daniel <egdaniel@google.com> | 2017-10-12 12:27:11 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-10-12 17:02:41 +0000 |
commit | 177e695589edb1f776cc5c28b9d3eee244d48284 (patch) | |
tree | eaa617f0300127c65a90a6aea03dc85f7d136d46 /src/gpu/GrBackendSurface.cpp | |
parent | 18e5cbbe65cc70c6818cc6b135ff45f4653f960b (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 'src/gpu/GrBackendSurface.cpp')
-rw-r--r-- | src/gpu/GrBackendSurface.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gpu/GrBackendSurface.cpp b/src/gpu/GrBackendSurface.cpp index 04216b7508..67cc634ce0 100644 --- a/src/gpu/GrBackendSurface.cpp +++ b/src/gpu/GrBackendSurface.cpp @@ -19,6 +19,7 @@ GrBackendTexture::GrBackendTexture(int width, : fWidth(width) , fHeight(height) , fConfig(GrVkFormatToPixelConfig(vkInfo.fFormat)) + , fMipMapped(GrBoolToMipMapped(vkInfo.fLevelCount > 1)) , fBackend(kVulkan_GrBackend) , fVkInfo(vkInfo) {} #endif @@ -27,9 +28,17 @@ GrBackendTexture::GrBackendTexture(int width, int height, GrPixelConfig config, const GrGLTextureInfo& glInfo) + : GrBackendTexture(width, height, config, GrMipMapped::kNo, glInfo) {} + +GrBackendTexture::GrBackendTexture(int width, + int height, + GrPixelConfig config, + GrMipMapped mipMapped, + const GrGLTextureInfo& glInfo) : fWidth(width) , fHeight(height) , fConfig(config) + , fMipMapped(mipMapped) , fBackend(kOpenGL_GrBackend) , fGLInfo(glInfo) {} @@ -37,9 +46,17 @@ GrBackendTexture::GrBackendTexture(int width, int height, GrPixelConfig config, const GrMockTextureInfo& mockInfo) + : GrBackendTexture(width, height, config, GrMipMapped::kNo, mockInfo) {} + +GrBackendTexture::GrBackendTexture(int width, + int height, + GrPixelConfig config, + GrMipMapped mipMapped, + const GrMockTextureInfo& mockInfo) : fWidth(width) , fHeight(height) , fConfig(config) + , fMipMapped(mipMapped) , fBackend(kMock_GrBackend) , fMockInfo(mockInfo) {} |