summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-01-22 18:21:44 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-01-22 18:22:17 +0900
commit02594a25199c377fd9eb73d071d33500e88443e3 (patch)
treefc2360db75eefad9295bf3b24fbc11d86b0211de /src/modules
parent04ba5a3b994d0e513fefa2888e69ee6ffb919fc4 (diff)
Evas masking: Simplify ref/unref code
Those masks are always render surfaces so we should treat them as such. Plus, there are proper functions to ref/unref GL images.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/evas/engines/gl_generic/evas_engine.c42
1 files changed, 6 insertions, 36 deletions
diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c b/src/modules/evas/engines/gl_generic/evas_engine.c
index 198b6384a8..e280fddf91 100644
--- a/src/modules/evas/engines/gl_generic/evas_engine.c
+++ b/src/modules/evas/engines/gl_generic/evas_engine.c
@@ -1696,34 +1696,19 @@ eng_context_flush(void *data)
1696} 1696}
1697 1697
1698static void 1698static void
1699eng_context_clip_image_unset(void *data, void *context) 1699eng_context_clip_image_unset(void *data EINA_UNUSED, void *context)
1700{ 1700{
1701 RGBA_Draw_Context *ctx = context; 1701 RGBA_Draw_Context *ctx = context;
1702 Evas_GL_Image *im = ctx->clip.mask; 1702 Evas_GL_Image *im = ctx->clip.mask;
1703 1703
1704 if (EINA_UNLIKELY(im && im->im)) 1704 if (im)
1705 { 1705 evas_gl_common_image_free(im);
1706#ifdef EVAS_CSERVE2
1707 if (evas_cserve2_use_get())
1708 evas_cache2_image_close(&im->im->cache_entry);
1709 else
1710#endif
1711 evas_cache_image_drop(&im->im->cache_entry);
1712 // Is the above code safe? Hmmm...
1713 //evas_unref_queue_image_put(EVAS???, &ctx->clip.ie->cache_entry);
1714 }
1715 else if (im)
1716 {
1717 im->references--;
1718 if (!im->references)
1719 eng_image_free(data, im);
1720 }
1721 1706
1722 ctx->clip.mask = NULL; 1707 ctx->clip.mask = NULL;
1723} 1708}
1724 1709
1725static void 1710static void
1726eng_context_clip_image_set(void *data EINA_UNUSED, void *context, void *surface, int x, int y) 1711eng_context_clip_image_set(void *data, void *context, void *surface, int x, int y)
1727{ 1712{
1728 RGBA_Draw_Context *ctx = context; 1713 RGBA_Draw_Context *ctx = context;
1729 Evas_GL_Image *im = surface; 1714 Evas_GL_Image *im = surface;
@@ -1741,24 +1726,9 @@ eng_context_clip_image_set(void *data EINA_UNUSED, void *context, void *surface,
1741 ctx->clip.mask_x = x; 1726 ctx->clip.mask_x = x;
1742 ctx->clip.mask_y = y; 1727 ctx->clip.mask_y = y;
1743 1728
1744 if (EINA_UNLIKELY(im && im->im)) 1729 if (im)
1745 {
1746 // Unlikely to happen because masks are render surfaces.
1747 if (!noinc)
1748 {
1749#ifdef EVAS_CSERVE2
1750 if (evas_cserve2_use_get())
1751 evas_cache2_image_ref(&im->im->cache_entry);
1752 else
1753#endif
1754 evas_cache_image_ref(&im->im->cache_entry);
1755 }
1756 RECTS_CLIP_TO_RECT(ctx->clip.x, ctx->clip.y, ctx->clip.w, ctx->clip.h,
1757 x, y, im->im->cache_entry.w, im->im->cache_entry.h);
1758 }
1759 else if (im)
1760 { 1730 {
1761 if (!noinc) im->references++; 1731 if (!noinc) evas_gl_common_image_ref(im);
1762 RECTS_CLIP_TO_RECT(ctx->clip.x, ctx->clip.y, ctx->clip.w, ctx->clip.h, 1732 RECTS_CLIP_TO_RECT(ctx->clip.x, ctx->clip.y, ctx->clip.w, ctx->clip.h,
1763 x, y, im->w, im->h); 1733 x, y, im->w, im->h);
1764 } 1734 }