mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 19:02:59 +00:00
remove redundant quint32p drawing helper class
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
d0bb5455c2
commit
773d3a7549
3 changed files with 3 additions and 34 deletions
|
@ -2946,7 +2946,7 @@ void QImage::setPixel(int x, int y, uint index_or_rgb)
|
|||
qWarning("setPixel: Out of memory");
|
||||
return;
|
||||
}
|
||||
const quint32p p = quint32p::fromRawData(index_or_rgb);
|
||||
const quint32 p = index_or_rgb;
|
||||
switch(d->format) {
|
||||
case Format_Mono:
|
||||
case Format_MonoLSB:
|
||||
|
@ -2981,7 +2981,7 @@ void QImage::setPixel(int x, int y, uint index_or_rgb)
|
|||
((uint *)s)[x] = index_or_rgb;
|
||||
break;
|
||||
case Format_RGB16:
|
||||
((quint16 *)s)[x] = qt_colorConvert<quint16, quint32p>(p, 0);
|
||||
((quint16 *)s)[x] = qt_colorConvert<quint16, quint32>(p, 0);
|
||||
break;
|
||||
case Format_Invalid:
|
||||
case NImageFormats:
|
||||
|
|
|
@ -256,17 +256,6 @@ static void QT_FASTCALL destStoreRGB16(QRasterBuffer *rasterBuffer, int x, int y
|
|||
qt_memconvert<quint16, quint32>(data, buffer, length);
|
||||
}
|
||||
|
||||
template <class DST>
|
||||
static void QT_FASTCALL destStore(QRasterBuffer *rasterBuffer,
|
||||
int x, int y,
|
||||
const uint *buffer, int length)
|
||||
{
|
||||
DST *dest = reinterpret_cast<DST*>(rasterBuffer->scanLine(y)) + x;
|
||||
const quint32p *src = reinterpret_cast<const quint32p*>(buffer);
|
||||
while (length--)
|
||||
*dest++ = DST(*src++);
|
||||
}
|
||||
|
||||
static DestStoreProc destStoreProc[QImage::NImageFormats] =
|
||||
{
|
||||
0, // Format_Invalid
|
||||
|
@ -3302,7 +3291,7 @@ inline static void qt_rectfill_quint16(QRasterBuffer *rasterBuffer,
|
|||
quint32 color)
|
||||
{
|
||||
qt_rectfill<quint16>(reinterpret_cast<quint16*>(rasterBuffer->buffer()),
|
||||
qt_colorConvert<quint16, quint32p>(quint32p::fromRawData(color), 0),
|
||||
qt_colorConvert<quint16, quint32>(color, 0),
|
||||
x, y, width, height, rasterBuffer->bytesPerLine());
|
||||
}
|
||||
|
||||
|
|
|
@ -334,26 +334,6 @@ static inline uint PREMUL(uint x) {
|
|||
#define ARGB_COMBINE_ALPHA(argb, alpha) \
|
||||
((((argb >> 24) * alpha) >> 8) << 24) | (argb & 0x00ffffff)
|
||||
|
||||
class quint32p
|
||||
{
|
||||
public:
|
||||
inline quint32p(quint32 v) : data(PREMUL(v)) {}
|
||||
|
||||
inline operator quint32() const { return data; }
|
||||
inline operator quint16() const { return data; }
|
||||
|
||||
static inline quint32p fromRawData(quint32 v)
|
||||
{
|
||||
quint32p p;
|
||||
p.data = v;
|
||||
return p;
|
||||
}
|
||||
|
||||
private:
|
||||
quint32p() {}
|
||||
quint32 data;
|
||||
};
|
||||
|
||||
template <class DST, class SRC>
|
||||
inline DST qt_colorConvert(const SRC color, const DST dummy)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue