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-04-27 19:01:17 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2013-04-27 19:01:17 +0400
commitf716eb17e2e89059e79ff6512137146d8f8cd62f (patch)
tree618c9a87b6863224bce16fdb2530cdaa42a8b19e /source/blender/editors/space_sequencer/sequencer_draw.c
parent8069d1ad1af472dc1a7e6fcd34f21c40d24c6d03 (diff)
Some color space issues in sequencer:
Sequencer was always trying to do GLSL color space conversion, not respecting user settings at all. This failed a lot when RGB curves a used in color management settings. Now sequencer will fallback if GLSL can not be used and will also respect user settings (however, draw pixels are not supported, sequencer always uses 2D textures).
Diffstat (limited to 'source/blender/editors/space_sequencer/sequencer_draw.c')
-rw-r--r--source/blender/editors/space_sequencer/sequencer_draw.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index 021972d93a6..81305bca164 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -1060,7 +1060,16 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq
type = GL_UNSIGNED_BYTE;
}
else {
- if (ibuf->rect_float) {
+ bool force_fallback = false;
+
+ force_fallback |= !ELEM(U.image_draw_method, IMAGE_DRAW_METHOD_AUTO, IMAGE_DRAW_METHOD_GLSL);
+ force_fallback |= ibuf->dither != 0.0f;
+
+ if (force_fallback) {
+ /* Fallback to CPU based color space conversion */
+ glsl_used = false;
+ }
+ else if (ibuf->rect_float) {
display_buffer = ibuf->rect_float;
if (ibuf->channels == 4) {
@@ -1096,6 +1105,15 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq
type = GL_UNSIGNED_BYTE;
display_buffer = NULL;
}
+
+ /* there's a data to be displayed, but GLSL is not initialized
+ * properly, in this case we fallback to CPU-based display transform
+ */
+ if ((ibuf->rect || ibuf->rect_float) && !glsl_used) {
+ display_buffer = IMB_display_buffer_acquire_ctx(C, ibuf, &cache_handle);
+ format = GL_RGBA;
+ type = GL_UNSIGNED_BYTE;
+ }
}
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);