GNOME Bugzilla – Bug 630072
Convert rendering from GdkGC to cairo
Last modified: 2010-10-26 09:56:14 UTC
See http://live.gnome.org/GnomeGoals/GDKtoCairo In file included from html.c:32: ../gtkhtml/htmlengine.h:63: error: expected specifier-qualifier-list before ‘GdkGC’ html.c: In function ‘html_a11y_get_extents’: html.c:321: error: ‘HTMLEngine’ has no member named ‘x_offset’ html.c:322: error: ‘HTMLEngine’ has no member named ‘y_offset’ make[2]: *** [html.lo] Error 1 make[2]: Leaving directory `/home/andre/svn-gnome/gtkhtml/a11y'
*** Bug 631149 has been marked as a duplicate of this bug. ***
Created attachment 171549 [details] [review] Convert to cairo based drawing and build against GTK3
Haven't tested this yet but it builds...
Created attachment 171550 [details] [review] [editor] Make build against GTK3
*** Bug 630875 has been marked as a duplicate of this bug. ***
Thanks for the patches. They need some work however to retain compatibility with GTK2. I'll deal with this after the 2.90.0 release.
I am working on Converting rendering from GdkGC to cairo for Evolution, as it also has dependency on GTK3. I will test it after that.
*** Bug 632001 has been marked as a duplicate of this bug. ***
Created attachment 172207 [details] [review] updated patch I updated the patch to apply cleanly. Looks like some of the GtkObject removals were already commited. It still needs to handle conditional gtk2/3 though.
Created attachment 172211 [details] [review] updated patch for editor Update this one to accord for GtkObject fixes already being applied separately.
Why did you redefine the 'destroy' signal? I do not think it's necessary, the 'dispose' does the same thing, or am I wrong?
Also, I tried the smaller patch and I cannot compile gtkhtml against gtk2 (2.22.0). It might not matter "soon", but it'll take some time, and the configure allows to not compile against gtk3, so we may still support gtk2.
Created attachment 172252 [details] [review] Combined patch with GTK2 compatibility retained I combined the patches and restored GTK2 compatibility, but there are serious rendering issues.
Created attachment 172253 [details] Screenshot of gnome.org via testgtkhtml Consistent results whether built against gtk2 or gtk3, which is a good thing.
*** Bug 632688 has been marked as a duplicate of this bug. ***
Matthew, could you roll a new tarball with this bug fix for GNOME 2.91.1?
No. It doesn't work yet. See comment #14.
Created attachment 173211 [details] [review] Position text correctly I made a little progress on this. Text is now positioned correctly, but image positions and repaints while scrolling are still broken.
Created attachment 173213 [details] Screenshot of an old Slashdot snapshot This is test case #5 of testgtkhtml with the text positioning patch applied.
Created attachment 173233 [details] [review] Fix double-buffering of cairo surfaces This fixes the broken exposes while scrolling.
Created attachment 173234 [details] [review] Fix image positioning This one I fixed totally by trial and error, but I'll take it. With these three patches it seems to be working perfectly now with GTK+ 2.23.1.
Committed to master: http://git.gnome.org/browse/gtkhtml/commit/?id=e1d4723c7b2baaed73edfe1e9206f336b8853a13
I suppose that gtkhtml should require GTK+ 2.23.1, because when I compile against 2.22.0 I get an error: htmlengine-edit-cursor.c: In function ‘html_engine_draw_cursor_in_area’: htmlengine-edit-cursor.c:346: error: ‘CAIRO_OPERATOR_DIFFERENCE’ undeclared (first use in this function) Also, the commit log message contains wrong bug reference :)
Oh, and I see there was no release of 2.23.1 yet (as of today). The last I see is 2.23.0 on 2010-10-16.
(In reply to comment #23) > I suppose that gtkhtml should require GTK+ 2.23.1, because when I compile > against 2.22.0 I get an error: > htmlengine-edit-cursor.c: In function ‘html_engine_draw_cursor_in_area’: > htmlengine-edit-cursor.c:346: error: ‘CAIRO_OPERATOR_DIFFERENCE’ undeclared > (first use in this function) Just wrap it with "#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(x,y,z)" where (x,y,z) is whatever Cairo version the difference operator was introduced in. It's just used for the editing cursor and not worth bumping any version requirements over.
Oh, too late, I updated my system with newer cairo and gtk+ 2.23.0. By the way, I see that links has too tall underline (like two or more pixels) and when clicking the link the rectangle around it is not dotted, as it used to be. All in message preview from Evolution.