}
/* The download_texture() call may have switched the GL context. Make sure
- * the right context is at work again. */
+ * the right context is at work again.
+ */
gdk_gl_context_make_current (context);
width = gdk_texture_get_width (texture);
n_slices = cols * rows;
- if ((t = gdk_texture_get_render_data (texture, self)))
+ t = gdk_texture_get_render_data (texture, self);
+
+ if (t)
{
- if (t->n_slices == n_slices)
+ if (t->n_slices == n_slices &&
+ t->min_filter == min_filter &&
+ t->mag_filter == mag_filter)
{
*out_slices = t->slices;
*out_n_slices = t->n_slices;
t = gsk_gl_texture_new (0,
tex_width, tex_height,
GL_RGBA8,
- GL_NEAREST, GL_NEAREST,
+ min_filter, mag_filter,
self->current_frame_id);
/* Use gsk_gl_texture_free() as destroy notify here since we are
{
GskGLTexture *t;
- if ((t = gdk_texture_get_render_data (texture, self)))
+ t = gdk_texture_get_render_data (texture, self);
+
+ if (t && t->slices &&
+ t->min_filter == min_filter &&
+ t->mag_filter == mag_filter &&
+ min_cols == 0 && min_rows == 0)
{
- if (min_cols == 0 && min_rows == 0 && t->slices)
- {
- *out_slices = t->slices;
- *out_n_slices = t->n_slices;
- return;
- }
+ *out_slices = t->slices;
+ *out_n_slices = t->n_slices;
+ return;
}
gsk_gl_driver_add_texture_slices (self, texture, min_filter, mag_filter, min_cols, min_rows, out_slices, out_n_slices);