diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-12-18 13:20:07 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-12-18 13:25:46 +0400 |
commit | 6e77dfeb1acc40cda7fee2b3f7f9d6497f4e7c19 (patch) | |
tree | aa5d5c027620a0f461d8b446caa8bdddcbc41125 /source | |
parent | 6f4515b614ea7f667dcb4b0b5eea6f6d7b4c495f (diff) |
Color management: get rid of original byte buffer partial update
It was only used by opengl render and in fact it needed just to
set DISPLAY_BUFFER_INVALID flag for the image buffer.
In theory it wouldn't make any change to opengl render speed
(because this change just moved rect_from_float from color
management code to image save code). And could not see any speed
changes on my laptop.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/compositor/operations/COM_ViewerOperation.cpp | 2 | ||||
-rw-r--r-- | source/blender/editors/render/render_internal.c | 2 | ||||
-rw-r--r-- | source/blender/editors/render/render_opengl.c | 8 | ||||
-rw-r--r-- | source/blender/imbuf/IMB_colormanagement.h | 3 | ||||
-rw-r--r-- | source/blender/imbuf/intern/colormanagement.c | 19 |
5 files changed, 6 insertions, 28 deletions
diff --git a/source/blender/compositor/operations/COM_ViewerOperation.cpp b/source/blender/compositor/operations/COM_ViewerOperation.cpp index 13b50910b50..8997f7bb436 100644 --- a/source/blender/compositor/operations/COM_ViewerOperation.cpp +++ b/source/blender/compositor/operations/COM_ViewerOperation.cpp @@ -171,7 +171,7 @@ void ViewerOperation::updateImage(rcti *rect) { IMB_partial_display_buffer_update(this->m_ibuf, this->m_outputBuffer, NULL, getWidth(), 0, 0, this->m_viewSettings, this->m_displaySettings, - rect->xmin, rect->ymin, rect->xmax, rect->ymax, false); + rect->xmin, rect->ymin, rect->xmax, rect->ymax); this->updateDraw(); } diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index 7ecada993e2..091dc11f500 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -192,7 +192,7 @@ static void image_buffer_rect_update(Scene *scene, RenderResult *rr, ImBuf *ibuf IMB_partial_display_buffer_update(ibuf, rectf, NULL, linear_stride, linear_offset_x, linear_offset_y, &scene->view_settings, &scene->display_settings, - rxmin, rymin, rxmin + xmax, rymin + ymax, false); + rxmin, rymin, rxmin + xmax, rymin + ymax); } /* ****************************** render invoking ***************** */ diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index 107674babdd..a95e36d6480 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -298,13 +298,7 @@ static void screen_opengl_render_apply(OGLRender *oglrender) ibuf = BKE_image_acquire_ibuf(oglrender->ima, &oglrender->iuser, &lock); if (ibuf) { - /* update display buffer */ - if (ibuf->rect == NULL) - imb_addrectImBuf(ibuf); - - IMB_partial_display_buffer_update(ibuf, rr->rectf, rect, rr->rectx, 0, 0, - &scene->view_settings, &scene->display_settings, - 0, 0, rr->rectx, rr->recty, true); + ibuf->userflags |= IB_DISPLAY_BUFFER_INVALID; /* write file for animation */ if (oglrender->write_still) { diff --git a/source/blender/imbuf/IMB_colormanagement.h b/source/blender/imbuf/IMB_colormanagement.h index 7e115b265de..98962f73b73 100644 --- a/source/blender/imbuf/IMB_colormanagement.h +++ b/source/blender/imbuf/IMB_colormanagement.h @@ -155,8 +155,7 @@ void IMB_colormanagement_colorspace_items_add(struct EnumPropertyItem **items, i void IMB_partial_display_buffer_update(struct ImBuf *ibuf, const float *linear_buffer, const unsigned char *buffer_byte, int stride, int offset_x, int offset_y, const struct ColorManagedViewSettings *view_settings, const struct ColorManagedDisplaySettings *display_settings, - int xmin, int ymin, int xmax, int ymax, - bool update_orig_byte_buffer); + int xmin, int ymin, int xmax, int ymax); void IMB_partial_display_buffer_update_delayed(struct ImBuf *ibuf, int xmin, int ymin, int xmax, int ymax); diff --git a/source/blender/imbuf/intern/colormanagement.c b/source/blender/imbuf/intern/colormanagement.c index 6047b1696bb..91d558c9aed 100644 --- a/source/blender/imbuf/intern/colormanagement.c +++ b/source/blender/imbuf/intern/colormanagement.c @@ -2055,8 +2055,7 @@ unsigned char *IMB_display_buffer_acquire(ImBuf *ibuf, const ColorManagedViewSet IMB_partial_display_buffer_update(ibuf, ibuf->rect_float, (unsigned char *) ibuf->rect, ibuf->x, 0, 0, applied_view_settings, display_settings, ibuf->invalid_rect.xmin, ibuf->invalid_rect.ymin, - ibuf->invalid_rect.xmax, ibuf->invalid_rect.ymax, - false); + ibuf->invalid_rect.xmax, ibuf->invalid_rect.ymax); } BLI_rcti_init(&ibuf->invalid_rect, 0, 0, 0, 0); @@ -2769,22 +2768,8 @@ static void partial_buffer_update_rect(ImBuf *ibuf, unsigned char *display_buffe void IMB_partial_display_buffer_update(ImBuf *ibuf, const float *linear_buffer, const unsigned char *byte_buffer, int stride, int offset_x, int offset_y, const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings, - int xmin, int ymin, int xmax, int ymax, bool update_orig_byte_buffer) + int xmin, int ymin, int xmax, int ymax) { - if ((ibuf->rect && ibuf->rect_float) || update_orig_byte_buffer) { - /* update byte buffer created by legacy color management */ - - unsigned char *rect = (unsigned char *) ibuf->rect; - int channels = ibuf->channels; - int width = xmax - xmin; - int height = ymax - ymin; - int rect_index = (ymin * ibuf->x + xmin) * 4; - int linear_index = ((ymin - offset_y) * stride + (xmin - offset_x)) * channels; - - IMB_buffer_byte_from_float(rect + rect_index, linear_buffer + linear_index, channels, ibuf->dither, - IB_PROFILE_SRGB, IB_PROFILE_LINEAR_RGB, TRUE, width, height, ibuf->x, stride); - } - if (ibuf->display_buffer_flags) { ColormanageCacheViewSettings cache_view_settings; ColormanageCacheDisplaySettings cache_display_settings; |