toytoolkit: Make the window resizing optimization optional
Whether or not a shm pool is used for resizing is now configurable at build time (--disable-resize-optimization). [pq: removed an unnecessary hunk from the patch]
This commit is contained in:
committed by
Kristian Høgsberg
parent
a402b0567f
commit
6cd1de33ba
@@ -1063,6 +1063,7 @@ shm_surface_prepare(struct toysurface *base, int dx, int dy,
|
|||||||
if (leaf->cairo_surface)
|
if (leaf->cairo_surface)
|
||||||
cairo_surface_destroy(leaf->cairo_surface);
|
cairo_surface_destroy(leaf->cairo_surface);
|
||||||
|
|
||||||
|
#ifdef USE_RESIZE_POOL
|
||||||
if (resize_hint && !leaf->resize_pool) {
|
if (resize_hint && !leaf->resize_pool) {
|
||||||
/* Create a big pool to allocate from, while continuously
|
/* Create a big pool to allocate from, while continuously
|
||||||
* resizing. Mmapping a new pool in the server
|
* resizing. Mmapping a new pool in the server
|
||||||
@@ -1073,6 +1074,7 @@ shm_surface_prepare(struct toysurface *base, int dx, int dy,
|
|||||||
leaf->resize_pool = shm_pool_create(surface->display,
|
leaf->resize_pool = shm_pool_create(surface->display,
|
||||||
6 * 1024 * 1024);
|
6 * 1024 * 1024);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
rect.width = width;
|
rect.width = width;
|
||||||
rect.height = height;
|
rect.height = height;
|
||||||
|
|||||||
@@ -239,6 +239,13 @@ if test x$enable_clients = xyes; then
|
|||||||
PKG_CHECK_MODULES(PANGO, [pangocairo], [have_pango=yes], [have_pango=no])
|
PKG_CHECK_MODULES(PANGO, [pangocairo], [have_pango=yes], [have_pango=no])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
AC_ARG_ENABLE(resize-optimization,
|
||||||
|
AS_HELP_STRING([--disable-resize-optimization],
|
||||||
|
[disable resize optimization allocating a big buffer in toytoolkit]),,
|
||||||
|
enable_resize_optimization=yes)
|
||||||
|
AS_IF([test "x$enable_resize_optimization" = "xyes"],
|
||||||
|
[AC_DEFINE([USE_RESIZE_POOL], [1], [Use resize memory pool as a performance optimization])])
|
||||||
|
|
||||||
AC_ARG_ENABLE(weston-launch, [ --enable-weston-launch],, enable_weston_launch=yes)
|
AC_ARG_ENABLE(weston-launch, [ --enable-weston-launch],, enable_weston_launch=yes)
|
||||||
AM_CONDITIONAL(BUILD_WESTON_LAUNCH, test x$enable_weston_launch == xyes)
|
AM_CONDITIONAL(BUILD_WESTON_LAUNCH, test x$enable_weston_launch == xyes)
|
||||||
if test x$enable_weston_launch == xyes; then
|
if test x$enable_weston_launch == xyes; then
|
||||||
|
|||||||
Reference in New Issue
Block a user