diff options
author | Greg Daniel <egdaniel@google.com> | 2017-10-23 16:05:23 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-10-23 20:25:59 +0000 |
commit | e252f08982b0c747cd4d34c00ce413ab1005e99a (patch) | |
tree | 1fde0a4ac30cf4dc1fc752ef39fc2a0b905be210 /src/gpu/GrTexture.cpp | |
parent | 33397f279393a33eff8e32d47fc56be86b86c9bc (diff) |
Add hint to SkSurface::MakeRenderTarget that we will use mips
Additionally this changed triggered a cascade of plumbing GrMipMapped
down throughout Ganesh.
Bug: skia:
Change-Id: I4181f44d9046d66139bb491c7abf86703305aaeb
Reviewed-on: https://skia-review.googlesource.com/63000
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/GrTexture.cpp')
-rw-r--r-- | src/gpu/GrTexture.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gpu/GrTexture.cpp b/src/gpu/GrTexture.cpp index b0dba5142e..b4cefb0174 100644 --- a/src/gpu/GrTexture.cpp +++ b/src/gpu/GrTexture.cpp @@ -37,7 +37,7 @@ void GrTexture::markMipMapsClean() { size_t GrTexture::onGpuMemorySize() const { return GrSurface::ComputeSize(this->config(), this->width(), this->height(), 1, - this->texturePriv().hasMipMaps(), false); + this->texturePriv().mipMapped(), false); } ///////////////////////////////////////////////////////////////////////////// @@ -84,12 +84,12 @@ void GrTexture::computeScratchKey(GrScratchKey* key) const { } GrTexturePriv::ComputeScratchKey(this->config(), this->width(), this->height(), SkToBool(rt), sampleCount, - this->texturePriv().hasMipMaps(), key); + this->texturePriv().mipMapped(), key); } void GrTexturePriv::ComputeScratchKey(GrPixelConfig config, int width, int height, bool isRenderTarget, int sampleCnt, - bool isMipMapped, GrScratchKey* key) { + GrMipMapped mipMapped, GrScratchKey* key) { static const GrScratchKey::ResourceType kType = GrScratchKey::GenerateResourceType(); uint32_t flags = isRenderTarget; @@ -100,16 +100,17 @@ void GrTexturePriv::ComputeScratchKey(GrPixelConfig config, int width, int heigh SkASSERT(static_cast<int>(config) < (1 << 5)); SkASSERT(sampleCnt < (1 << 8)); SkASSERT(flags < (1 << 10)); + SkASSERT(static_cast<int>(mipMapped) <= 1); GrScratchKey::Builder builder(key, kType, 3); builder[0] = width; builder[1] = height; - builder[2] = config | (isMipMapped << 5) | (sampleCnt << 6) | (flags << 14); + builder[2] = config | (static_cast<uint8_t>(mipMapped) << 5) | (sampleCnt << 6) | (flags << 14); } void GrTexturePriv::ComputeScratchKey(const GrSurfaceDesc& desc, GrScratchKey* key) { // Note: the fOrigin field is not used in the scratch key return ComputeScratchKey(desc.fConfig, desc.fWidth, desc.fHeight, SkToBool(desc.fFlags & kRenderTarget_GrSurfaceFlag), desc.fSampleCnt, - false, key); + GrMipMapped::kNo, key); } |