diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-04-01 16:08:43 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-04-01 16:08:43 +0400 |
commit | daa1e5bff20d7b750daaf34cddf845943518797f (patch) | |
tree | b27767eee405f06b959e7eed0e933a6c8d1db871 | |
parent | 5d234f0a0bafddb82d4904abb90fa069d71db2cd (diff) |
Fix for GLSL display: NULL view_settings are allowed now
Currently no functional changes for users, but this change
is crucial for further GLSL images display.
-rw-r--r-- | source/blender/imbuf/intern/colormanagement.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/source/blender/imbuf/intern/colormanagement.c b/source/blender/imbuf/intern/colormanagement.c index 6c33f6e3e33..200dcd3d1a7 100644 --- a/source/blender/imbuf/intern/colormanagement.c +++ b/source/blender/imbuf/intern/colormanagement.c @@ -2753,12 +2753,27 @@ static void update_glsl_display_processor(const ColorManagedViewSettings *view_s int IMB_coloemanagement_setup_glsl_draw(const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings) { + ColorManagedViewSettings default_view_settings; + const ColorManagedViewSettings *applied_view_settings; + + if (view_settings) { + applied_view_settings = view_settings; + } + else { + /* if no view settings were specified, use default display transformation + * this happens for images which don't want to be displayed with render settings + */ + + init_default_view_settings(display_settings, &default_view_settings); + applied_view_settings = &default_view_settings; + } + /* RGB curves mapping is not supported on GPU yet. */ - if (view_settings->flag & COLORMANAGE_VIEW_USE_CURVES) + if (applied_view_settings->flag & COLORMANAGE_VIEW_USE_CURVES) return FALSE; /* Make sure OCIO processor is up-to-date. */ - update_glsl_display_processor(view_settings, display_settings); + update_glsl_display_processor(applied_view_settings, display_settings); OCIO_setupGLSLDraw(&global_glsl_state.ocio_glsl_state, global_glsl_state.processor); |