path: root/src/printsupport/kernel/qpaintengine_alpha_p.h
diff options
authorJan Arve Saether <>2014-05-21 11:10:50 +0200
committerThe Qt Project <>2014-05-31 14:29:31 +0200
commit739ad76846bc3d49472aacad9ed056cda314e26f (patch)
tree21c60bbcbb7075573e3d78dfce5f78a4c034bb66 /src/printsupport/kernel/qpaintengine_alpha_p.h
parent9ce8a6b94cd92ef78224bb126979b80d7764bfbf (diff)
Do not always fallback to bitmap printing when printing alpha.
The previous code resulted in that all regions that had some alpha blending content had to be rasterized as bitmaps. With this patch, we only need to fallback to proper alpha blending if there is a background content to blend against. If there is no background content we simly assume that the background is white (which happen to be the most common paper color). It will then be treated as a solid background. Task-number: QTBUG-33548 Change-Id: I9d2c9be95a701704cdb3724480421db49b4cdd98 Reviewed-by: Friedemann Kleint <> Reviewed-by: Gunnar Sletta <>
Diffstat (limited to 'src/printsupport/kernel/qpaintengine_alpha_p.h')
1 files changed, 4 insertions, 0 deletions
diff --git a/src/printsupport/kernel/qpaintengine_alpha_p.h b/src/printsupport/kernel/qpaintengine_alpha_p.h
index 8a0781d0d3..d3b10b3d3c 100644
--- a/src/printsupport/kernel/qpaintengine_alpha_p.h
+++ b/src/printsupport/kernel/qpaintengine_alpha_p.h
@@ -107,6 +107,7 @@ public:
QRegion m_alphargn;
QRegion m_cliprgn;
+ QRegion m_dirtyrgn;
bool m_hasalpha;
bool m_alphaPen;
@@ -122,6 +123,9 @@ public:
QPen m_pen;
void addAlphaRect(const QRectF &rect);
+ void addDirtyRect(const QRectF &rect) { m_dirtyrgn |= rect.toAlignedRect(); }
+ bool canSeeTroughBackground(bool somethingInRectHasAlpha, const QRectF &rect) const;
QRectF addPenWidth(const QPainterPath &path);
void drawAlphaImage(const QRectF &rect);
QRect toRect(const QRectF &rect) const;