After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 630072 - Convert rendering from GdkGC to cairo
Convert rendering from GdkGC to cairo
Status: RESOLVED FIXED
Product: GtkHtml
Classification: Other
Component: Rendering
3.91.x
Other Linux
: Normal blocker
: ---
Assigned To: gtkhtml-maintainers
gtkhtml-maintainers
: 630875 631149 632001 632688 (view as bug list)
Depends on:
Blocks: 626688
 
 
Reported: 2010-09-19 15:03 UTC by André Klapper
Modified: 2010-10-26 09:56 UTC
See Also:
GNOME target: 3.0
GNOME version: ---


Attachments
Convert to cairo based drawing and build against GTK3 (48.52 KB, patch)
2010-10-02 04:18 UTC, William Jon McCann
needs-work Details | Review
[editor] Make build against GTK3 (3.75 KB, patch)
2010-10-02 04:26 UTC, William Jon McCann
needs-work Details | Review
updated patch (55.20 KB, patch)
2010-10-12 19:12 UTC, Kjartan Maraas
none Details | Review
updated patch for editor (2.22 KB, patch)
2010-10-12 19:21 UTC, Kjartan Maraas
none Details | Review
Combined patch with GTK2 compatibility retained (63.48 KB, patch)
2010-10-13 11:50 UTC, Matthew Barnes
none Details | Review
Screenshot of gnome.org via testgtkhtml (31.68 KB, image/png)
2010-10-13 12:09 UTC, Matthew Barnes
  Details
Position text correctly (610 bytes, patch)
2010-10-25 19:30 UTC, Matthew Barnes
none Details | Review
Screenshot of an old Slashdot snapshot (307.05 KB, image/png)
2010-10-25 19:36 UTC, Matthew Barnes
  Details
Fix double-buffering of cairo surfaces (661 bytes, patch)
2010-10-25 22:47 UTC, Matthew Barnes
none Details | Review
Fix image positioning (2.47 KB, patch)
2010-10-25 22:50 UTC, Matthew Barnes
none Details | Review

Description André Klapper 2010-09-19 15:03:55 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'
Comment 1 William Jon McCann 2010-10-02 03:40:03 UTC
*** Bug 631149 has been marked as a duplicate of this bug. ***
Comment 2 William Jon McCann 2010-10-02 04:18:11 UTC
Created attachment 171549 [details] [review]
Convert to cairo based drawing and build against GTK3
Comment 3 William Jon McCann 2010-10-02 04:18:51 UTC
Haven't tested this yet but it builds...
Comment 4 William Jon McCann 2010-10-02 04:26:52 UTC
Created attachment 171550 [details] [review]
[editor] Make build against GTK3
Comment 5 Matthew Barnes 2010-10-02 23:57:22 UTC
*** Bug 630875 has been marked as a duplicate of this bug. ***
Comment 6 Matthew Barnes 2010-10-04 12:53:19 UTC
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.
Comment 7 Vibha Yadav 2010-10-07 11:41:01 UTC
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.
Comment 8 Matthew Barnes 2010-10-12 19:05:19 UTC
*** Bug 632001 has been marked as a duplicate of this bug. ***
Comment 9 Kjartan Maraas 2010-10-12 19:12:20 UTC
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.
Comment 10 Kjartan Maraas 2010-10-12 19:21:11 UTC
Created attachment 172211 [details] [review]
updated patch for editor

Update this one to accord for GtkObject fixes already being applied separately.
Comment 11 Milan Crha 2010-10-13 10:48:30 UTC
Why did you redefine the 'destroy' signal? I do not think it's necessary, the 'dispose' does the same thing, or am I wrong?
Comment 12 Milan Crha 2010-10-13 10:51:20 UTC
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.
Comment 13 Matthew Barnes 2010-10-13 11:50:33 UTC
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.
Comment 14 Matthew Barnes 2010-10-13 12:09:56 UTC
Created attachment 172253 [details]
Screenshot of gnome.org via testgtkhtml

Consistent results whether built against gtk2 or gtk3, which is a good thing.
Comment 15 Matthew Barnes 2010-10-20 12:34:26 UTC
*** Bug 632688 has been marked as a duplicate of this bug. ***
Comment 16 Lucas Rocha 2010-10-20 13:57:53 UTC
Matthew, could you roll a new tarball with this bug fix for GNOME 2.91.1?
Comment 17 Matthew Barnes 2010-10-20 14:10:48 UTC
No.  It doesn't work yet.  See comment #14.
Comment 18 Matthew Barnes 2010-10-25 19:30:52 UTC
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.
Comment 19 Matthew Barnes 2010-10-25 19:36:30 UTC
Created attachment 173213 [details]
Screenshot of an old Slashdot snapshot

This is test case #5 of testgtkhtml with the text positioning patch applied.
Comment 20 Matthew Barnes 2010-10-25 22:47:11 UTC
Created attachment 173233 [details] [review]
Fix double-buffering of cairo surfaces

This fixes the broken exposes while scrolling.
Comment 21 Matthew Barnes 2010-10-25 22:50:28 UTC
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.
Comment 23 Milan Crha 2010-10-26 06:18:48 UTC
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 :)
Comment 24 Milan Crha 2010-10-26 06:21:10 UTC
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.
Comment 25 Matthew Barnes 2010-10-26 09:25:37 UTC
(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.
Comment 26 Milan Crha 2010-10-26 09:56:14 UTC
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.