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:
authorAntony Riakiotakis <kalast@gmail.com>2014-04-13 20:03:14 +0400
committerAntony Riakiotakis <kalast@gmail.com>2014-04-13 20:03:14 +0400
commit6f153046e0ffec912883ab24b9fda823e9fbeb38 (patch)
tree9a0d2705acdfe2a920eeaaeb0a0924cc9bf65e37 /source/blender/blenkernel/intern/brush.c
parent5d79c2662e043c35feeb4a31f3c5eb288e93c9c1 (diff)
Reduce overhead when sampling texture images for brushes. The tests can
be cached and reused.
Diffstat (limited to 'source/blender/blenkernel/intern/brush.c')
-rw-r--r--source/blender/blenkernel/intern/brush.c12
1 files changed, 3 insertions, 9 deletions
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;