From ce7bde967700fc9702cab1425c39a0cfb7a094b2 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sun, 17 Mar 2013 16:54:06 +0000 Subject: Feature: Image Editor and 3D view background image now use new automatic switching for drawing GPU texture or OpenGL DrawPixels too. For large zoomed images it gives massive speedup. --- source/blender/editors/space_image/image_draw.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'source/blender/editors/space_image') diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c index cae71885b87..5ae6ac8a54b 100644 --- a/source/blender/editors/space_image/image_draw.c +++ b/source/blender/editors/space_image/image_draw.c @@ -491,6 +491,8 @@ static void draw_image_buffer(const bContext *C, SpaceImage *sima, ARegion *ar, /* set zoom */ glPixelZoom(zoomx, zoomy); + glaDefine2DArea(&ar->winrct); + /* find window pixel coordinates of origin */ UI_view2d_to_region_no_clip(&ar->v2d, fx, fy, &x, &y); @@ -523,11 +525,7 @@ static void draw_image_buffer(const bContext *C, SpaceImage *sima, ARegion *ar, display_buffer = IMB_display_buffer_acquire_ctx(C, ibuf, &cache_handle); if (display_buffer) - glaDrawPixelsSafe(x, y, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, display_buffer); -#if 0 - else - glaDrawPixelsSafe(x, y, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_FLOAT, ibuf->rect_float); -#endif + glaDrawPixelsAuto(x, y, ibuf->x, ibuf->y, GL_UNSIGNED_BYTE, display_buffer); IMB_display_buffer_release(cache_handle); -- cgit v1.2.3