OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkMatrix.h" | 8 #include "SkMatrix.h" |
9 #include "SkFloatBits.h" | 9 #include "SkFloatBits.h" |
10 #include "SkRSXform.h" | 10 #include "SkRSXform.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 m01 = m01 != 0; | 149 m01 = m01 != 0; |
150 m10 = m10 != 0; | 150 m10 = m10 != 0; |
151 | 151 |
152 int dp0 = 0 == (m00 | m11) ; // true if both are 0 | 152 int dp0 = 0 == (m00 | m11) ; // true if both are 0 |
153 int ds1 = m01 & m10; // true if both are 1 | 153 int ds1 = m01 & m10; // true if both are 1 |
154 | 154 |
155 mask |= (dp0 & ds1) << kRectStaysRect_Shift; | 155 mask |= (dp0 & ds1) << kRectStaysRect_Shift; |
156 } else { | 156 } else { |
157 // Only test for scale explicitly if not affine, since affine sets the | 157 // Only test for scale explicitly if not affine, since affine sets the |
158 // scale bit. | 158 // scale bit. |
159 if ((m00 - kScalar1Int) | (m11 - kScalar1Int)) { | 159 if ((m00 ^ kScalar1Int) | (m11 ^ kScalar1Int)) { |
160 mask |= kScale_Mask; | 160 mask |= kScale_Mask; |
161 } | 161 } |
162 | 162 |
163 // Not affine, therefore we already know secondary diagonal is | 163 // Not affine, therefore we already know secondary diagonal is |
164 // all zeros, so we just need to check that primary diagonal is | 164 // all zeros, so we just need to check that primary diagonal is |
165 // all non-zero. | 165 // all non-zero. |
166 | 166 |
167 // map non-zero to 1 | 167 // map non-zero to 1 |
168 m00 = m00 != 0; | 168 m00 = m00 != 0; |
169 m11 = m11 != 0; | 169 m11 = m11 != 0; |
(...skipping 1603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1773 const SkScalar m11 = m00; | 1773 const SkScalar m11 = m00; |
1774 const SkScalar m12 = fTy; | 1774 const SkScalar m12 = fTy; |
1775 | 1775 |
1776 quad[0].set(m02, m12); | 1776 quad[0].set(m02, m12); |
1777 quad[1].set(m00 * width + m02, m10 * width + m12); | 1777 quad[1].set(m00 * width + m02, m10 * width + m12); |
1778 quad[2].set(m00 * width + m01 * height + m02, m10 * width + m11 * height + m
12); | 1778 quad[2].set(m00 * width + m01 * height + m02, m10 * width + m11 * height + m
12); |
1779 quad[3].set(m01 * height + m02, m11 * height + m12); | 1779 quad[3].set(m01 * height + m02, m11 * height + m12); |
1780 #endif | 1780 #endif |
1781 } | 1781 } |
1782 | 1782 |
OLD | NEW |