diff options
author | Greg Daniel <egdaniel@google.com> | 2017-10-09 15:06:20 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-10-10 16:45:43 +0000 |
commit | 834f12076f703c114173486de6470412d92f6506 (patch) | |
tree | 0cdbc645742e740f3934a96f2cb8b80e6fb62c6d /src/gpu/mtl | |
parent | c5b94988915920ed359eecec34d4fbd6bdc0a3fd (diff) |
Set correct mip map status on GrTexture since we no longer require all mip data
Bug: skia:
Change-Id: I5074028f307187eef3201523cbd1ddc7d9bf9013
Reviewed-on: https://skia-review.googlesource.com/54102
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/mtl')
-rw-r--r-- | src/gpu/mtl/GrMtlGpu.mm | 2 | ||||
-rw-r--r-- | src/gpu/mtl/GrMtlTexture.h | 6 | ||||
-rw-r--r-- | src/gpu/mtl/GrMtlTexture.mm | 11 |
3 files changed, 12 insertions, 7 deletions
diff --git a/src/gpu/mtl/GrMtlGpu.mm b/src/gpu/mtl/GrMtlGpu.mm index a830959bdd..47035f9e0e 100644 --- a/src/gpu/mtl/GrMtlGpu.mm +++ b/src/gpu/mtl/GrMtlGpu.mm @@ -128,7 +128,7 @@ sk_sp<GrTexture> GrMtlGpu::onCreateTexture(const GrSurfaceDesc& desc, SkBudgeted desc, mipLevels); #endif } else { - tex = GrMtlTexture::CreateNewTexture(this, budgeted, desc, mipLevels); + tex = GrMtlTexture::CreateNewTexture(this, budgeted, desc, mipLevels, false); } if (!tex) { diff --git a/src/gpu/mtl/GrMtlTexture.h b/src/gpu/mtl/GrMtlTexture.h index 2d3580ef71..0e5e30c9ac 100644 --- a/src/gpu/mtl/GrMtlTexture.h +++ b/src/gpu/mtl/GrMtlTexture.h @@ -17,7 +17,8 @@ class GrMtlGpu; class GrMtlTexture : public GrTexture { public: static sk_sp<GrMtlTexture> CreateNewTexture(GrMtlGpu*, SkBudgeted budgeted, - const GrSurfaceDesc&, int mipLevels); + const GrSurfaceDesc&, int mipLevels, + bool wasFullMipMapDataProvided); static sk_sp<GrMtlTexture> MakeWrappedTexture(GrMtlGpu*, const GrSurfaceDesc&, GrWrapOwnership); @@ -54,7 +55,8 @@ protected: private: enum Wrapped { kWrapped }; - GrMtlTexture(GrMtlGpu*, SkBudgeted, const GrSurfaceDesc&, id<MTLTexture>, bool isMipMapped); + GrMtlTexture(GrMtlGpu*, SkBudgeted, const GrSurfaceDesc&, id<MTLTexture>, bool isMipMapped, + bool wasFullMipMapDataProvided); // GrMtlTexture(GrMtlGpu*, Wrapped, const GrSurfaceDesc&, GrMtlImage::Wrapped wrapped); id<MTLTexture> fTexture; diff --git a/src/gpu/mtl/GrMtlTexture.mm b/src/gpu/mtl/GrMtlTexture.mm index cdc9b0c195..d66f2ba6be 100644 --- a/src/gpu/mtl/GrMtlTexture.mm +++ b/src/gpu/mtl/GrMtlTexture.mm @@ -12,7 +12,8 @@ #include "GrTexturePriv.h" sk_sp<GrMtlTexture> GrMtlTexture::CreateNewTexture(GrMtlGpu* gpu, SkBudgeted budgeted, - const GrSurfaceDesc& desc, int mipLevels) { + const GrSurfaceDesc& desc, int mipLevels, + bool wasFullMipMapDataProvided) { MTLPixelFormat format; if (!GrPixelConfigToMTLFormat(desc.fConfig, &format)) { return nullptr; @@ -40,7 +41,8 @@ sk_sp<GrMtlTexture> GrMtlTexture::CreateNewTexture(GrMtlGpu* gpu, SkBudgeted bud id<MTLTexture> texture = [gpu->device() newTextureWithDescriptor:descriptor]; - return sk_sp<GrMtlTexture>(new GrMtlTexture(gpu, budgeted, desc, texture, mipLevels > 1)); + return sk_sp<GrMtlTexture>(new GrMtlTexture(gpu, budgeted, desc, texture, mipLevels > 1, + wasFullMipMapDataProvided)); } // This method parallels GrTextureProxy::highestFilterMode @@ -56,10 +58,11 @@ GrMtlTexture::GrMtlTexture(GrMtlGpu* gpu, SkBudgeted budgeted, const GrSurfaceDesc& desc, id<MTLTexture> texture, - bool isMipMapped) + bool isMipMapped, + bool wasFullMipMapDataProvided) : GrSurface(gpu, desc) , INHERITED(gpu, desc, kTexture2DSampler_GrSLType, highest_filter_mode(desc.fConfig), - isMipMapped) + isMipMapped, wasFullMipMapDataProvided) , fTexture(texture) { } |