Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:fboudra
qt
07_invpremul.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 07_invpremul.patch of Package qt
Description: rewrite INV_PREMUL to fix a glass jaw on Atom Author: Arjan van de Ven <arjan@linux.intel.com> --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -2298,6 +2298,22 @@ static void convert_ARGB_to_ARGB_PM(QIma } } + +static inline QRgb inv_premul(QRgb p) +{ + unsigned char alpha, red, green, blue; + + alpha = qAlpha(p); + if (alpha == 0) + return 0; + if (alpha == 255) + return p; + red = 255 * qRed(p) / alpha; + green = 255 * qGreen(p) / alpha; + blue = 255 * qBlue(p) / alpha; + return (alpha << 24) | (red << 16) | (green << 8) | blue; +} + static void convert_ARGB_PM_to_ARGB(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags) { Q_ASSERT(src->format == QImage::Format_ARGB32_Premultiplied); @@ -2313,7 +2329,7 @@ static void convert_ARGB_PM_to_ARGB(QIma for (int i = 0; i < src->height; ++i) { const QRgb *end = src_data + src->width; while (src_data < end) { - *dest_data = INV_PREMUL(*src_data); + *dest_data = inv_premul(*src_data); ++src_data; ++dest_data; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor