Ignore:
Timestamp:
Aug 2, 2010, 9:27:30 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.3 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/painting/qdrawhelper.cpp

    r651 r769  
    12681268  d = d * cia
    12691269*/
     1270#define comp_func_Clear_impl(dest, length, const_alpha)\
     1271{\
     1272    if (const_alpha == 255) {\
     1273        QT_MEMFILL_UINT(dest, length, 0);\
     1274    } else {\
     1275        int ialpha = 255 - const_alpha;\
     1276        PRELOAD_INIT(dest)\
     1277        for (int i = 0; i < length; ++i) {\
     1278            PRELOAD_COND(dest)\
     1279            dest[i] = BYTE_MUL(dest[i], ialpha);\
     1280        }\
     1281    }\
     1282}
     1283
    12701284static void QT_FASTCALL comp_func_solid_Clear(uint *dest, int length, uint, uint const_alpha)
    12711285{
    1272     if (const_alpha == 255) {
    1273         QT_MEMFILL_UINT(dest, length, 0);
    1274     } else {
    1275         int ialpha = 255 - const_alpha;
    1276         PRELOAD_INIT(dest)
    1277         for (int i = 0; i < length; ++i) {
    1278             PRELOAD_COND(dest)
    1279             dest[i] = BYTE_MUL(dest[i], ialpha);
    1280         }
    1281     }
     1286    comp_func_Clear_impl(dest, length, const_alpha);
    12821287}
    12831288
    12841289static void QT_FASTCALL comp_func_Clear(uint *dest, const uint *, int length, uint const_alpha)
    12851290{
    1286     if (const_alpha == 255) {
    1287         QT_MEMFILL_UINT(dest, length, 0);
    1288     } else {
    1289         int ialpha = 255 - const_alpha;
    1290         PRELOAD_INIT(dest)
    1291         for (int i = 0; i < length; ++i) {
    1292             PRELOAD_COND(dest)
    1293             dest[i] = BYTE_MUL(dest[i], ialpha);
    1294         }
    1295     }
     1291    comp_func_Clear_impl(dest, length, const_alpha);
    12961292}
    12971293
     
    24092405        return (dst * sa * 255 + da * (src2 - sa) * ((((16 * dst_np - 12 * 255) * dst_np + 3 * 65025) * dst_np) / 65025) + temp) / 65025;
    24102406    else {
     2407#   ifdef Q_CC_RVCT // needed to avoid compiler crash in RVCT 2.2
     2408        return (dst * sa * 255 + da * (src2 - sa) * (qIntSqrtInt(dst_np * 255) - dst_np) + temp) / 65025;
     2409#   else
    24112410        return (dst * sa * 255 + da * (src2 - sa) * (int(sqrt(qreal(dst_np * 255))) - dst_np) + temp) / 65025;
     2411#   endif
    24122412    }
    24132413}
     
    71757175
    71767176        int a = qGray(coverage);
    7177         sr = qt_div_255(sr * a);
    7178         sg = qt_div_255(sg * a);
    7179         sb = qt_div_255(sb * a);
     7177        sr = qt_div_255(qt_pow_rgb_invgamma[sr] * a);
     7178        sg = qt_div_255(qt_pow_rgb_invgamma[sg] * a);
     7179        sb = qt_div_255(qt_pow_rgb_invgamma[sb] * a);
    71807180
    71817181        int ia = 255 - a;
     
    80938093        }
    80948094#endif // 3DNOW
    8095         extern void qt_blend_rgb32_on_rgb32_sse(uchar *destPixels, int dbpl,
    8096                                                 const uchar *srcPixels, int sbpl,
    8097                                                 int w, int h,
    8098                                                 int const_alpha);
    8099         extern void qt_blend_argb32_on_argb32_sse(uchar *destPixels, int dbpl,
    8100                                                   const uchar *srcPixels, int sbpl,
    8101                                                   int w, int h,
    8102                                                   int const_alpha);
    8103 
    8104         qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse;
    8105         qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse;
    8106         qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse;
    8107         qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse;
    8108     }
     8095
     8096
     8097#ifdef QT_HAVE_SSE2
     8098        if (features & SSE2) {
     8099            extern void qt_blend_rgb32_on_rgb32_sse2(uchar *destPixels, int dbpl,
     8100                                                     const uchar *srcPixels, int sbpl,
     8101                                                     int w, int h,
     8102                                                     int const_alpha);
     8103            extern void qt_blend_argb32_on_argb32_sse2(uchar *destPixels, int dbpl,
     8104                                                       const uchar *srcPixels, int sbpl,
     8105                                                       int w, int h,
     8106                                                       int const_alpha);
     8107
     8108
     8109            qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse2;
     8110            qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse2;
     8111            qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse2;
     8112            qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse2;
     8113        } else
     8114#endif
     8115        {
     8116            extern void qt_blend_rgb32_on_rgb32_sse(uchar *destPixels, int dbpl,
     8117                                                    const uchar *srcPixels, int sbpl,
     8118                                                    int w, int h,
     8119                                                    int const_alpha);
     8120            extern void qt_blend_argb32_on_argb32_sse(uchar *destPixels, int dbpl,
     8121                                                      const uchar *srcPixels, int sbpl,
     8122                                                      int w, int h,
     8123                                                      int const_alpha);
     8124
     8125
     8126            qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse;
     8127            qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse;
     8128            qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse;
     8129            qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse;
     8130        }
     8131}
    81098132#endif // SSE
    81108133
Note: See TracChangeset for help on using the changeset viewer.