Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.8.5, 5.1.1
-
Windows 7
-
739ad76846bc3d49472aacad9ed056cda314e26f
Description
tl;dr: QAlphaPaintEngine transparency flattening is way to aggressive. Causing unnecessary pre-rasterization of objects on top of transparent items.
Run the following sample code and select a vector file print drive like Adobe PDF, doPDF, or Microsfot XPS Document Writer.
Open the resulting file in view. Zoom far in to the letter 'A'. Notice the bottom half of the letter is in pre-rasterized bitmap.
The line of text actually sits on top of the transparent rectangle. There is no need to rasterize the text to emulate the effect. Only objects covered by the transparent item need to be rasterized.
QAlphaPaintEngine gathers bounding boxes of all transparent items and plays back the entire display list at the end of the page. This causes all objects intersecting the combined region to be rendered in low resolution bitmap.
This same issue applies to PostScript output in 4.x.
#include <QApplication> #include <QPrinter> #include <QPrintDialog> #include <QPainter> int main(int argc, char *argv[]) { QApplication a(argc, argv); QPrinter p; QPrintDialog d(&p); if(d.exec()) { QPainter painter(&p); painter.fillRect(100,100,200,200,QColor(100,0,0,50)); QFont f("Helvetica", 30); painter.setFont(f); painter.drawText(100, 120, "A simple line of text."); } return 0;//a.exec(); }
Attachments
Issue Links
- is required for
-
QTBUG-25384 QtPrintSupport - Windows issues
- Open
-
QTBUG-37693 QtPrintSupport - Painting Issues
- Open
-
QTBUG-37713 QtPrintSupport - 5.3 issues
- Open
- replaces
-
QTBUG-33831 Printing text to a Windows PDF printer has no text properties.
- Closed