Rework StDrawingArea not to use ClutterCairoTexture

Having StDrawingArea use ClutterCairoTexture causes circularity
problems with sizing - StDrawingArea wants to use its allocation for
the size of the texture, but ClutterTexture wants to use the size of
the texture to determine the requited size.

Avoid this by making StDrawingArea directly use Cairo and CoglTexture;
while doing this, the API is changed a bit for simplicity and to
match our use case:

 - Instead of clutter_cairo_texture_create(), we have
   st_drawing_area_get_context() to retrieve an already created
   context. This can only be called in the ::repaint signal.

 - The ::redraw signal is changed to ::repaint so we can have
   st_drawing_area_queue_repaint() that doesn't collide with
   clutter_actor_queue_redraw()

 - ::repaint is now emitted lazily when painting the actor rather
   than synchronously at various different points.

https://bugzilla.gnome.org/show_bug.cgi?id=611750
This commit is contained in:
Owen W. Taylor
2010-03-03 18:00:05 -05:00
parent 58bb0044b2
commit 33dca51650
7 changed files with 220 additions and 90 deletions

View File

@ -633,8 +633,8 @@ AppIconMenu.prototype = {
this._windowContainerBox.connect('style-changed', Lang.bind(this, this._onStyleChanged));
this._arrow = new St.DrawingArea();
this._arrow.connect('redraw', Lang.bind(this, function (area, texture) {
Shell.draw_box_pointer(texture,
this._arrow.connect('repaint', Lang.bind(this, function (area) {
Shell.draw_box_pointer(area,
Shell.PointerDirection.LEFT,
this._borderColor,
this._backgroundColor);
@ -884,7 +884,7 @@ AppIconMenu.prototype = {
if (themeNode.get_border_color(St.Side.LEFT, color)) {
this._borderColor = color;
}
this._arrow.emit_redraw();
this._arrow.queue_repaint();
}
};
Signals.addSignalMethods(AppIconMenu.prototype);