t = gdk_texture_get_render_data (texture, self);
if (t && t->texture_id)
{
- if (ensure_mipmap & !t->has_mipmap)
+ if (ensure_mipmap && !t->has_mipmap)
{
glBindTexture (GL_TEXTURE_2D, t->texture_id);
glGenerateMipmap (GL_TEXTURE_2D);
const graphene_rect_t *bounds)
{
int max_texture_size = job->command_queue->max_texture_size;
+ float scale_x = bounds->size.width / texture->width;
+ float scale_y = bounds->size.height / texture->height;
gboolean use_mipmaps;
- use_mipmaps = job->scale_x < 0.5 || job->scale_y < 0.5;
+ use_mipmaps = (scale_x * job->scale_x) < 0.5 ||
+ (scale_y * job->scale_y) < 0.5;
if G_LIKELY (texture->width <= max_texture_size &&
texture->height <= max_texture_size)
{
float min_x = job->offset_x + bounds->origin.x;
float min_y = job->offset_y + bounds->origin.y;
- float max_x = min_x + bounds->size.width;
- float max_y = min_y + bounds->size.height;
- float scale_x = (max_x - min_x) / texture->width;
- float scale_y = (max_y - min_y) / texture->height;
GskGLTextureSlice *slices = NULL;
guint n_slices = 0;
gsk_gl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, blit));
- for (guint i = 0; i < n_slices; i ++)
+ for (unsigned int i = 0; i < n_slices; i++)
{
const GskGLTextureSlice *slice = &slices[i];
float x1, x2, y1, y2;