Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 609659 Details for
Bug 803284
firefox is crashing while printing to pdf file
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch
cairo-print.patch (text/plain), 4.80 KB, created by
Martin Stransky
on 2012-09-04 12:13:20 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Martin Stransky
Created:
2012-09-04 12:13:20 UTC
Size:
4.80 KB
patch
obsolete
>diff --git a/gfx/cairo/cairo/src/cairo-pdf-surface.c b/gfx/cairo/cairo/src/cairo-pdf-surface.c >--- a/gfx/cairo/cairo/src/cairo-pdf-surface.c >+++ b/gfx/cairo/cairo/src/cairo-pdf-surface.c >@@ -1871,72 +1871,84 @@ _cairo_pdf_surface_emit_smask (cairo_pdf > static cairo_status_t > _cairo_pdf_surface_emit_image (cairo_pdf_surface_t *surface, > cairo_image_surface_t *image, > cairo_pdf_resource_t *image_res, > cairo_filter_t filter) > { > cairo_status_t status = CAIRO_STATUS_SUCCESS; > char *rgb; >- unsigned long rgb_size; >- uint32_t *pixel; >+ unsigned long rgb_size; > int i, x, y; > cairo_pdf_resource_t smask = {0}; /* squelch bogus compiler warning */ > cairo_bool_t need_smask; > const char *interpolate = "true"; > > /* These are the only image formats we currently support, (which > * makes things a lot simpler here). This is enforced through > * _cairo_pdf_surface_analyze_operation which only accept source surfaces of > * CONTENT_COLOR or CONTENT_COLOR_ALPHA. > */ > assert (image->format == CAIRO_FORMAT_RGB24 || > image->format == CAIRO_FORMAT_ARGB32 || >+ image->format == CAIRO_FORMAT_RGB16_565 || > image->format == CAIRO_FORMAT_A8 || > image->format == CAIRO_FORMAT_A1); > > rgb_size = image->height * image->width * 3; > rgb = _cairo_malloc_abc (image->width, image->height, 3); > if (unlikely (rgb == NULL)) { > status = _cairo_error (CAIRO_STATUS_NO_MEMORY); > goto CLEANUP; > } > > i = 0; >- for (y = 0; y < image->height; y++) { >- pixel = (uint32_t *) (image->data + y * image->stride); >- >- for (x = 0; x < image->width; x++, pixel++) { >- /* XXX: We're un-premultiplying alpha here. My reading of the PDF >- * specification suggests that we should be able to avoid having >- * to do this by filling in the SMask's Matte dictionary >- * appropriately, but my attempts to do that so far have >- * failed. */ >- if (image->format == CAIRO_FORMAT_ARGB32) { >- uint8_t a; >- a = (*pixel & 0xff000000) >> 24; >- if (a == 0) { >- rgb[i++] = 0; >- rgb[i++] = 0; >- rgb[i++] = 0; >- } else { >- rgb[i++] = (((*pixel & 0xff0000) >> 16) * 255 + a / 2) / a; >- rgb[i++] = (((*pixel & 0x00ff00) >> 8) * 255 + a / 2) / a; >- rgb[i++] = (((*pixel & 0x0000ff) >> 0) * 255 + a / 2) / a; >- } >- } else if (image->format == CAIRO_FORMAT_RGB24) { >- rgb[i++] = (*pixel & 0x00ff0000) >> 16; >- rgb[i++] = (*pixel & 0x0000ff00) >> 8; >- rgb[i++] = (*pixel & 0x000000ff) >> 0; >- } else { >- rgb[i++] = 0; >- rgb[i++] = 0; >- rgb[i++] = 0; >- } >- } >+ if (image->format == CAIRO_FORMAT_RGB16_565) { >+ for (y = 0; y < image->height; y++) { >+ uint16_t *pixel = (uint16_t *) (image->data + y * image->stride); >+ for (x = 0; x < image->width; x++, pixel++) { >+ rgb[i++] = (*pixel & 0xf800) >> 11; >+ rgb[i++] = (*pixel & 0x07e0) >> 5; >+ rgb[i++] = (*pixel & 0x001f) >> 0; >+ } >+ } >+ } >+ else { >+ for (y = 0; y < image->height; y++) { >+ uint32_t *pixel = (uint32_t *) (image->data + y * image->stride); >+ >+ for (x = 0; x < image->width; x++, pixel++) { >+ /* XXX: We're un-premultiplying alpha here. My reading of the PDF >+ * specification suggests that we should be able to avoid having >+ * to do this by filling in the SMask's Matte dictionary >+ * appropriately, but my attempts to do that so far have >+ * failed. */ >+ if (image->format == CAIRO_FORMAT_ARGB32) { >+ uint8_t a; >+ a = (*pixel & 0xff000000) >> 24; >+ if (a == 0) { >+ rgb[i++] = 0; >+ rgb[i++] = 0; >+ rgb[i++] = 0; >+ } else { >+ rgb[i++] = (((*pixel & 0xff0000) >> 16) * 255 + a / 2) / a; >+ rgb[i++] = (((*pixel & 0x00ff00) >> 8) * 255 + a / 2) / a; >+ rgb[i++] = (((*pixel & 0x0000ff) >> 0) * 255 + a / 2) / a; >+ } >+ } else if (image->format == CAIRO_FORMAT_RGB24) { >+ rgb[i++] = (*pixel & 0x00ff0000) >> 16; >+ rgb[i++] = (*pixel & 0x0000ff00) >> 8; >+ rgb[i++] = (*pixel & 0x000000ff) >> 0; >+ } else { >+ rgb[i++] = 0; >+ rgb[i++] = 0; >+ rgb[i++] = 0; >+ } >+ } >+ } > } > > need_smask = FALSE; > if (image->format == CAIRO_FORMAT_ARGB32 || > image->format == CAIRO_FORMAT_A8 || > image->format == CAIRO_FORMAT_A1) { > status = _cairo_pdf_surface_emit_smask (surface, image, &smask); > if (unlikely (status))
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 803284
:
571033
|
571034
| 609659