Evas GL common: Avoid excessive pipe flushes in image free
authorJean-Philippe Andre <jp.andre@samsung.com>
Thu, 23 Apr 2015 07:14:22 +0000 (16:14 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Fri, 24 Apr 2015 02:12:30 +0000 (11:12 +0900)
This should boost performance a little bit when an image is
just unref'ed but not deleted (thus doesn't need a pipe flush).

src/modules/evas/engines/gl_common/evas_gl_image.c

index 331c48e8705f58f11a34554b64c415e48e7228b6..d9e8c4befa0542f2768edf9748ff5828a1115109 100644 (file)
@@ -688,9 +688,9 @@ evas_gl_common_image_cache_flush(Evas_Engine_GL_Context *gc)
 EAPI void
 evas_gl_common_image_free(Evas_GL_Image *im)
 {
-   evas_gl_common_context_flush(im->gc);
    im->references--;
    if (im->references > 0) return;
+   evas_gl_common_context_flush(im->gc);
 
    if (im->scaled.origin)
      {