Changeset 769 for trunk/src/gui/painting/qdrawhelper.cpp
- Timestamp:
- Aug 2, 2010, 9:27:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.3 (added) merged: 768 /branches/vendor/nokia/qt/current merged: 767 /branches/vendor/nokia/qt/4.6.2 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/painting/qdrawhelper.cpp
r651 r769 1268 1268 d = d * cia 1269 1269 */ 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 1270 1284 static void QT_FASTCALL comp_func_solid_Clear(uint *dest, int length, uint, uint const_alpha) 1271 1285 { 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); 1282 1287 } 1283 1288 1284 1289 static void QT_FASTCALL comp_func_Clear(uint *dest, const uint *, int length, uint const_alpha) 1285 1290 { 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); 1296 1292 } 1297 1293 … … 2409 2405 return (dst * sa * 255 + da * (src2 - sa) * ((((16 * dst_np - 12 * 255) * dst_np + 3 * 65025) * dst_np) / 65025) + temp) / 65025; 2410 2406 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 2411 2410 return (dst * sa * 255 + da * (src2 - sa) * (int(sqrt(qreal(dst_np * 255))) - dst_np) + temp) / 65025; 2411 # endif 2412 2412 } 2413 2413 } … … 7175 7175 7176 7176 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); 7180 7180 7181 7181 int ia = 255 - a; … … 8093 8093 } 8094 8094 #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 } 8109 8132 #endif // SSE 8110 8133
Note:
See TracChangeset
for help on using the changeset viewer.