mirror of
https://github.com/brl/mutter.git
synced 2025-03-28 14:13:47 +00:00
Revert "background: downscale background to fit in texture limits"
This reverts commit 15e01152da335f5a9e7617674ffa54cb1bdef957. ( accidentally pushed this when trying to push commit b7840bec7d135fec3c268b5eab1233d6c6c7cdf6 )
This commit is contained in:
parent
b7840bec7d
commit
fd7db8e6b3
@ -32,8 +32,6 @@
|
|||||||
|
|
||||||
#include <clutter/clutter.h>
|
#include <clutter/clutter.h>
|
||||||
|
|
||||||
#include <GL/gl.h>
|
|
||||||
|
|
||||||
#include "cogl-utils.h"
|
#include "cogl-utils.h"
|
||||||
#include "compositor-private.h"
|
#include "compositor-private.h"
|
||||||
#include "mutter-enum-types.h"
|
#include "mutter-enum-types.h"
|
||||||
@ -973,7 +971,6 @@ load_file (GTask *task,
|
|||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
GdkPixbuf *pixbuf;
|
GdkPixbuf *pixbuf;
|
||||||
int max_texture_size = 0;
|
|
||||||
|
|
||||||
pixbuf = gdk_pixbuf_new_from_file (task_data->filename,
|
pixbuf = gdk_pixbuf_new_from_file (task_data->filename,
|
||||||
&error);
|
&error);
|
||||||
@ -984,33 +981,6 @@ load_file (GTask *task,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
glGetIntegerv (GL_MAX_TEXTURE_SIZE, &max_texture_size);
|
|
||||||
|
|
||||||
if (glGetError () != GL_NO_ERROR)
|
|
||||||
max_texture_size = 0;
|
|
||||||
|
|
||||||
if (max_texture_size > 0) {
|
|
||||||
double width, height;
|
|
||||||
|
|
||||||
width = gdk_pixbuf_get_width (pixbuf);
|
|
||||||
height = gdk_pixbuf_get_height (pixbuf);
|
|
||||||
|
|
||||||
if (width > max_texture_size || height > max_texture_size) {
|
|
||||||
GdkPixbuf *scaled_pixbuf;
|
|
||||||
|
|
||||||
if (width > height) {
|
|
||||||
width = max_texture_size;
|
|
||||||
height *= max_texture_size / width;
|
|
||||||
} else {
|
|
||||||
width *= max_texture_size / height;
|
|
||||||
height = max_texture_size;
|
|
||||||
}
|
|
||||||
scaled_pixbuf = gdk_pixbuf_scale_simple (pixbuf, width, height, GDK_INTERP_BILINEAR);
|
|
||||||
g_object_unref (pixbuf);
|
|
||||||
pixbuf = scaled_pixbuf;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
g_task_return_pointer (task, pixbuf, (GDestroyNotify) g_object_unref);
|
g_task_return_pointer (task, pixbuf, (GDestroyNotify) g_object_unref);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user