diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-03-20 17:56:09 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-03-20 17:56:09 +0300 |
commit | 62b31a6e997ca6ca10cad695252909c657d67401 (patch) | |
tree | e153c9e5d228873933858fbf8a9f4d2c34e1d96f /source/blender/editors/space_image | |
parent | 339e43e1e821276cf69c0f9829c83999bf79d769 (diff) |
Avoid per-draw allocation when drawing currently rendering tiles
Diffstat (limited to 'source/blender/editors/space_image')
-rw-r--r-- | source/blender/editors/space_image/image_draw.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c index d03f3c157a9..517cf64214c 100644 --- a/source/blender/editors/space_image/image_draw.c +++ b/source/blender/editors/space_image/image_draw.c @@ -106,9 +106,10 @@ static void draw_render_info(const bContext *C, if (re) { int total_tiles; + bool need_free_tiles; rcti *tiles; - RE_engine_get_current_tiles(re, &total_tiles, &tiles); + tiles = RE_engine_get_current_tiles(re, &total_tiles, &need_free_tiles); if (total_tiles) { int i, x, y; @@ -133,7 +134,9 @@ static void draw_render_info(const bContext *C, glaDrawBorderCorners(tile, zoomx, zoomy); } - MEM_freeN(tiles); + if (need_free_tiles) { + MEM_freeN(tiles); + } glPopMatrix(); } |