Closed Bug 233459 Opened 21 years ago Closed 19 years ago

Add "GTK+ >= 2.1" configure check for SVG GTK2 builds

Categories

(Core :: SVG, defect)

Sun
Solaris
defect
Not set
blocker

Tracking

()

RESOLVED WONTFIX

People

(Reporter: roland.mainz, Assigned: alex)

Details

Attachments

(2 files, 1 obsolete file)

2004-02-08-13-trunk on Solaris 2.8/SPARC, building the GTK2 port with Sun
Workshop 8.

The build fails like this:
-- snip --
nsSVGLibartBitmapGdk.cpp
Building deps for
../../../../../../mozilla/layout/svg/renderer/src/libart/nsSVGLibartBitmapGdk.cpp
/opt/SUNWspro/bin/CC -o nsSVGLibartBitmapGdk.o -c -DOSTYPE=\"SunOS5\"
-DOSARCH=\"SunOS\" -I../../../../../../mozilla/gfx/src/gtk
-I../../../../../../mozilla/gfx/src  -I../../../../../dist/include/xpcom
-I../../../../../dist/include/widget -I../../../../../dist/include/pref
-I../../../../../dist/include/gfx -I../../../../../dist/include/imglib2
-I../../../../../dist/include/string -I../../../../../dist/include/dom
-I../../../../../dist/include/content -I../../../../../dist/include/necko
-I../../../../../dist/include/libart_lgpl -I../../../../../dist/include/util
-I../../../../../dist/include/uconv -I../../../../../dist/include/windowwatcher
-I../../../../../dist/include/layout -I../../../../../dist/include
-I/shared/bigtmp/mozilla/nightlybuilds/north/objdir_gtk1/dist/include/nspr    
-I/usr/openwin/include   -KPIC  -I/usr/openwin/include -xbuiltin=%all -mt 
-DNDEBUG -DTRIMMED -xO2 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include
-I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/openwin/include
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include    -I/usr/openwin/include
-DSOLARIS=1 -DNSCAP_DISABLE_DEBUG_PTR_TYPES=1 -DD_INO=d_ino -DSTDC_HEADERS=1
-DHAVE_ST_BLKSIZE=1 -DHAVE_SIGINFO_T=1 -DHAVE_INT16_T=1 -DHAVE_INT32_T=1
-DHAVE_INT64_T=1 -D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K=1
-DMOZILLA_VERSION=\"1.7a\" -DMOZILLA_LOCALE_VERSION=\"1.7a\"
-DMOZILLA_REGION_VERSION=\"1.7a\"  -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT
../../../../../../mozilla/layout/svg/renderer/src/libart/nsSVGLibartBitmapGdk.cpp
"../../../../../../mozilla/layout/svg/renderer/src/libart/nsSVGLibartBitmapGdk.cpp",
line 204: Error: The function "gdk_draw_pixbuf" must have a prototype.
"../../../../../../mozilla/layout/svg/renderer/src/libart/nsSVGLibartBitmapGdk.cpp",
line 260: Error: The function "gdk_draw_pixbuf" must have a prototype.
2 Error(s) detected.
gmake[6]: *** [nsSVGLibartBitmapGdk.o] Error 2
gmake[6]: Leaving directory
`/shared/bigtmp/mozilla/nightlybuilds/north/objdir_gtk1/layout/svg/renderer/src/libart'
gmake[5]: *** [libs] Error 2
gmake[5]: Leaving directory
`/shared/bigtmp/mozilla/nightlybuilds/north/objdir_gtk1/layout/svg/renderer/src'
gmake[4]: *** [libs] Error 2
gmake[4]: Leaving directory
`/shared/bigtmp/mozilla/nightlybuilds/north/objdir_gtk1/layout/svg/renderer'
gmake[3]: *** [libs] Error 2
gmake[3]: Leaving directory
`/shared/bigtmp/mozilla/nightlybuilds/north/objdir_gtk1/layout/svg'
gmake[2]: *** [libs] Error 2
gmake[2]: Leaving directory
`/shared/bigtmp/mozilla/nightlybuilds/north/objdir_gtk1/layout'
gmake[1]: *** [tier_9] Error 2
gmake[1]: Leaving directory
`/shared/bigtmp/mozilla/nightlybuilds/north/objdir_gtk1'
gmake: *** [default] Error 2
-- snip --
Looks like there is a header missing. Could you please try the following:

Index: nsSVGLibartBitmapGdk.cpp
===================================================================
RCS file: /cvsroot/mozilla/layout/svg/renderer/src/libart/nsSVGLibartBitmapGdk.cpp,v
retrieving revision 1.2
diff -u -r1.2 nsSVGLibartBitmapGdk.cpp
--- nsSVGLibartBitmapGdk.cpp	7 Feb 2004 12:39:24 -0000	1.2
+++ nsSVGLibartBitmapGdk.cpp	9 Feb 2004 01:25:30 -0000
@@ -36,6 +36,7 @@
  *
  * ----- END LICENSE BLOCK ----- */
 
+#include "gdk/gdkdrawable.h"
 #include"gdk-pixbuf/gdk-pixbuf.h"
 #include "nsCOMPtr.h"
 #include "nsISVGLibartBitmap.h"
Status: NEW → ASSIGNED
This will not work since "gdk_draw_pixbuf" is not part of GTK/GDK2.0 - it was
AFAIK added slighly later (the libraries shipped with Solaris and older SuSE
versions don't have that symbol).
Attached patch Workaround for the problem (obsolete) — Splinter Review
Note that the current usage of gdk_pixbuf smells like the next printing
crasher.
You cannot assume that the nsIRenderingContext is a nsRenderingContextGTK one -
it may be nsRenderingContextPS (PostScript prining) or nsRenderingContextXp
(Xprint).
Comment on attachment 140902 [details] [diff] [review]
Workaround for the problem

sorry, I uploaded the wrong patch... one sec...
Attachment #140902 - Attachment is obsolete: true
Comment on attachment 140904 [details] [diff] [review]
Workaround, 2nd try

Requesting r= and checking (assuming that SVG stuff currently doesn't need sr=,
only r= from module owner) ...
Attachment #140904 - Flags: review?(alex)
Comment on attachment 140904 [details] [diff] [review]
Workaround, 2nd try

checked in.
Attachment #140904 - Flags: review?(alex) → review+
Alex, is this FIXED?
No, see comment #2 and the patch. We need a configure-test for GTK+ >= 2.1.
Summary: GTK2 build failure after SVG-branch landing... → Add "GTK+ >= 2.1" configure check for SVG GTK2 builds
Here's a patch to use gdk_pixbuf_render_to_drawable when gdk_draw_pixbuf is not
available. I've not tested on gtk+ version 2.0, but I do know that
gdk_pixbuf_render_to_drawable exists on version 2.0.

(In reply to comment #3)
> Note that the current usage of gdk_pixbuf smells like the next printing
> crasher.
> You cannot assume that the nsIRenderingContext is a nsRenderingContextGTK one
-
> it may be nsRenderingContextPS (PostScript prining) or nsRenderingContextXp
> (Xprint).

alex, is this a real problem?
<afri> to answer your question about nsRenderingContextPS,etc. : I don't know :-)
<afri> Probably yes though
<afri> There are some things in nsSVGLibartBitmapGdk.cpp that look like they
won't work for nsRenderingContextPS,etc:
<afri>   nsDrawingSurfaceGTK *surface=nsnull;
<afri>   mRenderingContext->CreateDrawingSurface(rect,
NS_CREATEDRAWINGSURFACE_FOR_PIXEL_ACCESS,
<afri>                                           (nsDrawingSurface&)surface);
<afri>   NS_ASSERTION(surface, "could not create drawing surface");
<afri> i don't know what kind of drawing surface will be returned by a
PS-context, but it probably won't be an nsDrawingSurfaceGTK 
<afri> actually it looks like it returns nothing:
<afri> NS_IMETHODIMP 
<afri> nsRenderingContextPS :: CreateDrawingSurface(const nsRect& aBounds,
PRUint32 aSurfFlags, nsDrawingSurface &aSurface)
<afri> {
<afri>   return NS_OK;   // offscreen test
<afri> }
<afri> :-)
<afri> The best way to fix this is probably to create different libartbitmaps
depending on the rendering context type in nsSVGLibartCanvas::Init().
<afri> At the moment the libartbitmap created by NS_NewSVGLibartBitmap is
hard-wired to either the 'default' bitmap or the gdk bitmap
<afri> ideally we should have another 'ps bitmap' but for now we could just
create a default bitmap for ps-contexts. That should work, but foreignObjects
won't print with it. At least it shouldn't crash (like the current code probably
does)
(In reply to comment #11)
> <afri> The best way to fix this is probably to create different libartbitmaps
> depending on the rendering context type in nsSVGLibartCanvas::Init().
How would one know what rendering context type it is? I'm starting to wonder if
some of this bitmap stuff should be gfx or something... 
Flags: blocking1.8b3?
Flags: blocking1.8b3? → blocking1.8b3-
Marking wontfix. We have no plans to continue development of the libart backend.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: