Use Meta.BackgroundActor instances instead of cloning global.background_actor

Instances of this class share a single CoglTexture behind the scenes which
allows us to show the background with different rendering options without
duplicating the texture data.

https://bugzilla.gnome.org/show_bug.cgi?id=656433
This commit is contained in:
Rui Matos 2011-08-29 02:37:41 +01:00
parent 9f1da20161
commit 82ce8fe3ff
2 changed files with 7 additions and 4 deletions

View File

@ -115,9 +115,12 @@ Overview.prototype = {
return; return;
} }
// The actual global.background_actor is inside global.window_group, // The main BackgroundActor is inside global.window_group which is
// which is hidden when displaying the overview, so we display a clone. // hidden when displaying the overview, so we create a new
this._background = new Clutter.Clone({ source: global.background_actor }); // one. Instances of this class share a single CoglTexture behind the
// scenes which allows us to show the background with different
// rendering options without duplicating the texture data.
this._background = Meta.BackgroundActor.new_for_screen(global.screen);
this._background.hide(); this._background.hide();
global.overlay_group.add_actor(this._background); global.overlay_group.add_actor(this._background);

View File

@ -167,7 +167,7 @@ WorkspaceThumbnail.prototype = {
return true; return true;
})); }));
this._background = new Clutter.Clone({ source: global.background_actor }); this._background = Meta.BackgroundActor.new_for_screen(global.screen);
this._contents.add_actor(this._background); this._contents.add_actor(this._background);
let monitor = Main.layoutManager.primaryMonitor; let monitor = Main.layoutManager.primaryMonitor;