From 6f153046e0ffec912883ab24b9fda823e9fbeb38 Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Sun, 13 Apr 2014 19:03:14 +0300 Subject: Reduce overhead when sampling texture images for brushes. The tests can be cached and reused. --- source/blender/blenkernel/intern/brush.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'source/blender/blenkernel/intern/brush.c') diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c index c34b237f53e..8e611a1e358 100644 --- a/source/blender/blenkernel/intern/brush.c +++ b/source/blender/blenkernel/intern/brush.c @@ -634,15 +634,9 @@ float BKE_brush_sample_tex_3D(const Scene *scene, Brush *br, rgba[2] = intensity; rgba[3] = 1.0f; } - else { - if (br->mtex.tex->type == TEX_IMAGE && br->mtex.tex->ima) { - ImBuf *tex_ibuf = BKE_image_pool_acquire_ibuf(br->mtex.tex->ima, &br->mtex.tex->iuser, pool); - /* For consistency, sampling always returns color in linear space */ - if (tex_ibuf && tex_ibuf->rect_float == NULL) { - IMB_colormanagement_colorspace_to_scene_linear_v3(rgba, tex_ibuf->rect_colorspace); - } - BKE_image_pool_release_ibuf(br->mtex.tex->ima, tex_ibuf, pool); - } + /* For consistency, sampling always returns color in linear space */ + else if (ups->do_linear_conversion) { + IMB_colormanagement_colorspace_to_scene_linear_v3(rgba, ups->colorspace); } return intensity; -- cgit v1.2.3