diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-01-29 16:03:38 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-01-29 16:03:38 +0400 |
commit | 1a750e00e72c06fc3acf883c436dc147d0626e52 (patch) | |
tree | 443143ad698b0ec02d7effaa8e50877fca9f7bb6 /source/blender/editors | |
parent | dc727f0256562cb8fc1074fda9b9b7f407496ab2 (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')
-rw-r--r-- | source/blender/editors/space_image/image_draw.c | 13 | ||||
-rw-r--r-- | source/blender/editors/space_image/space_image.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 8 | ||||
-rw-r--r-- | source/blender/editors/space_node/space_node.c | 2 |
4 files changed, 7 insertions, 18 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 */ diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index 1c384ef38d7..35ba83a8bc6 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -152,7 +152,7 @@ static SpaceLink *image_new(const bContext *UNUSED(C)) simage->spacetype = SPACE_IMAGE; simage->zoom = 1.0f; simage->lock = TRUE; - simage->flag = SI_SHOW_GPENCIL; + simage->flag = SI_SHOW_GPENCIL | SI_USE_ALPHA; simage->iuser.ok = TRUE; simage->iuser.fie_ima = 2; diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index cca1858f112..1ec77bf58ed 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -3283,17 +3283,9 @@ void draw_nodespace_back_pix(const bContext *C, ARegion *ar, SpaceNode *snode) else { glPixelZoom(snode->zoom, snode->zoom); - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - - glColor4f(0.0f, 0.0f, 0.0f, 1.0f); - glRecti(x, y, x + ibuf->x * snode->zoom, y + ibuf->y * snode->zoom); - glaDrawPixelsSafe(x, y, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, display_buffer); glPixelZoom(1.0f, 1.0f); - - glDisable(GL_BLEND); } } diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c index 513f6b43e9a..a5f6ca9ded0 100644 --- a/source/blender/editors/space_node/space_node.c +++ b/source/blender/editors/space_node/space_node.c @@ -119,7 +119,7 @@ static SpaceLink *node_new(const bContext *UNUSED(C)) snode = MEM_callocN(sizeof(SpaceNode), "initnode"); snode->spacetype = SPACE_NODE; - snode->flag = SNODE_SHOW_GPENCIL; + snode->flag = SNODE_SHOW_GPENCIL | SNODE_USE_ALPHA; /* backdrop */ snode->zoom = 1.0f; |