summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorDavid Boddie <david.boddie@nokia.com>2010-12-07 13:57:38 (GMT)
committerDavid Boddie <david.boddie@nokia.com>2010-12-07 13:57:38 (GMT)
commitd8fb8ca3a378743eebb8464f7910a5e6d1870c01 (patch)
tree9c31a017163a532946f10107b8d9f4405ed1c9db /src/gui/painting
parentb5915ef3a6d0417440ad82e9369d6679505b953e (diff)
parent076bba6c901e292b61fffb7a91020075dcd84919 (diff)
downloadQt-d8fb8ca3a378743eebb8464f7910a5e6d1870c01.zip
Qt-d8fb8ca3a378743eebb8464f7910a5e6d1870c01.tar.gz
Qt-d8fb8ca3a378743eebb8464f7910a5e6d1870c01.tar.bz2
Merge branch 'qdoc-simplified' into mimir-simplified
Conflicts: doc/src/platforms/compiler-notes.qdoc tools/qdoc3/ditaxmlgenerator.cpp tools/qdoc3/ditaxmlgenerator.h tools/qdoc3/htmlgenerator.cpp tools/qdoc3/htmlgenerator.h tools/qdoc3/node.cpp tools/qdoc3/pagegenerator.h
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/painting.pri7
-rw-r--r--src/gui/painting/qbackingstore.cpp2
-rw-r--r--src/gui/painting/qblendfunctions_armv6_rvct.s222
-rw-r--r--src/gui/painting/qdrawhelper.cpp159
-rw-r--r--src/gui/painting/qdrawhelper_arm_simd.cpp332
-rw-r--r--src/gui/painting/qdrawhelper_arm_simd_p.h (renamed from src/gui/painting/qdrawhelper_armv6_p.h)19
-rw-r--r--src/gui/painting/qdrawhelper_armv6_rvct.inc496
-rw-r--r--src/gui/painting/qdrawhelper_armv6_rvct.s177
-rw-r--r--src/gui/painting/qgraphicssystem_qws.cpp2
-rw-r--r--src/gui/painting/qimagescale.cpp2
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp11
-rw-r--r--src/gui/painting/qpainter.cpp4
-rw-r--r--src/gui/painting/qpdf.cpp4
-rw-r--r--src/gui/painting/qregion.h2
-rw-r--r--src/gui/painting/qtextureglyphcache.cpp26
-rw-r--r--src/gui/painting/qtextureglyphcache_p.h4
16 files changed, 410 insertions, 1059 deletions
diff --git a/src/gui/painting/painting.pri b/src/gui/painting/painting.pri
index 793d380..bd37d9f 100644
--- a/src/gui/painting/painting.pri
+++ b/src/gui/painting/painting.pri
@@ -234,13 +234,14 @@ embedded {
symbian {
- HEADERS += painting/qwindowsurface_s60_p.h
+ HEADERS += painting/qwindowsurface_s60_p.h \
+ painting/qdrawhelper_arm_simd_p.h
SOURCES += painting/qwindowsurface_s60.cpp
armccIfdefBlock = \
"$${LITERAL_HASH}if defined(ARMV6)" \
+ "MACRO QT_HAVE_ARM_SIMD" \
"SOURCEPATH painting" \
- "SOURCE qblendfunctions_armv6_rvct.s" \
- "SOURCE qdrawhelper_armv6_rvct.s" \
+ "SOURCE qdrawhelper_arm_simd.cpp" \
"$${LITERAL_HASH}endif"
MMP_RULES += armccIfdefBlock
diff --git a/src/gui/painting/qbackingstore.cpp b/src/gui/painting/qbackingstore.cpp
index ac9b994..8a1c154 100644
--- a/src/gui/painting/qbackingstore.cpp
+++ b/src/gui/painting/qbackingstore.cpp
@@ -446,7 +446,7 @@ QRegion QWidgetBackingStore::dirtyRegion(QWidget *widget) const
/*!
Returns the static content inside the \a parent if non-zero; otherwise the static content
- for the entire backing store is returned. The content will be clipped to \a withingClipRect
+ for the entire backing store is returned. The content will be clipped to \a withinClipRect
if non-empty.
*/
QRegion QWidgetBackingStore::staticContents(QWidget *parent, const QRect &withinClipRect) const
diff --git a/src/gui/painting/qblendfunctions_armv6_rvct.s b/src/gui/painting/qblendfunctions_armv6_rvct.s
deleted file mode 100644
index 1e3faa9..0000000
--- a/src/gui/painting/qblendfunctions_armv6_rvct.s
+++ /dev/null
@@ -1,222 +0,0 @@
-;****************************************************************************
-;**
-;** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-;** All rights reserved.
-;** Contact: Nokia Corporation (qt-info@nokia.com)
-;**
-;** This file is part of the QtGui module of the Qt Toolkit.
-;**
-;** $QT_BEGIN_LICENSE:LGPL$
-;** No Commercial Usage
-;** This file contains pre-release code and may not be distributed.
-;** You may use this file in accordance with the terms and conditions
-;** contained in the Technology Preview License Agreement accompanying
-;** this package.
-;**
-;** GNU Lesser General Public License Usage
-;** Alternatively, this file may be used under the terms of the GNU Lesser
-;** General Public License version 2.1 as published by the Free Software
-;** Foundation and appearing in the file LICENSE.LGPL included in the
-;** packaging of this file. Please review the following information to
-;** ensure the GNU Lesser General Public License version 2.1 requirements
-;** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-;**
-;** In addition, as a special exception, Nokia gives you certain additional
-;** rights. These rights are described in the Nokia Qt LGPL Exception
-;** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-;**
-;** If you have questions regarding the use of this file, please contact
-;** Nokia at qt-info@nokia.com.
-;**
-;**
-;**
-;**
-;**
-;**
-;**
-;**
-;** $QT_END_LICENSE$
-;**
-;****************************************************************************
-
-;
-; W A R N I N G
-; -------------
-;
-; This file is not part of the Qt API. It exists purely as an
-; implementation detail. This header file may change from version to
-; version without notice, or even be removed.
-;
-; We mean it.
-;
-
-
- ARM
- PRESERVE8
-
- INCLUDE qdrawhelper_armv6_rvct.inc
-
-
-;-----------------------------------------------------------------------------
-; qt_blend_rgb32_on_rgb32_arm
-;
-; @brief
-;
-; @param dest Destination pixels (r0)
-; @param dbpl Destination bytes per line (r1)
-; @param src Source pixels (r2)
-; @param sbpl Source bytes per line (r3)
-; @param w Width (s0 -> r4)
-; @param h Height (s1 -> r5)
-; @param const_alpha Constant alpha (s2 -> r6)
-;
-;---------------------------------------------------------------------------
-qt_blend_rgb32_on_rgb32_armv6 Function
- stmfd sp!, {r4-r12, r14}
-
- ; read arguments off the stack
- add r8, sp, #10 * 4
- ldmia r8, {r9-r11}
-
- ; Reorganize registers
-
- mov r4, r10
- mov r5, r1
- mov r6, r3
-
- mov r1, r2
- mov r2, r9
- mov r3, r11
-
- ; Now we have registers
- ; @param dest Destination pixels (r0)
- ; @param src Source pixels (r1)
- ; @param w Width (r2)
- ; @param const_alpha Constant alpha (r3)
- ; @param h Height (r4)
- ; @param dbpl Destination bytes per line (r5)
- ; @param sbpl Source bytes per line (r6)
-
- cmp r3, #256 ; test if we have fully opaque constant alpha value
- bne rgb32_blend_const_alpha ; branch if not
-
-rgb32_blend_loop
-
- subs r4, r4, #1
- bmi rgb32_blend_exit ; while(h--)
-
-rgb321 PixCpySafe r0, r1, r2
-
- add r0, r0, r5 ; dest = dest + dbpl
- add r1, r1, r6 ; src = src + sbpl
-
- b rgb32_blend_loop
-
-
-rgb32_blend_const_alpha
-
- ;ldr r14, =ComponentHalf ; load 0x800080 to r14
- mov r14, #0x800000
- add r14, r14, #0x80
-
- sub r3, r3, #1 ; const_alpha -= 1;
-
-rgb32_blend_loop_const_alpha
-
- subs r4, r4, #1
- bmi rgb32_blend_exit ; while(h--)
-
-rgb322 BlendRowSafe PixelSourceOverConstAlpha
-
- add r0, r0, r5 ; dest = dest + dbpl
- add r1, r1, r6 ; src = src + sbpl
-
- b rgb32_blend_loop_const_alpha
-
-rgb32_blend_exit
-
- ldmfd sp!, {r4-r12, pc} ; pop and return
-
-
-
-;-----------------------------------------------------------------------------
-; qt_blend_argb32_on_argb32_arm
-;
-; @brief
-;
-; @param dest Destination pixels (r0)
-; @param dbpl Destination bytes per line (r1)
-; @param src Source pixels (r2)
-; @param sbpl Source bytes per line (r3)
-; @param w Width (s0 -> r4)
-; @param h Height (s1 -> r5)
-; @param const_alpha Constant alpha (s2 -> r6)
-;
-;---------------------------------------------------------------------------
-qt_blend_argb32_on_argb32_armv6 Function
- stmfd sp!, {r4-r12, r14}
-
- ; read arguments off the stack
- add r8, sp, #10 * 4
- ldmia r8, {r9-r11}
-
- ; Reorganize registers
-
- mov r4, r10
- mov r5, r1
- mov r6, r3
-
- mov r1, r2
- mov r2, r9
- mov r3, r11
-
- ; Now we have registers
- ; @param dest Destination pixels (r0)
- ; @param src Source pixels (r1)
- ; @param w Width (r2)
- ; @param const_alpha Constant alpha (r3)
- ; @param h Height (r4)
- ; @param dbpl Destination bytes per line (r5)
- ; @param sbpl Source bytes per line (r6)
-
- ;ldr r14, =ComponentHalf ; load 0x800080 to r14
- mov r14, #0x800000
- add r14, r14, #0x80
-
- cmp r3, #256 ; test if we have fully opaque constant alpha value
- bne argb32_blend_const_alpha ; branch if not
-
-argb32_blend_loop
-
- subs r4, r4, #1
- bmi argb32_blend_exit ; while(h--)
-
-argb321 BlendRowSafe PixelSourceOver
-
- add r0, r0, r5 ; dest = dest + dbpl
- add r1, r1, r6 ; src = src + sbpl
-
- b argb32_blend_loop
-
-argb32_blend_const_alpha
-
- sub r3, r3, #1 ; const_alpha -= 1;
-
-argb32_blend_loop_const_alpha
-
- subs r4, r4, #1
- bmi argb32_blend_exit ; while(h--)
-
-argb322 BlendRowSafe PixelSourceOverConstAlpha
-
- add r0, r0, r5 ; dest = dest + dbpl
- add r1, r1, r6 ; src = src + sbpl
-
- b argb32_blend_loop_const_alpha
-
-argb32_blend_exit
-
- ldmfd sp!, {r4-r12, pc} ; pop and return
-
-
- END ; File end
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index 5f190ba..a4ab278 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -43,7 +43,7 @@
#include <private/qpaintengine_raster_p.h>
#include <private/qpainter_p.h>
#include <private/qdrawhelper_x86_p.h>
-#include <private/qdrawhelper_armv6_p.h>
+#include <private/qdrawhelper_arm_simd_p.h>
#include <private/qdrawhelper_neon_p.h>
#include <private/qmath_p.h>
#include <qmath.h>
@@ -7678,96 +7678,6 @@ static void qt_memfill16_setup(quint16 *dest, quint16 value, int count);
qt_memfill32_func qt_memfill32 = qt_memfill32_setup;
qt_memfill16_func qt_memfill16 = qt_memfill16_setup;
-#if defined(Q_CC_RVCT) && defined(QT_HAVE_ARMV6)
-// Move these to qdrawhelper_arm.c when all
-// functions are implemented using arm assembly.
-static CompositionFunctionSolid qt_functionForModeSolid_ARMv6[numCompositionFunctions] = {
- comp_func_solid_SourceOver,
- comp_func_solid_DestinationOver,
- comp_func_solid_Clear,
- comp_func_solid_Source,
- comp_func_solid_Destination,
- comp_func_solid_SourceIn,
- comp_func_solid_DestinationIn,
- comp_func_solid_SourceOut,
- comp_func_solid_DestinationOut,
- comp_func_solid_SourceAtop,
- comp_func_solid_DestinationAtop,
- comp_func_solid_XOR,
- comp_func_solid_Plus,
- comp_func_solid_Multiply,
- comp_func_solid_Screen,
- comp_func_solid_Overlay,
- comp_func_solid_Darken,
- comp_func_solid_Lighten,
- comp_func_solid_ColorDodge,
- comp_func_solid_ColorBurn,
- comp_func_solid_HardLight,
- comp_func_solid_SoftLight,
- comp_func_solid_Difference,
- comp_func_solid_Exclusion,
- rasterop_solid_SourceOrDestination,
- rasterop_solid_SourceAndDestination,
- rasterop_solid_SourceXorDestination,
- rasterop_solid_NotSourceAndNotDestination,
- rasterop_solid_NotSourceOrNotDestination,
- rasterop_solid_NotSourceXorDestination,
- rasterop_solid_NotSource,
- rasterop_solid_NotSourceAndDestination,
- rasterop_solid_SourceAndNotDestination
-};
-
-static CompositionFunction qt_functionForMode_ARMv6[numCompositionFunctions] = {
- comp_func_SourceOver_armv6,
- comp_func_DestinationOver,
- comp_func_Clear,
- comp_func_Source_armv6,
- comp_func_Destination,
- comp_func_SourceIn,
- comp_func_DestinationIn,
- comp_func_SourceOut,
- comp_func_DestinationOut,
- comp_func_SourceAtop,
- comp_func_DestinationAtop,
- comp_func_XOR,
- comp_func_Plus,
- comp_func_Multiply,
- comp_func_Screen,
- comp_func_Overlay,
- comp_func_Darken,
- comp_func_Lighten,
- comp_func_ColorDodge,
- comp_func_ColorBurn,
- comp_func_HardLight,
- comp_func_SoftLight,
- comp_func_Difference,
- comp_func_Exclusion,
- rasterop_SourceOrDestination,
- rasterop_SourceAndDestination,
- rasterop_SourceXorDestination,
- rasterop_NotSourceAndNotDestination,
- rasterop_NotSourceOrNotDestination,
- rasterop_NotSourceXorDestination,
- rasterop_NotSource,
- rasterop_NotSourceAndDestination,
- rasterop_SourceAndNotDestination
-};
-
-static void qt_blend_color_argb_armv6(int count, const QSpan *spans, void *userData)
-{
- QSpanData *data = reinterpret_cast<QSpanData *>(userData);
-
- CompositionFunctionSolid func = qt_functionForModeSolid_ARMv6[data->rasterBuffer->compositionMode];
- while (count--) {
- uint *target = ((uint *)data->rasterBuffer->scanLine(spans->y)) + spans->x;
- func(target, spans->len, data->solid.color, spans->coverage);
- ++spans;
- }
-}
-
-#endif // Q_CC_RVCT && QT_HAVE_ARMV6
-
-
void qInitDrawhelperAsm()
{
@@ -7938,46 +7848,39 @@ void qInitDrawhelperAsm()
}
#endif // IWMMXT
-#if defined(Q_CC_RVCT) && defined(QT_HAVE_ARMV6)
- functionForModeAsm = qt_functionForMode_ARMv6;
- functionForModeSolidAsm = qt_functionForModeSolid_ARMv6;
+#if defined(QT_HAVE_ARM_SIMD)
+ qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_arm_simd;
+ qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_arm_simd;
+ qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_arm_simd;
+ qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_arm_simd;
+#elif defined(QT_HAVE_NEON)
+ if (features & NEON) {
+ qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_neon;
+ qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_neon;
+ qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_neon;
+ qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_neon;
+ qBlendFunctions[QImage::Format_RGB16][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_rgb16_neon;
+ qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB16] = qt_blend_rgb16_on_argb32_neon;
+ qBlendFunctions[QImage::Format_RGB16][QImage::Format_RGB16] = qt_blend_rgb16_on_rgb16_neon;
+
+ qScaleFunctions[QImage::Format_RGB16][QImage::Format_ARGB32_Premultiplied] = qt_scale_image_argb32_on_rgb16_neon;
+ qScaleFunctions[QImage::Format_RGB16][QImage::Format_RGB16] = qt_scale_image_rgb16_on_rgb16_neon;
- qt_memfill32 = qt_memfill32_armv6;
+ qTransformFunctions[QImage::Format_RGB16][QImage::Format_ARGB32_Premultiplied] = qt_transform_image_argb32_on_rgb16_neon;
+ qTransformFunctions[QImage::Format_RGB16][QImage::Format_RGB16] = qt_transform_image_rgb16_on_rgb16_neon;
- qDrawHelper[QImage::Format_ARGB32_Premultiplied].blendColor = qt_blend_color_argb_armv6;
+ qDrawHelper[QImage::Format_RGB16].alphamapBlit = qt_alphamapblit_quint16_neon;
- qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_armv6;
- qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_armv6;
- qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_armv6;
- qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_armv6;
-#elif defined(QT_HAVE_NEON)
- if (features & NEON) {
- qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_neon;
- qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_neon;
- qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_neon;
- qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_neon;
- qBlendFunctions[QImage::Format_RGB16][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_rgb16_neon;
- qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB16] = qt_blend_rgb16_on_argb32_neon;
- qBlendFunctions[QImage::Format_RGB16][QImage::Format_RGB16] = qt_blend_rgb16_on_rgb16_neon;
-
- qScaleFunctions[QImage::Format_RGB16][QImage::Format_ARGB32_Premultiplied] = qt_scale_image_argb32_on_rgb16_neon;
- qScaleFunctions[QImage::Format_RGB16][QImage::Format_RGB16] = qt_scale_image_rgb16_on_rgb16_neon;
-
- qTransformFunctions[QImage::Format_RGB16][QImage::Format_ARGB32_Premultiplied] = qt_transform_image_argb32_on_rgb16_neon;
- qTransformFunctions[QImage::Format_RGB16][QImage::Format_RGB16] = qt_transform_image_rgb16_on_rgb16_neon;
-
- qDrawHelper[QImage::Format_RGB16].alphamapBlit = qt_alphamapblit_quint16_neon;
-
- functionForMode_C[QPainter::CompositionMode_SourceOver] = qt_blend_argb32_on_argb32_scanline_neon;
- functionForModeSolid_C[QPainter::CompositionMode_SourceOver] = comp_func_solid_SourceOver_neon;
- functionForMode_C[QPainter::CompositionMode_Plus] = comp_func_Plus_neon;
- destFetchProc[QImage::Format_RGB16] = qt_destFetchRGB16_neon;
- destStoreProc[QImage::Format_RGB16] = qt_destStoreRGB16_neon;
-
- qMemRotateFunctions[QImage::Format_RGB16][0] = qt_memrotate90_16_neon;
- qMemRotateFunctions[QImage::Format_RGB16][2] = qt_memrotate270_16_neon;
- qt_memfill32 = qt_memfill32_neon;
- }
+ functionForMode_C[QPainter::CompositionMode_SourceOver] = qt_blend_argb32_on_argb32_scanline_neon;
+ functionForModeSolid_C[QPainter::CompositionMode_SourceOver] = comp_func_solid_SourceOver_neon;
+ functionForMode_C[QPainter::CompositionMode_Plus] = comp_func_Plus_neon;
+ destFetchProc[QImage::Format_RGB16] = qt_destFetchRGB16_neon;
+ destStoreProc[QImage::Format_RGB16] = qt_destStoreRGB16_neon;
+
+ qMemRotateFunctions[QImage::Format_RGB16][0] = qt_memrotate90_16_neon;
+ qMemRotateFunctions[QImage::Format_RGB16][2] = qt_memrotate270_16_neon;
+ qt_memfill32 = qt_memfill32_neon;
+ }
#endif
if (functionForModeSolidAsm) {
diff --git a/src/gui/painting/qdrawhelper_arm_simd.cpp b/src/gui/painting/qdrawhelper_arm_simd.cpp
new file mode 100644
index 0000000..2a5f5e4
--- /dev/null
+++ b/src/gui/painting/qdrawhelper_arm_simd.cpp
@@ -0,0 +1,332 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdrawhelper_arm_simd_p.h"
+
+#include <private/qpaintengine_raster_p.h>
+#include <private/qblendfunctions_p.h>
+
+#ifdef QT_HAVE_ARM_SIMD
+
+#if defined(Q_OS_SYMBIAN)
+#if !defined(__SWITCH_TO_ARM)
+#ifdef __MARM_THUMB__
+#ifndef __ARMCC__
+#define __SWITCH_TO_ARM asm("push {r0} ");\
+ asm("add r0, pc, #4 ");\
+ asm("bx r0 ");\
+ asm("nop ");\
+ asm(".align 2 ");\
+ asm(".code 32 ");\
+ asm("ldr r0, [sp], #4 ")
+#define __END_ARM asm(".code 16 ")
+#else
+#define __SWITCH_TO_ARM asm(".code 32 ");
+#define __END_ARM
+#endif // __ARMCC__
+#else
+#define __SWITCH_TO_ARM
+#define __END_ARM
+#endif //__MARM_THUMB__
+#endif
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(Q_CC_RVCT)
+__asm void qt_blend_argb32_on_argb32_arm_simd(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha)
+{
+#ifndef __ARMCC__
+ __SWITCH_TO_ARM;
+#else
+ CODE32
+#endif // __ARMCC__
+
+ stmfd sp!, {r4-r12, r14}
+
+ // read arguments off the stack
+ add r8, sp, #10 * 4
+ ldmia r8, {r4-r6}
+
+ // adjust dbpl and sbpl
+ mov r14, #4
+ mul r14, r4, r14
+ sub r1, r1, r14
+ sub r3, r3, r14
+
+ // load 0xFF00FF00 to r12
+ mov r12, #0xFF000000
+ add r12, r12, #0xFF00
+
+ // load 0x800080 to r14
+ mov r14, #0x800000
+ add r14, r14, #0x80
+
+ /*
+ Registers:
+ r0 dst
+ r1 dbpl
+ r2 src
+ r3 sbpl
+ r4 w
+ r5 h
+ r6 const_alpha
+ r12 0xFF0000
+ r14 0x800080
+ */
+
+ cmp r6, #256 //test if we have fully opaque constant alpha value
+ bne argb32constalpha // branch if not
+
+argb32_next_row
+
+ mov r7, r4
+
+argb32_next_pixel
+
+ ldr r8, [r2], #4 // load src pixel
+
+ // Negate r8 and extract src alpha
+ mvn r11, r8 // bitwise not
+ uxtb r11, r11, ror #24
+
+ cmp r11, #0 // test for full src opacity (negated)
+ beq argb32_no_blend
+
+ cmp r11, #255 // test for full src transparency (negated)
+ addeq r0, #4
+ beq argb32_nop
+
+ ldr r9, [r0] // load dst pixel
+
+ // blend
+ uxtb16 r10, r9
+ uxtb16 r6, r9, ror #8
+ mla r10, r11, r10, r14
+ mla r9, r6, r11, r14
+ uxtab16 r10, r10, r10, ror #8
+ uxtab16 r9, r9, r9, ror #8
+ and r9, r9, r12
+ uxtab16 r10, r9, r10, ror #8
+
+ uqadd8 r8, r10, r8
+
+argb32_no_blend
+
+ str r8, [r0], #4
+
+argb32_nop
+
+ subs r7, r7, #1
+ bgt argb32_next_pixel
+
+ add r0, r0, r1 // dest = dest + dbpl
+ add r2, r2, r3 // src = src + sbpl
+
+ subs r5, r5, #1
+ bgt argb32_next_row
+
+ b argb32_blend_exit
+
+argb32constalpha
+
+ cmp r6, #0
+ beq argb32_blend_exit
+
+ ; const_alpha = (const_alpha * 255) >> 8;
+ mov r11, #255
+ mul r6, r6, r11
+ mov r11, r6, lsr #8
+
+argb32constalpha_next_row
+
+ mov r7, r4
+
+argb32constalpha_next_pixel
+
+ ldr r9, [r2], #4 // load src pixel
+
+ // blend
+ uxtb16 r10, r9
+ uxtb16 r6, r9, ror #8
+ mla r10, r11, r10, r14
+ mla r9, r6, r11, r14
+ uxtab16 r10, r10, r10, ror #8
+ uxtab16 r9, r9, r9, ror #8
+ and r9, r9, r12
+ uxtab16 r8, r9, r10, ror #8
+
+ ldr r9, [r0] // load dst pixel
+
+ // blend
+ uxtb16 r10, r9
+ uxtb16 r6, r9, ror #8
+
+ // Negate r11 and extract src alpha
+ mvn r9, r11 // bitwise not
+ uxtb r9, r9, ror #24
+
+ mla r10, r9, r10, r14
+ mla r9, r6, r9, r14
+ uxtab16 r10, r10, r10, ror #8
+ uxtab16 r9, r9, r9, ror #8
+ and r9, r9, r12
+ uxtab16 r10, r9, r10, ror #8
+
+ uqadd8 r8, r10, r8
+
+ str r8, [r0], #4
+
+ subs r7, r7, #1
+ bgt argb32constalpha_next_pixel
+
+ add r0, r0, r1 // dest = dest + dbpl
+ add r2, r2, r3 // src = src + sbpl
+
+ subs r5, r5, #1
+ bgt argb32constalpha_next_row
+
+argb32_blend_exit
+
+ // Restore registers
+ ldmfd sp!, {r4-r12, lr}
+ bx lr
+
+ __END_ARM
+}
+
+void qt_blend_rgb32_on_rgb32_arm_simd(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha)
+{
+ if (const_alpha != 256) {
+ qt_blend_argb32_on_argb32_arm_simd(destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha);
+ return;
+ }
+
+ const uint *src = (const uint *) srcPixels;
+ uint *dst = (uint *) destPixels;
+ if (w <= 64) {
+ for (int y=0; y<h; ++y) {
+ qt_memconvert(dst, src, w);
+ dst = (quint32 *)(((uchar *) dst) + dbpl);
+ src = (const quint32 *)(((const uchar *) src) + sbpl);
+ }
+ } else {
+ int len = w * 4;
+ for (int y=0; y<h; ++y) {
+ memcpy(dst, src, len);
+ dst = (quint32 *)(((uchar *) dst) + dbpl);
+ src = (const quint32 *)(((const uchar *) src) + sbpl);
+ }
+ }
+}
+
+#else // defined(Q_OS_SYMBIAN) && defined(Q_CC_RVCT)
+
+// TODO: add GNU assembler instructions and support for other platforms.
+// Default to C code for now
+
+void qt_blend_argb32_on_argb32_arm_simd(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha)
+{
+ const uint *src = (const uint *) srcPixels;
+ uint *dst = (uint *) destPixels;
+ if (const_alpha == 256) {
+ for (int y=0; y<h; ++y) {
+ for (int x=0; x<w; ++x) {
+ uint s = src[x];
+ if (s >= 0xff000000)
+ dst[x] = s;
+ else if (s != 0)
+ dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s));
+ }
+ dst = (quint32 *)(((uchar *) dst) + dbpl);
+ src = (const quint32 *)(((const uchar *) src) + sbpl);
+ }
+ } else if (const_alpha != 0) {
+ const_alpha = (const_alpha * 255) >> 8;
+ for (int y=0; y<h; ++y) {
+ for (int x=0; x<w; ++x) {
+ uint s = BYTE_MUL(src[x], const_alpha);
+ dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s));
+ }
+ dst = (quint32 *)(((uchar *) dst) + dbpl);
+ src = (const quint32 *)(((const uchar *) src) + sbpl);
+ }
+ }
+}
+
+void qt_blend_rgb32_on_rgb32_arm_simd(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha)
+{
+ if (const_alpha != 256) {
+ qt_blend_argb32_on_argb32_arm_simd(destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha);
+ return;
+ }
+
+ const uint *src = (const uint *) srcPixels;
+ uint *dst = (uint *) destPixels;
+ if (w <= 64) {
+ for (int y=0; y<h; ++y) {
+ qt_memconvert(dst, src, w);
+ dst = (quint32 *)(((uchar *) dst) + dbpl);
+ src = (const quint32 *)(((const uchar *) src) + sbpl);
+ }
+ } else {
+ int len = w * 4;
+ for (int y=0; y<h; ++y) {
+ memcpy(dst, src, len);
+ dst = (quint32 *)(((uchar *) dst) + dbpl);
+ src = (const quint32 *)(((const uchar *) src) + sbpl);
+ }
+ }
+}
+
+#endif
+
+#endif // QT_HAVE_ARMV_SIMD
diff --git a/src/gui/painting/qdrawhelper_armv6_p.h b/src/gui/painting/qdrawhelper_arm_simd_p.h
index e58f8bb..6c96a84 100644
--- a/src/gui/painting/qdrawhelper_armv6_p.h
+++ b/src/gui/painting/qdrawhelper_arm_simd_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QDRAWHELPER_ARMV6_P_H
-#define QDRAWHELPER_ARMV6_P_H
+#ifndef QDRAWHELPER_ARM_SIMD_P_H
+#define QDRAWHELPER_ARM_SIMD_P_H
//
// W A R N I N G
@@ -57,25 +57,20 @@
QT_BEGIN_NAMESPACE
-#if defined(Q_CC_RVCT) && defined(QT_HAVE_ARMV6)
+#if defined(QT_HAVE_ARM_SIMD)
-extern "C" void qt_blend_rgb32_on_rgb32_armv6(uchar *destPixels, int dbpl,
+void qt_blend_argb32_on_argb32_arm_simd(uchar *destPixels, int dbpl,
const uchar *srcPixels, int sbpl,
int w, int h,
int const_alpha);
-extern "C" void qt_blend_argb32_on_argb32_armv6(uchar *destPixels, int dbpl,
+void qt_blend_rgb32_on_rgb32_arm_simd(uchar *destPixels, int dbpl,
const uchar *srcPixels, int sbpl,
int w, int h,
int const_alpha);
-extern "C" void qt_memfill32_armv6(quint32 *dest, quint32 value, int count);
-
-extern "C" void comp_func_Source_armv6(uint *dest, const uint *src, int length, uint const_alpha);
-extern "C" void comp_func_SourceOver_armv6(uint *dest, const uint *src, int length, uint const_alpha);
-
-#endif // QT_HAVE_ARMV6
+#endif // QT_HAVE_ARM_SIMD
QT_END_NAMESPACE
-#endif // QDRAWHELPER_ARMV6_P_H
+#endif // QDRAWHELPER_ARM_SIMD_P_H
diff --git a/src/gui/painting/qdrawhelper_armv6_rvct.inc b/src/gui/painting/qdrawhelper_armv6_rvct.inc
deleted file mode 100644
index 8c6d803..0000000
--- a/src/gui/painting/qdrawhelper_armv6_rvct.inc
+++ /dev/null
@@ -1,496 +0,0 @@
-;****************************************************************************
-;**
-;** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-;** All rights reserved.
-;** Contact: Nokia Corporation (qt-info@nokia.com)
-;**
-;** This file is part of the QtGui module of the Qt Toolkit.
-;**
-;** $QT_BEGIN_LICENSE:LGPL$
-;** No Commercial Usage
-;** This file contains pre-release code and may not be distributed.
-;** You may use this file in accordance with the terms and conditions
-;** contained in the Technology Preview License Agreement accompanying
-;** this package.
-;**
-;** GNU Lesser General Public License Usage
-;** Alternatively, this file may be used under the terms of the GNU Lesser
-;** General Public License version 2.1 as published by the Free Software
-;** Foundation and appearing in the file LICENSE.LGPL included in the
-;** packaging of this file. Please review the following information to
-;** ensure the GNU Lesser General Public License version 2.1 requirements
-;** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-;**
-;** In addition, as a special exception, Nokia gives you certain additional
-;** rights. These rights are described in the Nokia Qt LGPL Exception
-;** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-;**
-;** If you have questions regarding the use of this file, please contact
-;** Nokia at qt-info@nokia.com.
-;**
-;**
-;**
-;**
-;**
-;**
-;**
-;**
-;** $QT_END_LICENSE$
-;**
-;****************************************************************************
-
-;
-; W A R N I N G
-; -------------
-;
-; This file is not part of the Qt API. It exists purely as an
-; implementation detail. This header file may change from version to
-; version without notice, or even be removed.
-;
-; We mean it.
-;
-
-;-----------------------------------------------------------------------------
-; Globals.
-; Earch marcro expects that caller has loaded 0x800080 to r14.
-;-----------------------------------------------------------------------------
-
-ComponentHalf EQU 0x800080
-
-;-----------------------------------------------------------------------------
-; ARM assembly implementations of accelerated graphics operations.
-;
-; Conventions:
-;
-; - r0 = Target buffer pointer
-; - r1 = Source buffer pointer
-; - r2 = Length of the buffer to blend
-; - r3 = Constant alpha for source buffer
-;
-;-----------------------------------------------------------------------------
-
-; A macro for transparently defining ARM functions
- MACRO
-$func Function
- AREA Function_$func, CODE
- GLOBAL $func
- ALIGN 4
- CODE32
-$func
- MEND
-
-
-;-----------------------------------------------------------------------------
-; Armv6 boosted implementation of BYTE_MUL(...) function found in qdrawhelper_p.h.
-;
-; @param dst Destination register where to store the result
-; @param x Value to multiply
-; @param a Multiplicator byte
-; @param r14 Component half 0x800080
-;
-; @note Trashes x, r8
-;-----------------------------------------------------------------------------
- MACRO
- ByteMul $dst, $x, $a
-
- ; static inline uint BYTE_MUL(uint x, uint a)
-
- ; uint r8 = (x & 0xff00ff) * a + 0x800080
- uxtb16 r8, $x ; r8 = r8 & 0x00FF00FF
- mla r8, r8, $a, r14
-
- ; x = ((r >> 8) & 0xff00ff) * a + 0x800080
- uxtb16 $x, $x, ror #8
- mla $x, $x, $a, r14
-
-
- ; r8 = (r8 + ((r8 >> 8) & 0xff00ff) ) >> 8
- ; r8 &= 0xff00ff
- uxtab16 r8, r8, r8, ror #8
- uxtb16 r8, r8, ror #8
-
- ; x = x + ((x >>8) & 0xff00ff)
- uxtab16 $x, $x, $x, ror #8
-
- ; x &= 0xff00ff00
- ; x |= r8
- uxtb16 $x, $x, ror #8
- orr $dst, r8, $x, lsl #8
-
- MEND
-
-;-----------------------------------------------------------------------------
-; Armv6 boosted implementation of INTERPOLATE_PIXEL_255(...) function found in
-; qdrawhelper_p.h.
-;
-; @param dst Destination register where to store the result
-; @param x First value to multiply
-; @param a Multiplicator byte for first value
-; @param y Second value to multiply
-; @param b Multiplicator byte for second value
-; @param r14 Component half 0x800080
-;
-;
-; @note Trashes x, r8, r14
-;-----------------------------------------------------------------------------
- MACRO
- InterpolatePixel255 $dst, $x, $a, $y, $b
-
- ; static inline uint INTERPOLATE_PIXEL_255(uint x, uint a, uint y, uint b)
-
- ; First calculate the parts where we need 0x800080
-
- ; uint r8 = (((x & 0xff00ff) * a) + 0x800080)
- uxtb16 r8, $x ; r8 = r8 & 0x00FF00FF
- mla r8, r8, $a, r14
-
- ; x = ((((x >> 8) & 0xff00ff) * a) + 0x800080)
- uxtb16 $x, $x, ror #8
- mla $x, $x, $a, r14
-
- ; Now we are trashing r14 to free it for other purposes
-
- ; uint r14 = (y & 0xff00ff) * b
- uxtb16 r14, $y ; r14 = y & 0x00FF00FF
- mul r14, r14, $b
-
- ; r8 = r8 + r14
- add r8, r8, r14
-
- ; r8 = (r8 + ((r8 >> 8) & 0xff00ff) ) >> 8
- ; r8 &= 0xff00ff
- uxtab16 r8, r8, r8, ror #8
- uxtb16 r8, r8, ror #8
-
- ; r14 = ((y >> 8) & 0xff00ff) * b
- uxtb16 r14, $y, ror #8 ; r14 = ((y >> 8) & 0xFF00FF)
- mul r14, r14, $b
-
- ; x = x + r14
- add $x, $x, r14
-
- ; x = x + ((x >>8) & 0xff00ff)
- uxtab16 $x, $x, $x, ror #8
-
- ; x &= 0xff00ff00
- ; x |= r8
- uxtb16 $x, $x, ror #8
- orr $dst, r8, $x, lsl #8
-
- MEND
-
-;-----------------------------------------------------------------------------
-;
-;-----------------------------------------------------------------------------
- MACRO
-$label Blend4Pixels $BlendPixel
-
- ; Blend first 4 pixels
-
- ldmia r1!, {r4-r7}
- ldm r0, {r9-r12}
-
-b4p1_$label $BlendPixel r9, r4, r3
-b4p2_$label $BlendPixel r10, r5, r3
-b4p3_$label $BlendPixel r11, r6, r3
-b4p4_$label $BlendPixel r12, r7, r3
-
- stmia r0!, {r9-r12}
-
- MEND
-
-;-----------------------------------------------------------------------------
-;
-;-----------------------------------------------------------------------------
- MACRO
-$label Blend8Pixels $BlendPixel
-
-b8p1_$label Blend4Pixels $BlendPixel
-b8p2_$label Blend4Pixels $BlendPixel
-
- MEND
-
-;-----------------------------------------------------------------------------
-;
-;-----------------------------------------------------------------------------
- MACRO
-$label Blend16Pixels $BlendPixel
-
-b16p1_$label Blend8Pixels $BlendPixel
-b16p2_$label Blend8Pixels $BlendPixel
-
- MEND
-
-;-----------------------------------------------------------------------------
-;
-;-----------------------------------------------------------------------------
- MACRO
-$label Blend32Pixels $BlendPixel
-
-b32p1_$label Blend16Pixels $BlendPixel
-b32p2_$label Blend16Pixels $BlendPixel
-
- MEND
-
-;-----------------------------------------------------------------------------
-; A macro for source over compositing one row of pixels and saving the results
-; to destination buffer.
-;
-; @param dest Destination buffer (r0)
-; @param src Source buffer (r1)
-; @param length Length (r2)
-; @param const_alpha Constant alpha (r3)
-; @param r14 Component Half (0x800080) (r14)
-;
-; @note Advances r0, r1
-; @note Trashes r2, r4-r12
-;-----------------------------------------------------------------------------
- MACRO
-$label BlendRow $BlendPixel
-
- pld [r1]
-
-bloop_$label
- ; Blend 32 pixels per loop iteration
- subs r2, r2, #32
- bmi b_remaining_$label
-
-brp1_$label Blend32Pixels $BlendPixel
-
- b bloop_$label
-
-b_remaining_$label
-
- ; Remaining 31 pixels
-
- addmi r2, r2, #32
-
- ; Blend 16 pixels
- tst r2, #16
- beq b_remaining8_$label
-
-brp2_$label Blend16Pixels $BlendPixel
-
-b_remaining8_$label
-
- ; Blend 8 pixels
- tst r2, #8
- beq b_remaining4_$label
-
-brp3_$label Blend8Pixels $BlendPixel
-
-b_remaining4_$label
-
- ; Blend 4 pixels
- tst r2, #4
- beq b_remaining3_$label
-
-brp4_$label Blend4Pixels $BlendPixel
-
-b_remaining3_$label
-
- ; Remaining 3 pixels
-
- tst r2, #2
- beq b_last_$label
-
- ldmia r1!, {r4-r5}
- ldm r0, {r9-r10}
-
-brp5_$label $BlendPixel r9, r4, r3
-brp6_$label $BlendPixel r10, r5, r3
-
- stmia r0!, {r9-r10}
-
-b_last_$label
-
- tst r2, #1
- beq bexit_$label
-
- ldr r4, [r1]
- ldr r9, [r0]
-
-bpl_$label $BlendPixel r9, r4, r3
-
- str r9, [r0]
-
-bexit_$label
-
- MEND
-
-;-----------------------------------------------------------------------------
-; A macro for source over compositing one row of pixels and saving the results
-; to destination buffer. Restores all registers.
-;
-; @param dest Destination buffer (r0)
-; @param src Source buffer (r1)
-; @param length Length (r2)
-; @param const_alpha Constant alpha (r3)
-; @param r14 Component Half (0x800080) (r14)
-;
-; @note Advances r0, r1
-; @note Trashes r2, r4-r12
-;-----------------------------------------------------------------------------
- MACRO
-$label BlendRowSafe $BlendPixel
-
- stmfd sp!, {r0-r6} ; Preserves registers only up to r6
-
-brs_$label BlendRow $BlendPixel
-
- ldmfd sp!, {r0-r6}
-
- MEND
-
-
-;-----------------------------------------------------------------------------
-; Pix Copy.
-; NOTE! Cache line size of ARM1136JF-S and ARM1136J-S is 32 bytes (8 pixels).
-;
-; @param dst Destination pixels (r0)
-; @param src Source pixels (r1)
-; @param len Length (r2)
-;
-; @note Trashes r3-r10
-;-----------------------------------------------------------------------------
- MACRO
-$label PixCpy $dst, $src, $len
-
- pld [$src]
-
-pcpy_loop_$label
- ; Copy 8 pixels per loop iteration
- pld [$src, #96]
- subs $len, $len, #8
- ldmgeia $src!, {r3-r10}
- stmgeia $dst!, {r3-r10}
- bgt pcpy_loop_$label
-
-pcpy_remaining_$label
-
- ; Copy up to 7 remaining pixels
-
- ; Copy 4 pixels
- tst $len, #4
- ldmneia $src!, {r3-r6}
- stmneia $dst!, {r3-r6}
-
- tst $len, #2
- ldmneia $src!, {r3-r4}
- stmneia $dst!, {r3-r4}
-
- tst $len, #1
- ldrne r3, [$src]
- strne r3, [$dst]
-
- MEND
-
-;-----------------------------------------------------------------------------
-; General Pix Copy. Maximum 8 pixels at time. Restores all registers.
-;
-; @param dst Destination pixels (r0)
-; @param src Source pixels (r1)
-; @param len Length (r2)
-;
-; @note Trashes r3-r10
-;-----------------------------------------------------------------------------
- MACRO
-$label PixCpySafe $dst, $src, $len
-
- stmfd sp!, {r0-r6} ; Preserves registers only up to r6
-
-pcs_$label PixCpy $dst, $src, $len
-
- ldmfd sp!, {r0-r6} ; pop
-
- MEND
-
-
-;-----------------------------------------------------------------------------
-; A macro for source over compositing one pixel and saving the result to
-; dst register.
-;
-; @param dst Destination register, must contain destination pixel upon entry
-; @param src Source register, must contain source pixel upon entry
-; @param const_alpha Constant source alpha
-; @param r14 Component half 0x800080
-;
-; @note Trashes const_alpha, r8
-;-----------------------------------------------------------------------------
- MACRO
-$label PixelSourceOver $dst, $src, $const_alpha
-
- ; Negate src and extract alpha
- mvn $const_alpha, $src ; bitwise not
- uxtb $const_alpha, $const_alpha, ror #24 ; r3 = ((r3 & 0xFF000000) >> 24);
-
- ;cmp $const_alpha, #255 ; test for full transparency ( negated )
- ;beq exit_$label
- cmp $const_alpha, #0 ; test for full opacity ( negated )
- moveq $dst, $src
- beq exit_$label
-
- ByteMul $dst, $dst, $const_alpha
- add $dst, $src, $dst
-
-exit_$label
- MEND
-
-;-----------------------------------------------------------------------------
-; A macro for source over compositing one pixel and saving the result to
-; dst register.
-;
-; @param dst Destination register, must contain destination pixel upon entry
-; @param src Source register, must contain source pixel upon entry
-; @param const_alpha Constant source alpha
-; @param r14 Component half 0x800080
-;
-; @note Trashes src, const_alpha, r8
-;-----------------------------------------------------------------------------
- MACRO
-$label PixelSourceOverConstAlpha $dst, $src, $const_alpha
-
- ; store alpha because we are going to trash it
- stmfd sp!, {$const_alpha}
-
- ByteMul $src, $src, $const_alpha
-
- ; Negate src and extract alpha
- mvn $const_alpha, $src ; bitwise not
- uxtb $const_alpha, $const_alpha, ror #24 ; r3 = ((r3 & 0xFF000000) >> 24);
-
- ByteMul $dst, $dst, $const_alpha
-
- add $dst, $src, $dst
-
- ; recover alpha
- ldmfd sp!, {$const_alpha}
-
- MEND
-
-;-----------------------------------------------------------------------------
-; A macro for source over compositing one pixel and saving the result to
-; a register.
-;
-; @param dst Destination register, must contain destination pixel upon entry
-; @param src Source register, must contain source pixel upon entry
-; @param const_alpha Constant source alpha
-; @param r14 Component half 0x800080
-;
-; @note Trashes src, r8
-;-----------------------------------------------------------------------------
- MACRO
-$label PixelSourceConstAlpha $dst, $src, $const_alpha
-
- ; store r2 and r14 because we are going to trash them
- stmfd sp!, {r2, r14}
-
- rsb r2, $const_alpha, #255
- InterpolatePixel255 $dst, $src, $const_alpha, $dst, r2
-
- ; recover r2 and r14
- ldmfd sp!, {r2, r14}
-
- MEND
-
- END ; File end
diff --git a/src/gui/painting/qdrawhelper_armv6_rvct.s b/src/gui/painting/qdrawhelper_armv6_rvct.s
deleted file mode 100644
index 180980a..0000000
--- a/src/gui/painting/qdrawhelper_armv6_rvct.s
+++ /dev/null
@@ -1,177 +0,0 @@
-;****************************************************************************
-;**
-;** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-;** All rights reserved.
-;** Contact: Nokia Corporation (qt-info@nokia.com)
-;**
-;** This file is part of the QtGui module of the Qt Toolkit.
-;**
-;** $QT_BEGIN_LICENSE:LGPL$
-;** No Commercial Usage
-;** This file contains pre-release code and may not be distributed.
-;** You may use this file in accordance with the terms and conditions
-;** contained in the Technology Preview License Agreement accompanying
-;** this package.
-;**
-;** GNU Lesser General Public License Usage
-;** Alternatively, this file may be used under the terms of the GNU Lesser
-;** General Public License version 2.1 as published by the Free Software
-;** Foundation and appearing in the file LICENSE.LGPL included in the
-;** packaging of this file. Please review the following information to
-;** ensure the GNU Lesser General Public License version 2.1 requirements
-;** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-;**
-;** In addition, as a special exception, Nokia gives you certain additional
-;** rights. These rights are described in the Nokia Qt LGPL Exception
-;** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-;**
-;** If you have questions regarding the use of this file, please contact
-;** Nokia at qt-info@nokia.com.
-;**
-;**
-;**
-;**
-;**
-;**
-;**
-;**
-;** $QT_END_LICENSE$
-;**
-;****************************************************************************
-
-;
-; W A R N I N G
-; -------------
-;
-; This file is not part of the Qt API. It exists purely as an
-; implementation detail. This header file may change from version to
-; version without notice, or even be removed.
-;
-; We mean it.
-;
-
- ARM
- PRESERVE8
-
- INCLUDE qdrawhelper_armv6_rvct.inc
-
-;-----------------------------------------------------------------------------
-; qt_memfill32_armv6
-;
-; @brief Not yet in use!
-;
-; @param dest Destination buffer (r0)
-; @param value Value (r1)
-; @param count Count (r2)
-;
-;---------------------------------------------------------------------------
-qt_memfill32_armv6 Function
- stmfd sp!, {r4-r12, r14}
-
- mov r3, r1
- mov r4, r1
- mov r5, r1
- mov r6, r1
- mov r7, r1
- mov r8, r1
- mov r9, r1
-
-mfill_loop
- ; Fill 32 pixels per loop iteration
- subs r2, r2, #32
- stmgeia r0!, {r1, r3, r4, r5, r6, r7, r8, r9}
- stmgeia r0!, {r1, r3, r4, r5, r6, r7, r8, r9}
- stmgeia r0!, {r1, r3, r4, r5, r6, r7, r8, r9}
- stmgeia r0!, {r1, r3, r4, r5, r6, r7, r8, r9}
- bgt mfill_loop
-
-mfill_remaining
-
- ; Fill up to 31 remaining pixels
-
- ; Fill 16 pixels
- tst r2, #16
- stmneia r0!, {r1, r3, r4, r5, r6, r7, r8, r9}
- stmneia r0!, {r1, r3, r4, r5, r6, r7, r8, r9}
-
- ; Fill 8 pixels
- tst r2, #8
- stmneia r0!, {r1, r3, r4, r5, r6, r7, r8, r9}
-
- ; Fill 4 pixels
- tst r2, #4
- stmneia r0!, {r1, r3, r4, r5}
-
- ; Fill 2 pixels
- tst r2, #2
- stmneia r0!, {r1, r3}
-
- ; Fill last one
- tst r2, #1
- strne r1, [r0]
-
- ldmfd sp!, {r4-r12, pc} ; pop and return
-
-;-----------------------------------------------------------------------------
-; comp_func_Source_arm
-;
-; @brief
-;
-; @param dest Destination buffer (r0)
-; @param src Source buffer (r1)
-; @param length Length (r2)
-; @param const_alpha Constant alpha (r3)
-;
-;---------------------------------------------------------------------------
-comp_func_Source_armv6 Function
- stmfd sp!, {r4-r12, r14}
-
- cmp r3, #255 ; if(r3 == 255)
- bne src2 ; branch if not
-
-src1 PixCpy r0, r1, r2
-
- ldmfd sp!, {r4-r12, pc} ; pop and return
-
-src2
- ;ldr r14, =ComponentHalf ; load 0x800080 to r14
- mov r14, #0x800000
- add r14, r14, #0x80
-
-src22 BlendRow PixelSourceConstAlpha
-
- ldmfd sp!, {r4-r12, pc} ; pop and return
-
-;-----------------------------------------------------------------------------
-; comp_func_SourceOver_arm
-;
-; @brief
-;
-; @param dest Destination buffer (r0)
-; @param src Source buffer (r1)
-; @param length Length (r2)
-; @param const_alpha Constant alpha (r3)
-;
-;---------------------------------------------------------------------------
-comp_func_SourceOver_armv6 Function
- stmfd sp!, {r4-r12, r14}
-
- ;ldr r14, =ComponentHalf ; load 0x800080 to r14
- mov r14, #0x800000
- add r14, r14, #0x80
-
- cmp r3, #255 ; if(r3 == 255)
- bne srcovr2 ; branch if not
-
-srcovr1 BlendRow PixelSourceOver
-
- ldmfd sp!, {r4-r12, pc} ; pop and return
-
-srcovr2
-
-srcovr22 BlendRow PixelSourceOverConstAlpha
-
- ldmfd sp!, {r4-r12, pc} ; pop and return
-
-
- END ; File end
diff --git a/src/gui/painting/qgraphicssystem_qws.cpp b/src/gui/painting/qgraphicssystem_qws.cpp
index f5dab4b..03a0d11 100644
--- a/src/gui/painting/qgraphicssystem_qws.cpp
+++ b/src/gui/painting/qgraphicssystem_qws.cpp
@@ -49,7 +49,7 @@ QT_BEGIN_NAMESPACE
QPixmapData *QWSGraphicsSystem::createPixmapData(QPixmapData::PixelType type) const
{
if (screen->pixmapDataFactory())
- return screen->pixmapDataFactory()->create(type); //### For 4.4 compatability
+ return screen->pixmapDataFactory()->create(type); //### For 4.4 compatibility
else
return new QRasterPixmapData(type);
}
diff --git a/src/gui/painting/qimagescale.cpp b/src/gui/painting/qimagescale.cpp
index 8580775..7383308 100644
--- a/src/gui/painting/qimagescale.cpp
+++ b/src/gui/painting/qimagescale.cpp
@@ -304,7 +304,7 @@ QImageScaleInfo* QImageScale::qimageCalcScaleInfo(const QImage &img,
return(isi);
}
-/* FIXME: NEED to optimise ScaleAARGBA - currently its "ok" but needs work*/
+/* FIXME: NEED to optimize ScaleAARGBA - currently its "ok" but needs work*/
/* scale by area sampling */
static void qt_qimageScaleAARGBA(QImageScaleInfo *isi, unsigned int *dest,
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index c92d291..89202ac 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -40,6 +40,7 @@
****************************************************************************/
#include <QtCore/qglobal.h>
+#include <QtCore/qmutex.h>
#define QT_FT_BEGIN_HEADER
#define QT_FT_END_HEADER
@@ -874,9 +875,10 @@ void QRasterPaintEngine::updateState()
if (s->dirty & DirtyTransform)
updateMatrix(s->matrix);
- if (s->dirty & (DirtyPen|DirtyCompositionMode)) {
+ if (s->dirty & (DirtyPen|DirtyCompositionMode|DirtyOpacity)) {
const QPainter::CompositionMode mode = s->composition_mode;
s->flags.fast_text = (s->penData.type == QSpanData::Solid)
+ && s->intOpacity == 256
&& (mode == QPainter::CompositionMode_Source
|| (mode == QPainter::CompositionMode_SourceOver
&& qAlpha(s->penData.solid.color) == 255));
@@ -900,6 +902,7 @@ void QRasterPaintEngine::opacityChanged()
s->fillFlags |= DirtyOpacity;
s->strokeFlags |= DirtyOpacity;
s->pixmapFlags |= DirtyOpacity;
+ s->dirty |= DirtyOpacity;
s->intOpacity = (int) (s->opacity * 256);
}
@@ -1102,7 +1105,7 @@ void QRasterPaintEnginePrivate::updateMatrixData(QSpanData *spanData, const QBru
Q_Q(QRasterPaintEngine);
bool bilinear = q->state()->flags.bilinear;
- if (b.d->transform.type() > QTransform::TxNone) { // FALCON: optimise
+ if (b.d->transform.type() > QTransform::TxNone) { // FALCON: optimize
spanData->setupMatrix(b.transform() * m, bilinear);
} else {
if (m.type() <= QTransform::TxTranslate) {
@@ -3300,7 +3303,7 @@ void QRasterPaintEngine::drawStaticTextItem(QStaticTextItem *textItem)
ensureState();
drawCachedGlyphs(textItem->numGlyphs, textItem->glyphs, textItem->glyphPositions,
- textItem->fontEngine);
+ textItem->fontEngine());
}
/*!
@@ -4946,6 +4949,7 @@ public:
for (int i = 0; i < stops.size() && i <= 2; i++)
hash_val += stops[i].second.rgba();
+ QMutexLocker lock(&mutex);
QGradientColorTableHash::const_iterator it = cache.constFind(hash_val);
if (it == cache.constEnd())
@@ -4979,6 +4983,7 @@ protected:
}
QGradientColorTableHash cache;
+ QMutex mutex;
};
void QGradientCache::generateGradientColorTable(const QGradient& gradient, uint *colorTable, int size, int opacity) const
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index 9afb62f..3601c8e 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -5746,7 +5746,7 @@ void QPainterPrivate::drawGlyphs(const quint32 *glyphArray, const QPointF *posit
QStaticTextItem staticTextItem;
staticTextItem.color = state->pen.color();
staticTextItem.font = state->font;
- staticTextItem.fontEngine = fontEngine;
+ staticTextItem.setFontEngine(fontEngine);
staticTextItem.numGlyphs = glyphCount;
staticTextItem.glyphs = reinterpret_cast<glyph_t *>(const_cast<glyph_t *>(glyphArray));
staticTextItem.glyphPositions = positions.data();
@@ -5938,7 +5938,7 @@ void QPainter::drawStaticText(const QPointF &topLeftPosition, const QStaticText
d->extended->drawStaticTextItem(item);
drawDecorationForGlyphs(this, item->glyphs, item->glyphPositions,
- item->numGlyphs, item->fontEngine, staticText_d->font,
+ item->numGlyphs, item->fontEngine(), staticText_d->font,
QTextCharFormat());
}
if (currentColor != oldPen.color())
diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp
index ba5d164..bd68d2a 100644
--- a/src/gui/painting/qpdf.cpp
+++ b/src/gui/painting/qpdf.cpp
@@ -1390,7 +1390,7 @@ int QPdfBaseEngine::metric(QPaintDevice::PaintDeviceMetric metricType) const
void QPdfBaseEngine::setProperty(PrintEnginePropertyKey key, const QVariant &value)
{
Q_D(QPdfBaseEngine);
- switch (key) {
+ switch (int(key)) {
case PPK_CollateCopies:
d->collate = value.toBool();
break;
@@ -1480,7 +1480,7 @@ QVariant QPdfBaseEngine::property(PrintEnginePropertyKey key) const
Q_D(const QPdfBaseEngine);
QVariant ret;
- switch (key) {
+ switch (int(key)) {
case PPK_CollateCopies:
ret = d->collate;
break;
diff --git a/src/gui/painting/qregion.h b/src/gui/painting/qregion.h
index bc4da28..acb20c1 100644
--- a/src/gui/painting/qregion.h
+++ b/src/gui/painting/qregion.h
@@ -201,7 +201,7 @@ private:
Region rgn;
void *xrectangles;
#elif defined(Q_WS_MAC) && !defined(QT_MAC_USE_COCOA)
- mutable RgnHandle unused; // Here for binary compatability reasons. ### Qt 5 remove.
+ mutable RgnHandle unused; // Here for binary compatibility reasons. ### Qt 5 remove.
#endif
#if defined(Q_WS_QWS) || defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_WS_WIN) || defined(Q_OS_SYMBIAN)
QRegionPrivate *qt_rgn;
diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp
index b609f7b..eab9cf6 100644
--- a/src/gui/painting/qtextureglyphcache.cpp
+++ b/src/gui/painting/qtextureglyphcache.cpp
@@ -65,7 +65,7 @@ static inline int qt_next_power_of_two(int v)
return v;
}
-void QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const glyph_t *glyphs,
+bool QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const glyph_t *glyphs,
const QFixedPoint *)
{
#ifdef CACHE_DEBUG
@@ -119,7 +119,7 @@ void QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const
rowHeight = qMax(rowHeight, glyph_height);
}
if (listItemCoordinates.isEmpty())
- return;
+ return true;
rowHeight += margin * 2 + paddingDoubled;
if (isNull())
@@ -143,13 +143,20 @@ void QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const
// no room on the current line, start new glyph strip
m_cx = 0;
m_cy += m_currentRowHeight + paddingDoubled;
- m_currentRowHeight = 0; // New row
+ m_currentRowHeight = c.h + margin * 2; // New row
}
}
if (m_cy + c.h > m_h) {
int new_height = m_h*2;
while (new_height < m_cy + c.h)
new_height *= 2;
+
+ if (maxTextureHeight() > 0 && new_height > maxTextureHeight()) {
+ // We can't make a new texture of the required size, so
+ // bail out
+ return false;
+ }
+
// if no room in the current texture - realloc a larger texture
resizeTextureData(m_w, new_height);
m_h = new_height;
@@ -165,7 +172,7 @@ void QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const
++iter;
}
-
+ return true;
}
QImage QTextureGlyphCache::textureMapForGlyph(glyph_t g) const
@@ -259,11 +266,14 @@ void QImageTextureGlyphCache::fillTexture(const Coord &c, glyph_t g)
}
#endif
- if (m_type == QFontEngineGlyphCache::Raster_RGBMask) {
- QPainter p(&m_image);
+ if (m_type == QFontEngineGlyphCache::Raster_RGBMask) {
+ QImage ref(m_image.bits() + (c.x * 4 + c.y * m_image.bytesPerLine()),
+ qMax(mask.width(), c.w), qMax(mask.height(), c.h), m_image.bytesPerLine(),
+ m_image.format());
+ QPainter p(&ref);
p.setCompositionMode(QPainter::CompositionMode_Source);
- p.fillRect(c.x, c.y, c.w, c.h, QColor(0,0,0,0)); // TODO optimize this
- p.drawImage(c.x, c.y, mask);
+ p.fillRect(0, 0, c.w, c.h, QColor(0,0,0,0)); // TODO optimize this
+ p.drawImage(0, 0, mask);
p.end();
} else if (m_type == QFontEngineGlyphCache::Raster_Mono) {
if (mask.depth() > 1) {
diff --git a/src/gui/painting/qtextureglyphcache_p.h b/src/gui/painting/qtextureglyphcache_p.h
index e6d2b22..94cb555 100644
--- a/src/gui/painting/qtextureglyphcache_p.h
+++ b/src/gui/painting/qtextureglyphcache_p.h
@@ -96,7 +96,7 @@ public:
int baseLineY;
};
- void populate(QFontEngine *fontEngine, int numGlyphs, const glyph_t *glyphs,
+ bool populate(QFontEngine *fontEngine, int numGlyphs, const glyph_t *glyphs,
const QFixedPoint *positions);
virtual void createTextureData(int width, int height) = 0;
@@ -118,7 +118,7 @@ public:
QImage textureMapForGlyph(glyph_t g) const;
virtual int maxTextureWidth() const { return QT_DEFAULT_TEXTURE_GLYPH_CACHE_WIDTH; }
- virtual int maxTextureHeight() const { return 32768; }
+ virtual int maxTextureHeight() const { return -1; }
protected:
QFontEngine *m_current_fontengine;