source: trunk/src/gui/painting/qblendfunctions_armv6_rvct.s@ 574

Last change on this file since 574 was 561, checked in by Dmitry A. Kuminov, 16 years ago

trunk: Merged in qt 4.6.1 sources.

  • Property svn:eol-style set to native
File size: 6.0 KB
Line 
1;****************************************************************************
2;**
3;** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
4;** All rights reserved.
5;** Contact: Nokia Corporation (qt-info@nokia.com)
6;**
7;** This file is part of the QtGui module of the Qt Toolkit.
8;**
9;** $QT_BEGIN_LICENSE:LGPL$
10;** Commercial Usage
11;** Licensees holding valid Qt Commercial licenses may use this file in
12;** accordance with the Qt Commercial License Agreement provided with the
13;** Software or, alternatively, in accordance with the terms contained in
14;** a written agreement between you and Nokia.
15;**
16;** GNU Lesser General Public License Usage
17;** Alternatively, this file may be used under the terms of the GNU Lesser
18;** General Public License version 2.1 as published by the Free Software
19;** Foundation and appearing in the file LICENSE.LGPL included in the
20;** packaging of this file. Please review the following information to
21;** ensure the GNU Lesser General Public License version 2.1 requirements
22;** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
23;**
24;** In addition, as a special exception, Nokia gives you certain additional
25;** rights. These rights are described in the Nokia Qt LGPL Exception
26;** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
27;**
28;** GNU General Public License Usage
29;** Alternatively, this file may be used under the terms of the GNU
30;** General Public License version 3.0 as published by the Free Software
31;** Foundation and appearing in the file LICENSE.GPL included in the
32;** packaging of this file. Please review the following information to
33;** ensure the GNU General Public License version 3.0 requirements will be
34;** met: http://www.gnu.org/copyleft/gpl.html.
35;**
36;** If you have questions regarding the use of this file, please contact
37;** Nokia at qt-info@nokia.com.
38;** $QT_END_LICENSE$
39;**
40;****************************************************************************
41
42;
43; W A R N I N G
44; -------------
45;
46; This file is not part of the Qt API. It exists purely as an
47; implementation detail. This header file may change from version to
48; version without notice, or even be removed.
49;
50; We mean it.
51;
52
53
54 ARM
55 PRESERVE8
56
57 INCLUDE qdrawhelper_armv6_rvct.inc
58
59
60;-----------------------------------------------------------------------------
61; qt_blend_rgb32_on_rgb32_arm
62;
63; @brief
64;
65; @param dest Destination pixels (r0)
66; @param dbpl Destination bytes per line (r1)
67; @param src Source pixels (r2)
68; @param sbpl Source bytes per line (r3)
69; @param w Width (s0 -> r4)
70; @param h Height (s1 -> r5)
71; @param const_alpha Constant alpha (s2 -> r6)
72;
73;---------------------------------------------------------------------------
74qt_blend_rgb32_on_rgb32_armv6 Function
75 stmfd sp!, {r4-r12, r14}
76
77 ; read arguments off the stack
78 add r8, sp, #10 * 4
79 ldmia r8, {r9-r11}
80
81 ; Reorganize registers
82
83 mov r4, r10
84 mov r5, r1
85 mov r6, r3
86
87 mov r1, r2
88 mov r2, r9
89 mov r3, r11
90
91 ; Now we have registers
92 ; @param dest Destination pixels (r0)
93 ; @param src Source pixels (r1)
94 ; @param w Width (r2)
95 ; @param const_alpha Constant alpha (r3)
96 ; @param h Height (r4)
97 ; @param dbpl Destination bytes per line (r5)
98 ; @param sbpl Source bytes per line (r6)
99
100 cmp r3, #256 ; test if we have fully opaque constant alpha value
101 bne rgb32_blend_const_alpha ; branch if not
102
103rgb32_blend_loop
104
105 subs r4, r4, #1
106 bmi rgb32_blend_exit ; while(h--)
107
108rgb321 PixCpySafe r0, r1, r2
109
110 add r0, r0, r5 ; dest = dest + dbpl
111 add r1, r1, r6 ; src = src + sbpl
112
113 b rgb32_blend_loop
114
115
116rgb32_blend_const_alpha
117
118 ;ldr r14, =ComponentHalf ; load 0x800080 to r14
119 mov r14, #0x800000
120 add r14, r14, #0x80
121
122 sub r3, r3, #1 ; const_alpha -= 1;
123
124rgb32_blend_loop_const_alpha
125
126 subs r4, r4, #1
127 bmi rgb32_blend_exit ; while(h--)
128
129rgb322 BlendRowSafe PixelSourceOverConstAlpha
130
131 add r0, r0, r5 ; dest = dest + dbpl
132 add r1, r1, r6 ; src = src + sbpl
133
134 b rgb32_blend_loop_const_alpha
135
136rgb32_blend_exit
137
138 ldmfd sp!, {r4-r12, pc} ; pop and return
139
140
141
142;-----------------------------------------------------------------------------
143; qt_blend_argb32_on_argb32_arm
144;
145; @brief
146;
147; @param dest Destination pixels (r0)
148; @param dbpl Destination bytes per line (r1)
149; @param src Source pixels (r2)
150; @param sbpl Source bytes per line (r3)
151; @param w Width (s0 -> r4)
152; @param h Height (s1 -> r5)
153; @param const_alpha Constant alpha (s2 -> r6)
154;
155;---------------------------------------------------------------------------
156qt_blend_argb32_on_argb32_armv6 Function
157 stmfd sp!, {r4-r12, r14}
158
159 ; read arguments off the stack
160 add r8, sp, #10 * 4
161 ldmia r8, {r9-r11}
162
163 ; Reorganize registers
164
165 mov r4, r10
166 mov r5, r1
167 mov r6, r3
168
169 mov r1, r2
170 mov r2, r9
171 mov r3, r11
172
173 ; Now we have registers
174 ; @param dest Destination pixels (r0)
175 ; @param src Source pixels (r1)
176 ; @param w Width (r2)
177 ; @param const_alpha Constant alpha (r3)
178 ; @param h Height (r4)
179 ; @param dbpl Destination bytes per line (r5)
180 ; @param sbpl Source bytes per line (r6)
181
182 ;ldr r14, =ComponentHalf ; load 0x800080 to r14
183 mov r14, #0x800000
184 add r14, r14, #0x80
185
186 cmp r3, #256 ; test if we have fully opaque constant alpha value
187 bne argb32_blend_const_alpha ; branch if not
188
189argb32_blend_loop
190
191 subs r4, r4, #1
192 bmi argb32_blend_exit ; while(h--)
193
194argb321 BlendRowSafe PixelSourceOver
195
196 add r0, r0, r5 ; dest = dest + dbpl
197 add r1, r1, r6 ; src = src + sbpl
198
199 b argb32_blend_loop
200
201argb32_blend_const_alpha
202
203 sub r3, r3, #1 ; const_alpha -= 1;
204
205argb32_blend_loop_const_alpha
206
207 subs r4, r4, #1
208 bmi argb32_blend_exit ; while(h--)
209
210argb322 BlendRowSafe PixelSourceOverConstAlpha
211
212 add r0, r0, r5 ; dest = dest + dbpl
213 add r1, r1, r6 ; src = src + sbpl
214
215 b argb32_blend_loop_const_alpha
216
217argb32_blend_exit
218
219 ldmfd sp!, {r4-r12, pc} ; pop and return
220
221
222 END ; File end
Note: See TracBrowser for help on using the repository browser.