summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/xinevideowidget.cpp
Unidiff
Diffstat (limited to 'noncore/multimedia/opieplayer2/xinevideowidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/xinevideowidget.cpp88
1 files changed, 44 insertions, 44 deletions
diff --git a/noncore/multimedia/opieplayer2/xinevideowidget.cpp b/noncore/multimedia/opieplayer2/xinevideowidget.cpp
index bc95d86..d06d62a 100644
--- a/noncore/multimedia/opieplayer2/xinevideowidget.cpp
+++ b/noncore/multimedia/opieplayer2/xinevideowidget.cpp
@@ -129,74 +129,74 @@ void XineVideoWidget::paintEvent ( QPaintEvent * )
129 qt_bug_workaround_clip_rects. resize ( dp. numRects ( )); 129 qt_bug_workaround_clip_rects. resize ( dp. numRects ( ));
130 130
131 for ( int i = dp. numRects ( ) - 1; i >= 0; i-- ) { 131 for ( int i = dp. numRects ( ) - 1; i >= 0; i-- ) {
132 const QRect &clip = dp. rect ( i ); 132 const QRect &clip = dp. rect ( i );
133 133
134 qt_bug_workaround_clip_rects [i] = qt_screen-> mapFromDevice ( clip, QSize ( qt_screen-> width ( ), qt_screen-> height ( ))); 134 qt_bug_workaround_clip_rects [i] = qt_screen-> mapFromDevice ( clip, QSize ( qt_screen-> width ( ), qt_screen-> height ( )));
135 135
136 uchar *dst = fb + ( clip. x ( ) * m_bytes_per_pixel ) + ( clip. y ( ) * m_bytes_per_line_fb ); 136 uchar *dst = fb + ( clip. x ( ) * m_bytes_per_pixel ) + ( clip. y ( ) * m_bytes_per_line_fb );
137 uchar *src = frame; 137 uchar *src = frame;
138 138
139 switch ( rot ) { 139 switch ( rot ) {
140 case 0: src += ( (( clip. x ( ) - framerect. x ( )) * m_bytes_per_pixel ) + (( clip. y ( ) - framerect. y ( )) * m_bytes_per_line_frame ) ); break; 140 case 0: src += ( (( clip. x ( ) - framerect. x ( )) * m_bytes_per_pixel ) + (( clip. y ( ) - framerect. y ( )) * m_bytes_per_line_frame ) ); break;
141 case 1: src += ( (( clip. y ( ) - framerect. y ( )) * m_bytes_per_pixel ) + (( clip. x ( ) - framerect. x ( )) * m_bytes_per_line_frame ) + (( framerect. height ( ) - 1 ) * m_bytes_per_pixel ) ); break; 141 case 1: src += ( (( clip. y ( ) - framerect. y ( )) * m_bytes_per_pixel ) + (( clip. x ( ) - framerect. x ( )) * m_bytes_per_line_frame ) + (( framerect. height ( ) - 1 ) * m_bytes_per_pixel ) ); break;
142 case 2: src += ( (( clip. x ( ) - framerect. x ( )) * m_bytes_per_pixel ) + (( clip. y ( ) - framerect. y ( )) * m_bytes_per_line_frame ) + (( framerect. height ( ) - 1 ) * m_bytes_per_line_frame ) ); break; 142 case 2: src += ( (( clip. x ( ) - framerect. x ( )) * m_bytes_per_pixel ) + (( clip. y ( ) - framerect. y ( )) * m_bytes_per_line_frame ) + (( framerect. height ( ) - 1 ) * m_bytes_per_line_frame ) ); break;
143 case 3: src += ( (( clip. y ( ) - framerect. y ( )) * m_bytes_per_pixel ) + (( clip. x ( ) - framerect. x ( )) * m_bytes_per_line_frame ) ); break; 143 case 3: src += ( (( clip. y ( ) - framerect. y ( )) * m_bytes_per_pixel ) + (( clip. x ( ) - framerect. x ( )) * m_bytes_per_line_frame ) ); break;
144 default: break; 144 default: break;
145 } 145 }
146 146
147 uint leftfill = 0; 147 uint leftfill = 0;
148 uint framefill = 0; 148 uint framefill = 0;
149 uint rightfill = 0; 149 uint rightfill = 0;
150 uint clipwidth = clip. width ( ) * m_bytes_per_pixel; 150 uint clipwidth = clip. width ( ) * m_bytes_per_pixel;
151 151
152 if ( clip. left ( ) < framerect. left ( )) 152 if ( clip. left ( ) < framerect. left ( ))
153 leftfill = (( framerect. left ( ) - clip. left ( )) * m_bytes_per_pixel ) <? clipwidth; 153 leftfill = (( framerect. left ( ) - clip. left ( )) * m_bytes_per_pixel ) <? clipwidth;
154 if ( clip. right ( ) > framerect. right ( )) 154 if ( clip. right ( ) > framerect. right ( ))
155 rightfill = (( clip. right ( ) - framerect. right ( )) * m_bytes_per_pixel ) <? clipwidth; 155 rightfill = (( clip. right ( ) - framerect. right ( )) * m_bytes_per_pixel ) <? clipwidth;
156 156
157 framefill = clipwidth - ( leftfill + rightfill ); 157 framefill = clipwidth - ( leftfill + rightfill );
158 158
159 for ( int y = clip. top ( ); y <= clip. bottom ( ); y++ ) { 159 for ( int y = clip. top ( ); y <= clip. bottom ( ); y++ ) {
160 if (( y < framerect. top ( )) || ( y > framerect. bottom ( ))) { 160 if (( y < framerect. top ( )) || ( y > framerect. bottom ( ))) {
161 memset ( dst, 0, clipwidth ); 161 memset ( dst, 0, clipwidth );
162 } 162 }
163 else { 163 else {
164 if ( leftfill ) 164 if ( leftfill )
165 memset ( dst, 0, leftfill ); 165 memset ( dst, 0, leftfill );
166 166
167 if ( framefill ) { 167 if ( framefill ) {
168 switch ( rot ) { 168 switch ( rot ) {
169 case 0: memcpy ( dst + leftfill, src, framefill ); break; 169 case 0: memcpy ( dst + leftfill, src, framefill ); break;
170 case 1: memcpy_step ( dst + leftfill, src, framefill, m_bytes_per_line_frame ); break; 170 case 1: memcpy_step ( dst + leftfill, src, framefill, m_bytes_per_line_frame ); break;
171 case 2: memcpy_rev ( dst + leftfill, src, framefill ); break; 171 case 2: memcpy_rev ( dst + leftfill, src, framefill ); break;
172 case 3: memcpy_step_rev ( dst + leftfill, src, framefill, m_bytes_per_line_frame ); break; 172 case 3: memcpy_step_rev ( dst + leftfill, src, framefill, m_bytes_per_line_frame ); break;
173 default: break; 173 default: break;
174 }
174 } 175 }
175 }
176 if ( rightfill ) 176 if ( rightfill )
177 memset ( dst + leftfill + framefill, 0, rightfill ); 177 memset ( dst + leftfill + framefill, 0, rightfill );
178 } 178 }
179 179
180 dst += m_bytes_per_line_fb; 180 dst += m_bytes_per_line_fb;
181 181
182 switch ( rot ) { 182 switch ( rot ) {
183 case 0: src += m_bytes_per_line_frame; break; 183 case 0: src += m_bytes_per_line_frame; break;
184 case 1: src -= m_bytes_per_pixel; break; 184 case 1: src -= m_bytes_per_pixel; break;
185 case 2: src -= m_bytes_per_line_frame; break; 185 case 2: src -= m_bytes_per_line_frame; break;
186 case 3: src += m_bytes_per_pixel; break; 186 case 3: src += m_bytes_per_pixel; break;
187 default: break; 187 default: break;
188 }
188 } 189 }
189 }
190 } 190 }
191 } 191 }
192 //qWarning ( " ||| painting |||" ); 192 //qWarning ( " ||| painting |||" );
193 { 193 {
194 // QVFB hack by MArtin Jones 194 // QVFB hack by MArtin Jones
195 QPainter p ( this ); 195 QPainter p ( this );
196 196
197 for ( int i = qt_bug_workaround_clip_rects. size ( ) - 1; i >= 0; i-- ) { 197 for ( int i = qt_bug_workaround_clip_rects. size ( ) - 1; i >= 0; i-- ) {
198 p. fillRect ( QRect ( mapFromGlobal ( qt_bug_workaround_clip_rects [i]. topLeft ( )), qt_bug_workaround_clip_rects [i]. size ( )), QBrush ( NoBrush ) ); 198 p. fillRect ( QRect ( mapFromGlobal ( qt_bug_workaround_clip_rects [i]. topLeft ( )), qt_bug_workaround_clip_rects [i]. size ( )), QBrush ( NoBrush ) );
199 } 199 }
200 } 200 }
201 } 201 }
202 //qWarning( "painting >>>" ); 202 //qWarning( "painting >>>" );