OSDN Git Service

assume x and y are always zero in qt_rectconvert<DST, SRC>()
authorIvailo Monev <xakepa10@laimg.moc>
Wed, 1 Apr 2020 21:08:48 +0000 (21:08 +0000)
committerIvailo Monev <xakepa10@laimg.moc>
Wed, 1 Apr 2020 21:08:48 +0000 (21:08 +0000)
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
src/gui/image/qimage.cpp
src/gui/painting/qdrawhelper_p.h

index ec8fbd5..7b08903 100644 (file)
@@ -2682,7 +2682,7 @@ static void convert_Mono_to_Indexed8(QImageData *dest, const QImageData *src, Qt
     {                                                                   \
         qt_rectconvert<DST, SRC>(reinterpret_cast<DST*>(dest->data),    \
                                  reinterpret_cast<const SRC*>(src->data), \
-                                 0, 0, src->width, src->height,         \
+                                 src->width, src->height,               \
                                  dest->bytes_per_line, src->bytes_per_line); \
     }
 
index 033c041..83ec475 100644 (file)
@@ -1558,10 +1558,10 @@ inline void qt_memconvert(qrgb666 *dest, const quint32 *src, int count)
 
 template <class DST, class SRC>
 inline void qt_rectconvert(DST *dest, const SRC *src,
-                           int x, int y, int width, int height,
+                           int width, int height,
                            int dstStride, int srcStride)
 {
-    char *d = (char*)(dest + x) + y * dstStride;
+    char *d = (char*)dest;
     const char *s = (const char*)(src);
     for (int i = 0; i < height; ++i) {
         qt_memconvert<DST,SRC>((DST*)d, (const SRC*)s, width);
@@ -1573,10 +1573,10 @@ inline void qt_rectconvert(DST *dest, const SRC *src,
 #define QT_RECTCONVERT_TRIVIAL_IMPL(T)                                  \
     template <>                                                         \
     inline void qt_rectconvert(T *dest, const T *src,                   \
-                               int x, int y, int width, int height,     \
+                               int width, int height,                   \
                                int dstStride, int srcStride)            \
     {                                                                   \
-        char *d = (char*)(dest + x) + y * dstStride; \
+        char *d = (char*)dest; \
         const char *s = (const char*)(src); \
         for (int i = 0; i < height; ++i) { \
             ::memcpy(d, s, width * sizeof(T)); \