summaryrefslogtreecommitdiff
path: root/libview/ev-pixbuf-cache.c
diff options
context:
space:
mode:
authorCarlos Garcia Campos <[email protected]>2013-06-21 20:53:00 +0200
committerraveit65 <[email protected]>2017-09-06 18:25:34 +0200
commitac8e6d76c49514be24ff6aa3e2db76b862483371 (patch)
tree7f28712bedd595669c36ececd283de59c37a90de /libview/ev-pixbuf-cache.c
parent2a5caa32b6a98cf6a0e34c8f5ec79f94060932b3 (diff)
downloadatril-ac8e6d76c49514be24ff6aa3e2db76b862483371.tar.bz2
atril-ac8e6d76c49514be24ff6aa3e2db76b862483371.tar.xz
libview: Use GSlice to allocate EvViewSelection
These structs are allocated and deallocated a lot while selecting text and merging selection regions. orign commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-10&id=dc1e75b7be87
Diffstat (limited to 'libview/ev-pixbuf-cache.c')
-rw-r--r--libview/ev-pixbuf-cache.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libview/ev-pixbuf-cache.c b/libview/ev-pixbuf-cache.c
index 542775d0..89225d08 100644
--- a/libview/ev-pixbuf-cache.c
+++ b/libview/ev-pixbuf-cache.c
@@ -1231,7 +1231,7 @@ ev_pixbuf_cache_get_selection_list (EvPixbufCache *pixbuf_cache)
}
if (pixbuf_cache->prev_job[i].selection_points.x1 != -1) {
- selection = g_new0 (EvViewSelection, 1);
+ selection = g_slice_new0 (EvViewSelection);
selection->page = page;
selection->rect = pixbuf_cache->prev_job[i].selection_points;
if (pixbuf_cache->prev_job[i].selection_region)
@@ -1245,7 +1245,7 @@ ev_pixbuf_cache_get_selection_list (EvPixbufCache *pixbuf_cache)
page = pixbuf_cache->start_page;
for (i = 0; i < PAGE_CACHE_LEN (pixbuf_cache); i++) {
if (pixbuf_cache->job_list[i].selection_points.x1 != -1) {
- selection = g_new0 (EvViewSelection, 1);
+ selection = g_slice_new0 (EvViewSelection);
selection->page = page;
selection->rect = pixbuf_cache->job_list[i].selection_points;
if (pixbuf_cache->job_list[i].selection_region)
@@ -1261,7 +1261,7 @@ ev_pixbuf_cache_get_selection_list (EvPixbufCache *pixbuf_cache)
break;
if (pixbuf_cache->next_job[i].selection_points.x1 != -1) {
- selection = g_new0 (EvViewSelection, 1);
+ selection = g_slice_new0 (EvViewSelection);
selection->page = page;
selection->rect = pixbuf_cache->next_job[i].selection_points;
if (pixbuf_cache->next_job[i].selection_region)