GtkCssImageSurface: add cache for the last drawn size.

Keep a copy of the scaled image to speed up rendering multiple times
the image at the same size.
This commit is contained in:
Juan Pablo Ugarte
2017-12-29 15:21:52 -03:00
committed by Juan Pablo Ugarte
parent 8ed4b48b4c
commit 2a8e1745cf
2 changed files with 34 additions and 6 deletions

View File

@ -39,6 +39,9 @@ struct _GtkCssImageSurface
GtkCssImage parent;
cairo_surface_t *surface; /* the surface we render - guaranteed to be an image surface */
cairo_surface_t *cache; /* the scaled surface - to avoid scaling every time we need to draw */
double width; /* original cache width */
double height; /* original cache height */
};
struct _GtkCssImageSurfaceClass