diff --git a/src/compositor/cogl-utils.c b/src/compositor/cogl-utils.c index 2e5183cb4..5dbe3dfae 100644 --- a/src/compositor/cogl-utils.c +++ b/src/compositor/cogl-utils.c @@ -29,6 +29,10 @@ * @green: * @blue: * @alpha: + * @flags: Optional flags for the texture, or %COGL_TEXTURE_NONE; + * %COGL_TEXTURE_NO_SLICING is useful if the texture will be + * repeated to create a constant color fill, since hardware + * repeat can't be used for a sliced texture. * * Creates a texture that is a single pixel with the specified * unpremultiplied color components. @@ -36,10 +40,11 @@ * Return value: (transfer full): a newly created Cogl texture */ CoglHandle -meta_create_color_texture_4ub (guint8 red, - guint8 green, - guint8 blue, - guint8 alpha) +meta_create_color_texture_4ub (guint8 red, + guint8 green, + guint8 blue, + guint8 alpha, + CoglTextureFlags flags) { CoglColor color; guint8 pixel[4]; @@ -53,7 +58,7 @@ meta_create_color_texture_4ub (guint8 red, pixel[3] = cogl_color_get_alpha_byte (&color); return cogl_texture_new_from_data (1, 1, - COGL_TEXTURE_NONE, + flags, COGL_PIXEL_FORMAT_RGBA_8888_PRE, COGL_PIXEL_FORMAT_ANY, 4, pixel); @@ -88,7 +93,8 @@ meta_create_texture_material (CoglHandle src_texture) { CoglHandle dummy_texture; - dummy_texture = meta_create_color_texture_4ub (0xff, 0xff, 0xff, 0xff); + dummy_texture = meta_create_color_texture_4ub (0xff, 0xff, 0xff, 0xff, + COGL_TEXTURE_NONE); texture_material_template = cogl_material_new (); cogl_material_set_layer (texture_material_template, 0, dummy_texture); diff --git a/src/compositor/cogl-utils.h b/src/compositor/cogl-utils.h index 74748abbe..8d6742e66 100644 --- a/src/compositor/cogl-utils.h +++ b/src/compositor/cogl-utils.h @@ -25,10 +25,11 @@ #include -CoglHandle meta_create_color_texture_4ub (guint8 red, - guint8 green, - guint8 blue, - guint8 alpha); +CoglHandle meta_create_color_texture_4ub (guint8 red, + guint8 green, + guint8 blue, + guint8 alpha, + CoglTextureFlags flags); CoglHandle meta_create_texture_material (CoglHandle src_texture); #endif /* __META_COGL_UTILS_H__ */ diff --git a/src/compositor/meta-background-actor.c b/src/compositor/meta-background-actor.c index 7af8d627d..4e6828125 100644 --- a/src/compositor/meta-background-actor.c +++ b/src/compositor/meta-background-actor.c @@ -113,8 +113,13 @@ set_texture_to_stage_color (MetaBackgroundActor *self) CoglHandle texture; clutter_stage_get_color (CLUTTER_STAGE (stage), &color); + + /* Slicing will prevent COGL from using hardware texturing for + * the tiled 1x1 pixmap, and will cause it to draw the window + * background in millions of separate 1x1 rectangles */ texture = meta_create_color_texture_4ub (color.red, color.green, - color.blue, 0xff); + color.blue, 0xff, + COGL_TEXTURE_NO_SLICING); set_texture (self, texture); cogl_handle_unref (texture); }