Pass context to cogl_texture_pixmap_x11_new() api
The experimental cogl_texture_pixmap_x11_new() api was recently changed to take an explicit context argument and return a GError on failures. This updates Clutter's use of the api accordingly.
This commit is contained in:
parent
66cc330c0b
commit
eff95eba4a
@ -42,6 +42,8 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define CLUTTER_ENABLE_EXPERIMENTAL_API
|
||||||
|
|
||||||
#include "clutter-x11-texture-pixmap.h"
|
#include "clutter-x11-texture-pixmap.h"
|
||||||
#include "clutter-x11.h"
|
#include "clutter-x11.h"
|
||||||
#include "clutter-backend-x11.h"
|
#include "clutter-backend-x11.h"
|
||||||
@ -806,7 +808,6 @@ clutter_x11_texture_pixmap_set_pixmap (ClutterX11TexturePixmap *texture,
|
|||||||
gboolean new_pixmap = FALSE, new_pixmap_width = FALSE;
|
gboolean new_pixmap = FALSE, new_pixmap_width = FALSE;
|
||||||
gboolean new_pixmap_height = FALSE, new_pixmap_depth = FALSE;
|
gboolean new_pixmap_height = FALSE, new_pixmap_depth = FALSE;
|
||||||
CoglHandle material;
|
CoglHandle material;
|
||||||
CoglHandle cogl_texture;
|
|
||||||
|
|
||||||
ClutterX11TexturePixmapPrivate *priv;
|
ClutterX11TexturePixmapPrivate *priv;
|
||||||
|
|
||||||
@ -897,11 +898,24 @@ clutter_x11_texture_pixmap_set_pixmap (ClutterX11TexturePixmap *texture,
|
|||||||
|
|
||||||
if (pixmap)
|
if (pixmap)
|
||||||
{
|
{
|
||||||
cogl_texture = cogl_texture_pixmap_x11_new (pixmap, FALSE);
|
CoglContext *ctx =
|
||||||
clutter_texture_set_cogl_texture (CLUTTER_TEXTURE (texture),
|
clutter_backend_get_cogl_context (clutter_get_default_backend ());
|
||||||
cogl_texture);
|
GError *error = NULL;
|
||||||
cogl_handle_unref (cogl_texture);
|
CoglTexturePixmapX11 *texture_pixmap =
|
||||||
update_pixmap_damage_object (texture);
|
cogl_texture_pixmap_x11_new (ctx, pixmap, FALSE, &error);
|
||||||
|
if (texture_pixmap)
|
||||||
|
{
|
||||||
|
clutter_texture_set_cogl_texture (CLUTTER_TEXTURE (texture),
|
||||||
|
COGL_TEXTURE (texture_pixmap));
|
||||||
|
cogl_object_unref (texture_pixmap);
|
||||||
|
update_pixmap_damage_object (texture);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
g_warning ("Failed to create CoglTexturePixmapX11: %s",
|
||||||
|
error->message);
|
||||||
|
g_error_free (error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#include <cogl/cogl.h>
|
||||||
|
|
||||||
|
#define CLUTTER_ENABLE_EXPERIMENTAL_API
|
||||||
#include <clutter/clutter.h>
|
#include <clutter/clutter.h>
|
||||||
|
|
||||||
#include "test-conform-common.h"
|
#include "test-conform-common.h"
|
||||||
@ -207,6 +210,8 @@ test_cogl_texture_pixmap_x11 (TestConformSimpleFixture *fixture,
|
|||||||
TestState state;
|
TestState state;
|
||||||
guint idle_handler;
|
guint idle_handler;
|
||||||
guint paint_handler;
|
guint paint_handler;
|
||||||
|
CoglContext *ctx =
|
||||||
|
clutter_backend_get_cogl_context (clutter_get_default_backend ());
|
||||||
|
|
||||||
state.frame_count = 0;
|
state.frame_count = 0;
|
||||||
state.stage = clutter_stage_new ();
|
state.stage = clutter_stage_new ();
|
||||||
@ -214,7 +219,7 @@ test_cogl_texture_pixmap_x11 (TestConformSimpleFixture *fixture,
|
|||||||
state.display = clutter_x11_get_default_display ();
|
state.display = clutter_x11_get_default_display ();
|
||||||
|
|
||||||
state.pixmap = create_pixmap (&state);
|
state.pixmap = create_pixmap (&state);
|
||||||
state.tfp = cogl_texture_pixmap_x11_new (state.pixmap, TRUE);
|
state.tfp = cogl_texture_pixmap_x11_new (ctx, state.pixmap, TRUE, NULL);
|
||||||
|
|
||||||
clutter_stage_set_color (CLUTTER_STAGE (state.stage), &stage_color);
|
clutter_stage_set_color (CLUTTER_STAGE (state.stage), &stage_color);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user