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:
authorSergey Sharybin <sergey.vfx@gmail.com>2013-01-08 19:34:33 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2013-01-08 19:34:33 +0400
commit0c1d1e6c30e8f11834d401b46bdc2018a4e942d9 (patch)
tree0272e125ae8e03fc0331052733481a113cd5f012 /source/blender/editors/space_image
parent472595f1d3533f143bdc84700b26f20a7b2ba1c1 (diff)
Alpha-over images on a black background when in RGB display mode
This is actually a bit arbitrary decision and mainly it preserves compatibility with how images were displaying in previous releases. In fact, we actually would need to think about configurable backdrop color and blending mode to be used for display in RGB mode.
Diffstat (limited to 'source/blender/editors/space_image')
-rw-r--r--source/blender/editors/space_image/image_draw.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c
index 0534b9f4ffd..7b4814d1ab2 100644
--- a/source/blender/editors/space_image/image_draw.c
+++ b/source/blender/editors/space_image/image_draw.c
@@ -514,11 +514,15 @@ static void draw_image_buffer(const bContext *C, SpaceImage *sima, ARegion *ar,
unsigned char *display_buffer;
void *cache_handle;
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
if (sima->flag & SI_USE_ALPHA) {
fdrawcheckerboard(x, y, x + ibuf->x * zoomx, y + ibuf->y * zoomy);
-
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ }
+ else {
+ glColor4f(0.0f, 0.0f, 0.0f, 1.0f);
+ glRecti(x, y, x + ibuf->x * zoomx, y + ibuf->y * zoomy);
}
display_buffer = IMB_display_buffer_acquire_ctx(C, ibuf, &cache_handle);
@@ -532,8 +536,7 @@ static void draw_image_buffer(const bContext *C, SpaceImage *sima, ARegion *ar,
IMB_display_buffer_release(cache_handle);
- if (sima->flag & SI_USE_ALPHA)
- glDisable(GL_BLEND);
+ glDisable(GL_BLEND);
}
/* reset zoom */