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-29 16:03:38 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2013-01-29 16:03:38 +0400
commit1a750e00e72c06fc3acf883c436dc147d0626e52 (patch)
tree443143ad698b0ec02d7effaa8e50877fca9f7bb6 /source/blender/editors/space_image/image_draw.c
parentdc727f0256562cb8fc1074fda9b9b7f407496ab2 (diff)
Alpha display changes:
Previous alpha-overing on black for RGB display wasn't so much useful for artists, changed in a way: - Made RGBA display default for node editor backdrop and image editor, so it'll be clear that image does have alpha channel - RGB display will ignore alpha channel completely Reshuffled buttons for RGBA/RGB so now the order is following: RGBA | RGB | Alpha | Z Still to come: startup.blend shall be altered to make RGBA default.
Diffstat (limited to 'source/blender/editors/space_image/image_draw.c')
-rw-r--r--source/blender/editors/space_image/image_draw.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c
index ba4f8287cd7..915036cf70e 100644
--- a/source/blender/editors/space_image/image_draw.c
+++ b/source/blender/editors/space_image/image_draw.c
@@ -514,16 +514,12 @@ 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) {
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
fdrawcheckerboard(x, y, x + ibuf->x * zoomx, y + ibuf->y * zoomy);
}
- 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);
@@ -536,7 +532,8 @@ static void draw_image_buffer(const bContext *C, SpaceImage *sima, ARegion *ar,
IMB_display_buffer_release(cache_handle);
- glDisable(GL_BLEND);
+ if (sima->flag & SI_USE_ALPHA)
+ glDisable(GL_BLEND);
}
/* reset zoom */