From a7b8ef08415b8056661c3db5950842ee546891b9 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 29 Jan 2014 11:41:31 +0100 Subject: Export optimized premultiply and unpremultiply methods This patch optimizes the unpremultiply method further by using a lookup table to avoid any divisions at all. The opportunity is taken to export both premultiply and unpremultiply since they are commonly used methods relevant to the exported QRgb type that can be both premultiplied and unpremultipled ARGB. [ChangeLog][QtGui][QColor] Exported highly optimized methods for premultiply and unpremultiply of QRgb values. Change-Id: I658bcf57b0bc73c34c1765b64617d43b63ae820b Reviewed-by: Thiago Macieira Reviewed-by: Gunnar Sletta --- src/corelib/global/qprocessordetection.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/corelib/global/qprocessordetection.h') diff --git a/src/corelib/global/qprocessordetection.h b/src/corelib/global/qprocessordetection.h index a5eff7c7ce..cf7ee1b7aa 100644 --- a/src/corelib/global/qprocessordetection.h +++ b/src/corelib/global/qprocessordetection.h @@ -331,8 +331,7 @@ the size of the register). On some architectures where a pointer could be smaller than the register, the macro is defined above. - Try our best to define it to a literal, so it can be used in the preprocessor, - but fall back to sizeof(void*) on practically every 32-bit build. + Falls back to QT_POINTER_SIZE if not set explicitly for the platform. */ #ifndef Q_PROCESSOR_WORDSIZE # ifdef __SIZEOF_POINTER__ @@ -341,7 +340,7 @@ # elif defined(_LP64) || defined(__LP64__) || defined(WIN64) || defined(_WIN64) # define Q_PROCESSOR_WORDSIZE 8 # else -# define Q_PROCESSOR_WORDSIZE sizeof(void*) +# define Q_PROCESSOR_WORDSIZE QT_POINTER_SIZE # endif #endif -- cgit v1.2.3