Created attachment 543317
nsWindow drawing review comments
I can think of 2 possible approaches with the cairo_t passed in the "draw"
signal.
1. We pay attention to everything in the cairo_t.
2. We assume that, because we have
gtk_widget_set_double_buffered(widget, FALSE), we can just paint directly
to the X Window for the GdkWindow using only the clip region on the
cairo_t.
Comments on the drawing part of attachment 540032.
Currently in this patch, approach 2 is used if UseShm() returns true or if the
layer manager is an OpenGL layer manager.
With basic layers, the approach here is taking the target surface from the
cairo_t in GetThebesSurface and then creating a gfxContext (with its new
cairo_t) around the target surface. This is pretty much approach 1. It is
not transferring the matrix from one cairo_t to the other, but I think that
actually works, even for client-side-windows where the GdkWindow is at an
offset from the X Window, because GTK/GDK uses separate cairo_surface_t's for
the client side windows sharing the same X Window
(gdk_window_create_cairo_surface). The offsets are therefore on the surface
rather than the matrix.
I think this is all OK. I'm just writing it down, because it took me time
to get it clear in my head.
Created attachment 543317
nsWindow drawing review comments
I can think of 2 possible approaches with the cairo_t passed in the "draw"
signal.
1. We pay attention to everything in the cairo_t.
2. We assume that, because we have widget_ set_double_ buffered( widget, FALSE), we can just paint directly
gtk_
to the X Window for the GdkWindow using only the clip region on the
cairo_t.
Comments on the drawing part of attachment 540032.
Currently in this patch, approach 2 is used if UseShm() returns true or if the
layer manager is an OpenGL layer manager.
With basic layers, the approach here is taking the target surface from the create_ cairo_surface) . The offsets are therefore on the surface
cairo_t in GetThebesSurface and then creating a gfxContext (with its new
cairo_t) around the target surface. This is pretty much approach 1. It is
not transferring the matrix from one cairo_t to the other, but I think that
actually works, even for client-side-windows where the GdkWindow is at an
offset from the X Window, because GTK/GDK uses separate cairo_surface_t's for
the client side windows sharing the same X Window
(gdk_window_
rather than the matrix.
I think this is all OK. I'm just writing it down, because it took me time
to get it clear in my head.