Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-06-11 23:34:35 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-06-11 23:35:09 +0300
commit1d111cd046b051efe71c6863b1c4a65233c45ac9 (patch)
tree601e298f7f2400f25527ea8bc4497170d8bbe053 /source/blender/blenkernel/intern/image.c
parent8242a5bc853a74da1273fc7ad4b959ac716c563c (diff)
Revert "Cleanup: remove image->bindcode, always wrap in GPUTexture."
This reverts commit 8242a5bc853a74da1273fc7ad4b959ac716c563c. This isn't quite ready to use yet.
Diffstat (limited to 'source/blender/blenkernel/intern/image.c')
-rw-r--r--source/blender/blenkernel/intern/image.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index b6b3dd31096..c1ecabcfb5a 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -473,6 +473,7 @@ void BKE_image_copy_data(Main *UNUSED(bmain), Image *ima_dst, const Image *ima_s
BLI_listbase_clear(&ima_dst->anims);
for (int i = 0; i < TEXTARGET_COUNT; i++) {
+ ima_dst->bindcode[i] = 0;
ima_dst->gputexture[i] = NULL;
}
@@ -537,14 +538,16 @@ bool BKE_image_scale(Image *image, int width, int height)
return (ibuf != NULL);
}
-bool BKE_image_has_opengl_texture(Image *ima)
+bool BKE_image_has_bindcode(Image *ima)
{
+ bool has_bindcode = false;
for (int i = 0; i < TEXTARGET_COUNT; i++) {
- if (ima->gputexture[i]) {
- return true;
+ if (ima->bindcode[i]) {
+ has_bindcode = true;
+ break;
}
}
- return false;
+ return has_bindcode;
}
static void image_init_color_management(Image *ima)
@@ -927,6 +930,21 @@ void BKE_image_tag_time(Image *ima)
ima->lastused = PIL_check_seconds_timer_i();
}
+#if 0
+static void tag_all_images_time(Main *bmain)
+{
+ Image *ima;
+ int ctime = PIL_check_seconds_timer_i();
+
+ ima = bmain->image.first;
+ while (ima) {
+ if (ima->bindcode || ima->repbind || ima->ibufs.first) {
+ ima->lastused = ctime;
+ }
+ }
+}
+#endif
+
static uintptr_t image_mem_size(Image *image)
{
uintptr_t size = 0;