CAIRO_FORMAT_A8 not allowed for cairo-qt image backend

RESOLVED FIXED

Status

()

Core
Graphics
RESOLVED FIXED
8 years ago
8 years ago

People

(Reporter: romaxa, Unassigned)

Tracking

Trunk
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

8 years ago
Run Qt fennec with 

MOZ_QT_RENDER_TYPE=0

[TabChild] RESIZE to (w,h)= (1002d, 414d)
QPainter::begin: Cannot paint on an image with the QImage::Format_Indexed8 format
Segmentation fault
QImage does not support painting on A8 surface, and not possible create qpainter.


#0  0xb78ce832 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1  0xb78a3370 in raise (sig=11) at ../nptl/sysdeps/unix/sysv/linux/pt-raise.c:42
#2  0xb62ad2a6 in nsProfileLock::FatalSignalHandler (signo=11, info=0xbfee976c, context=0xbfee97ec) at nsProfileLock.cpp:213
#3  <signal handler called>
#4  0xb7401f50 in cairo_qt_surface_create_with_qimage (format=CAIRO_FORMAT_A8, width=8, height=8)
    at gfx/cairo/cairo/src/cairo-qt-surface.cpp:1621
#5  0xb73e9bfd in _cairo_surface_create_similar_scratch (other=0xabc16ff0, content=CAIRO_CONTENT_ALPHA, width=8, height=8)
    at gfx/cairo/cairo/src/cairo-surface.c:399
#6  0xb73e9e6b in _cairo_surface_create_similar_solid (other=0xabc16ff0, content=CAIRO_CONTENT_ALPHA, width=8, height=8, 
    color=0xb76a1960, allow_fallback=1)
    at gfx/cairo/cairo/src/cairo-surface.c:464
#7  0xb73eb51e in _create_composite_mask_pattern (mask_pattern=<value optimized out>, clip=<value optimized out>, 
    draw_func=0xb73ed000 <_composite_traps_draw_func>, draw_closure=0xbfeea050, dst=0xabc16ff0, extents=0xbfeea968)
    at gfx/cairo/cairo/src/cairo-surface-fallback.c:148
#8  0xb73eb6c2 in _clip_and_composite (clip=0xbfeeab28, op=<value optimized out>, src=0xbfeeaa48, 
    draw_func=0xb73ed000 <_composite_traps_draw_func>, draw_closure=0xbfeea050, dst=0xabc16ff0, extents=0xbfeea968)
    at gfx/cairo/cairo/src/cairo-surface-fallback.c:192
(Reporter)

Comment 1

8 years ago
Created attachment 481186 [details] [diff] [review]
Use  cairo image surface fallback for A8
(Reporter)

Comment 2

8 years ago
Comment on attachment 481186 [details] [diff] [review]
Use  cairo image surface fallback for A8

This will make Fennec-Qt usable with QPainter backend
Attachment #481186 - Flags: review?(vladimir)
(Reporter)

Updated

8 years ago
Attachment #481186 - Flags: review?(vladimir) → review?(jmuizelaar)
Comment on attachment 481186 [details] [diff] [review]
Use  cairo image surface fallback for A8

it */
>     if (qs->image || qs->pixmap)
>         delete qs->p;
>-    else
>+    else if (qs->p)
> 	qs->p->restore ();
> 

What's this part for?
(Reporter)

Comment 4

8 years ago
> >-    else
> >+    else if (qs->p)
> > 	qs->p->restore ();
> 
> What's this part for?

We do set qs->p = NULL;, and checking that later

+    if (CAIRO_FORMAT_A8 == format) {
+        qs->image = NULL;
+        qs->image_equiv = cairo_image_surface_create(format,
+                                                     width, height);
+        qs->p = NULL;
(Reporter)

Comment 5

8 years ago
we can't create qs->p - qpainter, because Qt does not support rendering into A8 image surface
Comment on attachment 481186 [details] [diff] [review]
Use  cairo image surface fallback for A8

Looks fine. Please upstream it.
Attachment #481186 - Flags: review?(jmuizelaar) → review+
(Reporter)

Comment 8

8 years ago
http://hg.mozilla.org/mozilla-central/rev/bb9d8fb1805f
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.