Closed Bug 567065 Opened 14 years ago Closed 14 years ago

Try to create offscreen Xlib surface from existing visual if possible

Categories

(Core :: Graphics, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla2.0b2

People

(Reporter: romaxa, Assigned: romaxa)

References

Details

Attachments

(1 file, 1 obsolete file)

Problem is so that gfxPlatformQt creating offscreen surface with 

gfxXlibSurface(Display* dpy, XRenderPictFormat *format, const gfxIntSize& size);
And after that cairo return NULL visual because it is not trying to find visual and set it to xlib_surface structure...

http://mxr.mozilla.org/mozilla-central/source/gfx/cairo/cairo/src/cairo-xlib-surface.c#3196


I think we should try to find related visual, and call
new gfxXlibSurface(Display *dpy, Visual *visual, const gfxIntSize& size, int depth = 0);
Attachment #446463 - Flags: review?(vladimir)
Blocks: 556487
Assignee: nobody → romaxa
Attachment #446463 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #446745 - Flags: review?(jmuizelaar)
Attachment #446463 - Flags: review?(vladimir)
Comment on attachment 446745 [details] [diff] [review]
cairo patch, updated to trunk.

This patch seems to break plugins rendering
Attachment #446745 - Flags: review?(jmuizelaar) → review-
(In reply to comment #3)
> This patch seems to break plugins rendering

Flash with GTK ports would need DRAW_SUPPORTS_NONDEFAULT_VISUAL to be removed:
http://hg.mozilla.org/mozilla-central/annotate/d7ba6aef21eb/layout/generic/nsObjectFrame.cpp#l5135
(I'm not clear on exactly which visuals Flash Player does support; it may only be ARGB visuals causing problems.)

I don't know why it would "break" Qt ports.
Comment on attachment 446745 [details] [diff] [review]
cairo patch, updated to trunk.

Yep, you right... removing non-default visual helps in this situation.
And this patch seems to work fine
Attachment #446745 - Flags: review- → review?(jmuizelaar)
Oleg, can you try to upstream this patch? There are people on the cairo list that would be better at reviewing this then me.
Bug created:
https://bugs.freedesktop.org/show_bug.cgi?id=28492

Message posted to cairo mailing list.
Comment on attachment 446745 [details] [diff] [review]
cairo patch, updated to trunk.

Looks good. Make sure you add the patch to the cairo directory
Attachment #446745 - Flags: review?(jmuizelaar) → review+
http://hg.mozilla.org/mozilla-central/rev/598c5f8d295c
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
due Gdk-CRITICAL **: gdk_x11_visual_get_xvisual
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1276838409.1276840450.21437.gz&fulltext=1

REFTEST INFO | Loading a blank page
REFTEST TEST-START | file:///home/cltbld/talos-slave/mozilla-central-fedora-opt-u-crashtest/build/reftest/tests/modules/plugin/test/crashtests/540114-1.html
NPP_Destroy
NPP_Destroy
WARNING: gdk_x11_visual_get_xvisual: assertion `visual != NULL' failed: 'glib warning', file /builds/slave/mozilla-central-linux/build/toolkit/xre/nsSigHandlers.cpp, line 193

(firefox-bin:1997): Gdk-CRITICAL **: gdk_x11_visual_get_xvisual: assertion `visual != NULL' failed
WARNING: gdk_x11_colormap_get_xcolormap: assertion `GDK_IS_COLORMAP (colormap)' failed: 'glib warning', file /builds/slave/mozilla-central-linux/build/toolkit/xre/nsSigHandlers.cpp, line 193

(firefox-bin:1997): Gdk-CRITICAL **: gdk_x11_colormap_get_xcolormap: assertion `GDK_IS_COLORMAP (colormap)' failed

###!!! [Parent][RPCChannel] Error: Channel error: cannot send/recv

REFTEST TEST-UNEXPECTED-FAIL | file:///home/cltbld/talos-slave/mozilla-central-fedora-opt-u-crashtest/build/reftest/tests/modules/plugin/test/crashtests/540114-1.html | plugin should not crash item 1
REFTEST INFO | Loading a blank page
REFTEST TEST-START | file:///home/cltbld/talos-slave/mozilla-central-fedora-opt-u-crashtest/build/reftest/tests/modules/plugin/test/crashtests/570884.html
REFTEST TEST-PASS | file:///home/cltbld/talos-slave/mozilla-central-fedora-opt-u-crashtest/build/reftest/tests/modules/plugin/test/crashtests/570884.html | (LOAD ONLY)
REFTEST INFO | Loading a blank page
REFTEST TEST-START | file:///home/cltbld/talos-slave/mozilla-central-fedora-opt-u-crashtest/build/reftest/tests/parser/htmlparser/tests/crashtests/30885-1.html
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
I'm guessing that was caused by gfxPlatformGtk::CreateOffscreenSurface using a GdkPixmap with no colormap:
http://hg.mozilla.org/mozilla-central/annotate/5f3955a452ac/gfx/thebes/src/gfxPlatformGtk.cpp#l195

One option might be to put a sensible colormap on the surface.

Though simpler (and maybe better) would be to just let
gfxXlibSurface(Display*, XRenderPictFormat*, const gfxIntSize&)
create the pixmap.
(Now that the cairo surface has an associated visual, the GdkPixmap wrapper will get added if and only when it is needed.)
Depends on: 573319
I filed bug 573319 on CreateOffscreenSurface.
Blocks: 573626
Keywords: checkin-needed
http://hg.mozilla.org/mozilla-central/rev/ba88e35da4e7 - repeat
Status: REOPENED → RESOLVED
Closed: 14 years ago14 years ago
Resolution: --- → FIXED
Keywords: checkin-needed
reverted in http://hg.mozilla.org/mozilla-central/rev/200f9be1c8e5
due to svg crashtest fail: see bug 573319
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Depends on: 574220
Bug 574220 and bug 569775 probably need to be resolved before we can land this.
Depends on: 569775
http://hg.mozilla.org/mozilla-central/rev/ff0c0650d7f2
Status: REOPENED → RESOLVED
Closed: 14 years ago14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3b2
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: