author | simon <simon> | 2002-03-11 16:17:56 (UTC) |
---|---|---|
committer | simon <simon> | 2002-03-11 16:17:56 (UTC) |
commit | 3e3a8c86d441ba5e3fd6235747e9a0465085647f (patch) (unidiff) | |
tree | 5d36545a55d5d2d4c1988a4e93962a3325c9e873 /qt | |
parent | 523dbf7c0c6fb585f6067ff3adf032d8ff77815d (diff) | |
download | opie-3e3a8c86d441ba5e3fd6235747e9a0465085647f.zip opie-3e3a8c86d441ba5e3fd6235747e9a0465085647f.tar.gz opie-3e3a8c86d441ba5e3fd6235747e9a0465085647f.tar.bz2 |
- sync with qtopia cvs: adds patch which fixes qpixmaps loosing their
masks when scaling using certain scaling factors
-rw-r--r-- | qt/qte232-for-qpe150.patch | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/qt/qte232-for-qpe150.patch b/qt/qte232-for-qpe150.patch index 3acb3d1..c01f1f3 100644 --- a/qt/qte232-for-qpe150.patch +++ b/qt/qte232-for-qpe150.patch | |||
@@ -17,48 +17,90 @@ | |||
17 | +} | 17 | +} |
18 | +return sample; | 18 | +return sample; |
19 | + } | 19 | + } |
20 | void getSample(int& l, int& r) | 20 | void getSample(int& l, int& r) |
21 | { | 21 | { |
22 | l = r = 0; | 22 | l = r = 0; |
23 | @@ -152,38 +165,22 @@ private: | 23 | @@ -152,38 +165,22 @@ private: |
24 | if ( out >= max ) { | 24 | if ( out >= max ) { |
25 | max = dev->readBlock((char*)data, | 25 | max = dev->readBlock((char*)data, |
26 | (uint)QMIN(sound_buffer_size,wavedata_remaining)); | 26 | (uint)QMIN(sound_buffer_size,wavedata_remaining)); |
27 | - wavedata_remaining -= max; | 27 | - wavedata_remaining -= max; |
28 | out = 0; | 28 | out = 0; |
29 | if ( max <= 0 ) { | 29 | if ( max <= 0 ) { |
30 | max = 0; | 30 | max = 0; |
31 | return; | 31 | return; |
32 | } | 32 | } |
33 | } | 33 | } |
34 | - if ( chunkdata.wBitsPerSample == 8 ) { | 34 | - if ( chunkdata.wBitsPerSample == 8 ) { |
35 | - l = (data[out++] - 128) * 128; | 35 | - l = (data[out++] - 128) * 128; |
36 | - } else { | 36 | - } else { |
37 | - l = ((short*)data)[out/2]; | 37 | - l = ((short*)data)[out/2]; |
38 | - out += 2; | 38 | - out += 2; |
39 | - } | 39 | - } |
40 | + l = getOneSample(); | 40 | + l = getOneSample(); |
41 | if ( sound_stereo ) { | 41 | if ( sound_stereo ) { |
42 | if ( chunkdata.channels == 1 ) { | 42 | if ( chunkdata.channels == 1 ) { |
43 | r = l; | 43 | r = l; |
44 | } else { | 44 | } else { |
45 | - if ( chunkdata.wBitsPerSample == 8 ) { | 45 | - if ( chunkdata.wBitsPerSample == 8 ) { |
46 | - r = (data[out++] - 128) * 128; | 46 | - r = (data[out++] - 128) * 128; |
47 | - } else { | 47 | - } else { |
48 | - r = ((short*)data)[out/2]; | 48 | - r = ((short*)data)[out/2]; |
49 | - out += 2; | 49 | - out += 2; |
50 | - } | 50 | - } |
51 | + r = getOneSample(); | 51 | + r = getOneSample(); |
52 | } | 52 | } |
53 | } else { | 53 | } else { |
54 | if ( chunkdata.channels == 2 ) { | 54 | if ( chunkdata.channels == 2 ) { |
55 | - if ( chunkdata.wBitsPerSample == 8 ) { | 55 | - if ( chunkdata.wBitsPerSample == 8 ) { |
56 | - r = (data[out++] - 128) * 128; | 56 | - r = (data[out++] - 128) * 128; |
57 | - } else { | 57 | - } else { |
58 | - r = ((short*)data)[out/2]; | 58 | - r = ((short*)data)[out/2]; |
59 | - out += 2; | 59 | - out += 2; |
60 | - } | 60 | - } |
61 | + r = getOneSample(); | 61 | + r = getOneSample(); |
62 | l = l + r; | 62 | l = l + r; |
63 | } | 63 | } |
64 | } | 64 | } |
65 | |||
66 | --- src/kernel/qpixmap_qws.cpp.origMon Mar 11 17:00:03 2002 | ||
67 | +++ src/kernel/qpixmap_qws.cppMon Mar 11 17:01:05 2002 | ||
68 | @@ -585,6 +585,13 @@ QPixmap QPixmap::xForm( const QWMatrix & | ||
69 | QWMatrix mat( 1, 0, 0, 1, -xmin, -ymin );// true matrix | ||
70 | mat = matrix * mat; | ||
71 | |||
72 | + // calculate new width and height | ||
73 | + QPointArray a( QRect( 0,0,ws,hs ) ); | ||
74 | + a = mat.map( a ); | ||
75 | + QRect r = a.boundingRect().normalize(); | ||
76 | + w = r.width(); | ||
77 | + h = r.height(); | ||
78 | + | ||
79 | if ( matrix.m12() == 0.0F && matrix.m21() == 0.0F && | ||
80 | matrix.m11() >= 0.0F && matrix.m22() >= 0.0F && | ||
81 | depth() == defaultDepth() // ### stretchBlt limitation | ||
82 | @@ -593,11 +600,6 @@ QPixmap QPixmap::xForm( const QWMatrix & | ||
83 | if ( mat.m11() == 1.0F && mat.m22() == 1.0F ) | ||
84 | return *this; // identity matrix | ||
85 | |||
86 | -h = qRound( mat.m22()*hs ); | ||
87 | -w = qRound( mat.m11()*ws ); | ||
88 | -h = QABS( h ); | ||
89 | -w = QABS( w ); | ||
90 | - | ||
91 | if(w==0 || h==0) { | ||
92 | return *this; | ||
93 | } | ||
94 | @@ -618,12 +620,6 @@ QPixmap QPixmap::xForm( const QWMatrix & | ||
95 | } | ||
96 | return pm; | ||
97 | |||
98 | - } else { // rotation or shearing | ||
99 | -QPointArray a( QRect(0,0,ws,hs) ); | ||
100 | -a = mat.map( a ); | ||
101 | -QRect r = a.boundingRect().normalize(); | ||
102 | -w = r.width(); | ||
103 | -h = r.height(); | ||
104 | } | ||
105 | bool invertible; | ||
106 | mat = mat.invert( &invertible ); // invert matrix | ||