[Bf-blender-cvs] [d5042c42501] master: Cleanup: remove unused GPU_texture_from_preview function

Campbell Barton noreply at git.blender.org
Mon Jan 13 05:07:15 CET 2020


Commit: d5042c42501c4d12f4e6562c32caaa88e4e6cacd
Author: Campbell Barton
Date:   Mon Jan 13 14:35:04 2020 +1100
Branches: master
https://developer.blender.org/rBd5042c42501c4d12f4e6562c32caaa88e4e6cacd

Cleanup: remove unused GPU_texture_from_preview function

===================================================================

M	source/blender/gpu/GPU_texture.h
M	source/blender/gpu/intern/gpu_texture.c

===================================================================

diff --git a/source/blender/gpu/GPU_texture.h b/source/blender/gpu/GPU_texture.h
index a8e8ca72023..19c7386ad6d 100644
--- a/source/blender/gpu/GPU_texture.h
+++ b/source/blender/gpu/GPU_texture.h
@@ -188,7 +188,6 @@ GPUTexture *GPU_texture_create_buffer(eGPUTextureFormat data_type, const uint bu
 
 GPUTexture *GPU_texture_from_bindcode(int textarget, int bindcode);
 GPUTexture *GPU_texture_from_blender(struct Image *ima, struct ImageUser *iuser, int textarget);
-GPUTexture *GPU_texture_from_preview(struct PreviewImage *prv, int mipmap);
 
 /* movie clip drawing */
 GPUTexture *GPU_texture_from_movieclip(struct MovieClip *clip,
diff --git a/source/blender/gpu/intern/gpu_texture.c b/source/blender/gpu/intern/gpu_texture.c
index 497fc13a2c8..1feb5b7732d 100644
--- a/source/blender/gpu/intern/gpu_texture.c
+++ b/source/blender/gpu/intern/gpu_texture.c
@@ -1072,56 +1072,6 @@ GPUTexture *GPU_texture_from_bindcode(int textarget, int bindcode)
   return tex;
 }
 
-GPUTexture *GPU_texture_from_preview(PreviewImage *prv, int mipmap)
-{
-  GPUTexture *tex = prv->gputexture[0];
-  GLuint bindcode = 0;
-
-  if (tex) {
-    bindcode = tex->bindcode;
-  }
-
-  /* this binds a texture, so that's why we restore it to 0 */
-  if (bindcode == 0) {
-    GPU_create_gl_tex(
-        &bindcode, prv->rect[0], NULL, prv->w[0], prv->h[0], GL_TEXTURE_2D, mipmap, false, NULL);
-  }
-  if (tex) {
-    tex->bindcode = bindcode;
-    glBindTexture(GL_TEXTURE_2D, 0);
-    return tex;
-  }
-
-  tex = MEM_callocN(sizeof(GPUTexture), "GPUTexture");
-  tex->bindcode = bindcode;
-  tex->number = -1;
-  tex->refcount = 1;
-  tex->target = GL_TEXTURE_2D;
-  tex->target_base = GL_TEXTURE_2D;
-  tex->format = -1;
-  tex->components = -1;
-
-  prv->gputexture[0] = tex;
-
-  if (!glIsTexture(tex->bindcode)) {
-    GPU_print_error_debug("Blender Texture Not Loaded");
-  }
-  else {
-    GLint w, h;
-
-    glBindTexture(GL_TEXTURE_2D, tex->bindcode);
-    glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &w);
-    glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &h);
-
-    tex->w = w;
-    tex->h = h;
-  }
-
-  glBindTexture(GL_TEXTURE_2D, 0);
-
-  return tex;
-}
-
 GPUTexture *GPU_texture_create_1d(int w,
                                   eGPUTextureFormat tex_format,
                                   const float *pixels,



More information about the Bf-blender-cvs mailing list