diff options
author | Greg Daniel <egdaniel@google.com> | 2018-06-13 09:41:19 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-06-13 18:06:56 +0000 |
commit | da86e2822ab31770e989009716dd4c89966ade45 (patch) | |
tree | 66a8fe4ff7e07bd7003f317d0b29a39ebf411790 /src/gpu/gl/GrGLGpu.cpp | |
parent | e141548696bd049b0e520391ff64e64e4e02c55f (diff) |
Remove unused code that was used for late mip allocations.
This also includes removing code to support changing GrGpuResource's size
since we now have to way to ever change the size.
Bug: skia:
Change-Id: Id27a8bc3cc94f5b954beda528b209727ede10ef6
Reviewed-on: https://skia-review.googlesource.com/134503
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/gl/GrGLGpu.cpp')
-rw-r--r-- | src/gpu/gl/GrGLGpu.cpp | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp index 3e2c1b48b8..2c7d977659 100644 --- a/src/gpu/gl/GrGLGpu.cpp +++ b/src/gpu/gl/GrGLGpu.cpp @@ -2905,8 +2905,6 @@ void GrGLGpu::generateMipmaps(const GrSamplerState& params, GrGLTexture* texture } texture->texturePriv().markMipMapsClean(); - texture->texturePriv().setMaxMipMapLevel(SkMipMap::ComputeLevelCount( - texture->width(), texture->height())); // We have potentially set lots of state on the texture. Easiest to dirty it all: texture->textureParamsModified(); @@ -3849,28 +3847,7 @@ bool GrGLGpu::generateMipmap(GrGLTexture* texture, GrSurfaceOrigin textureOrigin int width = texture->width(); int height = texture->height(); int levelCount = SkMipMap::ComputeLevelCount(width, height) + 1; - - // Define all mips, if we haven't previously done so: - if (0 == texture->texturePriv().maxMipMapLevel()) { - GrGLenum internalFormat; - GrGLenum externalFormat; - GrGLenum externalType; - if (!this->glCaps().getTexImageFormats(texture->config(), texture->config(), - &internalFormat, &externalFormat, &externalType)) { - return false; - } - - this->unbindCpuToGpuXferBuffer(); - - for (GrGLint level = 1; level < levelCount; ++level) { - // Define the next mip: - width = SkTMax(1, width / 2); - height = SkTMax(1, height / 2); - GL_ALLOC_CALL(this->glInterface(), TexImage2D(GR_GL_TEXTURE_2D, level, internalFormat, - width, height, 0, - externalFormat, externalType, nullptr)); - } - } + SkASSERT(levelCount == texture->texturePriv().maxMipMapLevel() + 1); // Create (if necessary), then bind temporary FBO: if (0 == fTempDstFBOID) { |