The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2007 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Mathias Agopian | 8c20ca3 | 2010-02-22 03:15:57 -0800 | [diff] [blame] | 17 | #include <math.h> |
| 18 | |
| 19 | #include <cutils/compiler.h> |
| 20 | #include <utils/String8.h> |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 21 | #include <ui/Region.h> |
| 22 | |
Mathias Agopian | f07b8a3 | 2011-07-19 15:24:46 -0700 | [diff] [blame] | 23 | #include "clz.h" |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 24 | #include "Transform.h" |
| 25 | |
| 26 | // --------------------------------------------------------------------------- |
| 27 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 28 | namespace android { |
| 29 | |
| 30 | // --------------------------------------------------------------------------- |
| 31 | |
Mathias Agopian | 8c20ca3 | 2010-02-22 03:15:57 -0800 | [diff] [blame] | 32 | Transform::Transform() { |
| 33 | reset(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 34 | } |
| 35 | |
| 36 | Transform::Transform(const Transform& other) |
Mathias Agopian | 8c20ca3 | 2010-02-22 03:15:57 -0800 | [diff] [blame] | 37 | : mMatrix(other.mMatrix), mType(other.mType) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 38 | } |
| 39 | |
Mathias Agopian | 8c20ca3 | 2010-02-22 03:15:57 -0800 | [diff] [blame] | 40 | Transform::Transform(uint32_t orientation) { |
| 41 | set(orientation, 0, 0); |
Chih-Chung Chang | e1ceec2 | 2010-01-21 17:31:06 -0800 | [diff] [blame] | 42 | } |
| 43 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 44 | Transform::~Transform() { |
| 45 | } |
| 46 | |
Mathias Agopian | 015b597 | 2010-03-09 19:17:47 -0800 | [diff] [blame] | 47 | static const float EPSILON = 0.0f; |
Mathias Agopian | 8c20ca3 | 2010-02-22 03:15:57 -0800 | [diff] [blame] | 48 | |
| 49 | bool Transform::isZero(float f) { |
Mathias Agopian | 015b597 | 2010-03-09 19:17:47 -0800 | [diff] [blame] | 50 | return fabs(f) <= EPSILON; |
Mathias Agopian | 8c20ca3 | 2010-02-22 03:15:57 -0800 | [diff] [blame] | 51 | } |
| 52 | |
Mathias Agopian | 015b597 | 2010-03-09 19:17:47 -0800 | [diff] [blame] | 53 | bool Transform::absIsOne(float f) { |
| 54 | return isZero(fabs(f) - 1.0f); |
Mathias Agopian | 8c20ca3 | 2010-02-22 03:15:57 -0800 | [diff] [blame] | 55 | } |
| 56 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 57 | Transform Transform::operator * (const Transform& rhs) const |
| 58 | { |
Mathias Agopian | 8c20ca3 | 2010-02-22 03:15:57 -0800 | [diff] [blame] | 59 | if (CC_LIKELY(mType == IDENTITY)) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 60 | return rhs; |
| 61 | |
| 62 | Transform r(*this); |
Mathias Agopian | 8c20ca3 | 2010-02-22 03:15:57 -0800 | [diff] [blame] | 63 | if (rhs.mType == IDENTITY) |
| 64 | return r; |
| 65 | |
| 66 | // TODO: we could use mType to optimize the matrix multiply |
| 67 | const mat33& A(mMatrix); |
| 68 | const mat33& B(rhs.mMatrix); |
| 69 | mat33& D(r.mMatrix); |
| 70 | for (int i=0 ; i<3 ; i++) { |
| 71 | const float v0 = A[0][i]; |
| 72 | const float v1 = A[1][i]; |
| 73 | const float v2 = A[2][i]; |
| 74 | D[0][i] = v0*B[0][0] + v1*B[0][1] + v2*B[0][2]; |
| 75 | D[1][i] = v0*B[1][0] + v1*B[1][1] + v2*B[1][2]; |
| 76 | D[2][i] = v0*B[2][0] + v1*B[2][1] + v2*B[2][2]; |
| 77 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 78 | r.mType |= rhs.mType; |
Mathias Agopian | 8c20ca3 | 2010-02-22 03:15:57 -0800 | [diff] [blame] | 79 | |
| 80 | // TODO: we could recompute this value from r and rhs |
| 81 | r.mType &= 0xFF; |
| 82 | r.mType |= UNKNOWN_TYPE; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 83 | return r; |
| 84 | } |
| 85 | |
Mathias Agopian | 8c20ca3 | 2010-02-22 03:15:57 -0800 | [diff] [blame] | 86 | float const* Transform::operator [] (int i) const { |
| 87 | return mMatrix[i].v; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 88 | } |
| 89 | |
| 90 | bool Transform::transformed() const { |
Mathias Agopian | 8c20ca3 | 2010-02-22 03:15:57 -0800 | [diff] [blame] | 91 | return type() > TRANSLATE; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 92 | } |
| 93 | |
Mathias Agopian | 34cb9f2a | 2011-08-30 18:51:54 -0700 | [diff] [blame] | 94 | float Transform::tx() const { |
| 95 | return mMatrix[2][0]; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 96 | } |
| 97 | |
Mathias Agopian | 34cb9f2a | 2011-08-30 18:51:54 -0700 | [diff] [blame] | 98 | float Transform::ty() const { |
| 99 | return mMatrix[2][1]; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 100 | } |
| 101 | |
| 102 | void Transform::reset() { |
Mathias Agopian | 8c20ca3 | 2010-02-22 03:15:57 -0800 | [diff] [blame] | 103 | mType = IDENTITY; |
| 104 | for(int i=0 ; i<3 ; i++) { |
| 105 | vec3& v(mMatrix[i]); |
| 106 | for (int j=0 ; j<3 ; j++) |
| 107 | v[j] = ((i==j) ? 1.0f : 0.0f); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 108 | } |
| 109 | } |
| 110 | |
Mathias Agopian | 8c20ca3 | 2010-02-22 03:15:57 -0800 | [diff] [blame] | 111 | void Transform::set(float tx, float ty) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 112 | { |
Mathias Agopian | 8c20ca3 | 2010-02-22 03:15:57 -0800 | [diff] [blame] | 113 | mMatrix[2][0] = tx; |
| 114 | mMatrix[2][1] = ty; |
| 115 | mMatrix[2][2] = 1.0f; |
| 116 | |
| 117 | if (isZero(tx) && isZero(ty)) { |
| 118 | mType &= ~TRANSLATE; |
| 119 | } else { |
| 120 | mType |= TRANSLATE; |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | void Transform::set(float a, float b, float c, float d) |
| 125 | { |
| 126 | mat33& M(mMatrix); |
| 127 | M[0][0] = a; M[1][0] = b; |
| 128 | M[0][1] = c; M[1][1] = d; |
| 129 | M[0][2] = 0; M[1][2] = 0; |
| 130 | mType = UNKNOWN_TYPE; |
| 131 | } |
| 132 | |
Mathias Agopian | 015b597 | 2010-03-09 19:17:47 -0800 | [diff] [blame] | 133 | status_t Transform::set(uint32_t flags, float w, float h) |
Mathias Agopian | 8c20ca3 | 2010-02-22 03:15:57 -0800 | [diff] [blame] | 134 | { |
Mathias Agopian | 015b597 | 2010-03-09 19:17:47 -0800 | [diff] [blame] | 135 | if (flags & ROT_INVALID) { |
| 136 | // that's not allowed! |
| 137 | reset(); |
| 138 | return BAD_VALUE; |
| 139 | } |
| 140 | |
Mathias Agopian | 546c21d | 2010-10-24 14:53:05 -0700 | [diff] [blame] | 141 | Transform H, V, R; |
Mathias Agopian | e031ba8 | 2010-10-25 18:29:35 -0700 | [diff] [blame] | 142 | if (flags & ROT_90) { |
| 143 | // w & h are inverted when rotating by 90 degrees |
| 144 | swap(w, h); |
| 145 | } |
| 146 | |
Mathias Agopian | 8c20ca3 | 2010-02-22 03:15:57 -0800 | [diff] [blame] | 147 | if (flags & FLIP_H) { |
Mathias Agopian | 546c21d | 2010-10-24 14:53:05 -0700 | [diff] [blame] | 148 | H.mType = (FLIP_H << 8) | SCALE; |
| 149 | H.mType |= isZero(w) ? IDENTITY : TRANSLATE; |
| 150 | mat33& M(H.mMatrix); |
| 151 | M[0][0] = -1; |
| 152 | M[2][0] = w; |
Mathias Agopian | 8c20ca3 | 2010-02-22 03:15:57 -0800 | [diff] [blame] | 153 | } |
| 154 | |
| 155 | if (flags & FLIP_V) { |
Mathias Agopian | 546c21d | 2010-10-24 14:53:05 -0700 | [diff] [blame] | 156 | V.mType = (FLIP_V << 8) | SCALE; |
| 157 | V.mType |= isZero(h) ? IDENTITY : TRANSLATE; |
| 158 | mat33& M(V.mMatrix); |
| 159 | M[1][1] = -1; |
| 160 | M[2][1] = h; |
Mathias Agopian | 8c20ca3 | 2010-02-22 03:15:57 -0800 | [diff] [blame] | 161 | } |
| 162 | |
Mathias Agopian | 546c21d | 2010-10-24 14:53:05 -0700 | [diff] [blame] | 163 | if (flags & ROT_90) { |
Mathias Agopian | e031ba8 | 2010-10-25 18:29:35 -0700 | [diff] [blame] | 164 | const float original_w = h; |
Mathias Agopian | 546c21d | 2010-10-24 14:53:05 -0700 | [diff] [blame] | 165 | R.mType = (ROT_90 << 8) | ROTATE; |
Mathias Agopian | e031ba8 | 2010-10-25 18:29:35 -0700 | [diff] [blame] | 166 | R.mType |= isZero(original_w) ? IDENTITY : TRANSLATE; |
Mathias Agopian | 546c21d | 2010-10-24 14:53:05 -0700 | [diff] [blame] | 167 | mat33& M(R.mMatrix); |
Mathias Agopian | e031ba8 | 2010-10-25 18:29:35 -0700 | [diff] [blame] | 168 | M[0][0] = 0; M[1][0] =-1; M[2][0] = original_w; |
Mathias Agopian | 546c21d | 2010-10-24 14:53:05 -0700 | [diff] [blame] | 169 | M[0][1] = 1; M[1][1] = 0; |
Mathias Agopian | 8c20ca3 | 2010-02-22 03:15:57 -0800 | [diff] [blame] | 170 | } |
| 171 | |
Mathias Agopian | e031ba8 | 2010-10-25 18:29:35 -0700 | [diff] [blame] | 172 | *this = (R*(H*V)); |
Mathias Agopian | 015b597 | 2010-03-09 19:17:47 -0800 | [diff] [blame] | 173 | return NO_ERROR; |
Mathias Agopian | 8c20ca3 | 2010-02-22 03:15:57 -0800 | [diff] [blame] | 174 | } |
| 175 | |
| 176 | Transform::vec2 Transform::transform(const vec2& v) const { |
| 177 | vec2 r; |
| 178 | const mat33& M(mMatrix); |
| 179 | r[0] = M[0][0]*v[0] + M[1][0]*v[1] + M[2][0]; |
| 180 | r[1] = M[0][1]*v[0] + M[1][1]*v[1] + M[2][1]; |
| 181 | return r; |
| 182 | } |
| 183 | |
| 184 | Transform::vec3 Transform::transform(const vec3& v) const { |
| 185 | vec3 r; |
| 186 | const mat33& M(mMatrix); |
| 187 | r[0] = M[0][0]*v[0] + M[1][0]*v[1] + M[2][0]*v[2]; |
| 188 | r[1] = M[0][1]*v[0] + M[1][1]*v[1] + M[2][1]*v[2]; |
| 189 | r[2] = M[0][2]*v[0] + M[1][2]*v[1] + M[2][2]*v[2]; |
| 190 | return r; |
| 191 | } |
| 192 | |
Mathias Agopian | e5c0a7b | 2010-04-20 14:51:04 -0700 | [diff] [blame] | 193 | void Transform::transform(float* point, int x, int y) const |
Mathias Agopian | 8c20ca3 | 2010-02-22 03:15:57 -0800 | [diff] [blame] | 194 | { |
Mathias Agopian | 8c20ca3 | 2010-02-22 03:15:57 -0800 | [diff] [blame] | 195 | const mat33& M(mMatrix); |
| 196 | vec2 v(x, y); |
| 197 | v = transform(v); |
Mathias Agopian | e5c0a7b | 2010-04-20 14:51:04 -0700 | [diff] [blame] | 198 | point[0] = v[0]; |
| 199 | point[1] = v[1]; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 200 | } |
| 201 | |
| 202 | Rect Transform::makeBounds(int w, int h) const |
| 203 | { |
Mathias Agopian | 8c20ca3 | 2010-02-22 03:15:57 -0800 | [diff] [blame] | 204 | return transform( Rect(w, h) ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 205 | } |
| 206 | |
| 207 | Rect Transform::transform(const Rect& bounds) const |
| 208 | { |
| 209 | Rect r; |
Mathias Agopian | 8c20ca3 | 2010-02-22 03:15:57 -0800 | [diff] [blame] | 210 | vec2 lt( bounds.left, bounds.top ); |
| 211 | vec2 rt( bounds.right, bounds.top ); |
| 212 | vec2 lb( bounds.left, bounds.bottom ); |
| 213 | vec2 rb( bounds.right, bounds.bottom ); |
| 214 | |
| 215 | lt = transform(lt); |
| 216 | rt = transform(rt); |
| 217 | lb = transform(lb); |
| 218 | rb = transform(rb); |
| 219 | |
| 220 | r.left = floorf(min(lt[0], rt[0], lb[0], rb[0]) + 0.5f); |
| 221 | r.top = floorf(min(lt[1], rt[1], lb[1], rb[1]) + 0.5f); |
| 222 | r.right = floorf(max(lt[0], rt[0], lb[0], rb[0]) + 0.5f); |
| 223 | r.bottom = floorf(max(lt[1], rt[1], lb[1], rb[1]) + 0.5f); |
| 224 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 225 | return r; |
| 226 | } |
| 227 | |
| 228 | Region Transform::transform(const Region& reg) const |
| 229 | { |
| 230 | Region out; |
Mathias Agopian | 8c20ca3 | 2010-02-22 03:15:57 -0800 | [diff] [blame] | 231 | if (CC_UNLIKELY(transformed())) { |
| 232 | if (CC_LIKELY(preserveRects())) { |
Mathias Agopian | 6158b1b | 2009-05-11 00:03:41 -0700 | [diff] [blame] | 233 | Region::const_iterator it = reg.begin(); |
| 234 | Region::const_iterator const end = reg.end(); |
| 235 | while (it != end) { |
| 236 | out.orSelf(transform(*it++)); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 237 | } |
| 238 | } else { |
| 239 | out.set(transform(reg.bounds())); |
| 240 | } |
| 241 | } else { |
Mathias Agopian | 34cb9f2a | 2011-08-30 18:51:54 -0700 | [diff] [blame] | 242 | int xpos = floorf(tx() + 0.5f); |
| 243 | int ypos = floorf(ty() + 0.5f); |
| 244 | out = reg.translate(xpos, ypos); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 245 | } |
| 246 | return out; |
| 247 | } |
| 248 | |
Mathias Agopian | 8c20ca3 | 2010-02-22 03:15:57 -0800 | [diff] [blame] | 249 | uint32_t Transform::type() const |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 250 | { |
Mathias Agopian | 8c20ca3 | 2010-02-22 03:15:57 -0800 | [diff] [blame] | 251 | if (mType & UNKNOWN_TYPE) { |
| 252 | // recompute what this transform is |
| 253 | |
| 254 | const mat33& M(mMatrix); |
| 255 | const float a = M[0][0]; |
| 256 | const float b = M[1][0]; |
| 257 | const float c = M[0][1]; |
| 258 | const float d = M[1][1]; |
| 259 | const float x = M[2][0]; |
| 260 | const float y = M[2][1]; |
| 261 | |
| 262 | bool scale = false; |
| 263 | uint32_t flags = ROT_0; |
| 264 | if (isZero(b) && isZero(c)) { |
Mathias Agopian | 015b597 | 2010-03-09 19:17:47 -0800 | [diff] [blame] | 265 | if (a<0) flags |= FLIP_H; |
| 266 | if (d<0) flags |= FLIP_V; |
| 267 | if (!absIsOne(a) || !absIsOne(d)) { |
| 268 | scale = true; |
Mathias Agopian | 8c20ca3 | 2010-02-22 03:15:57 -0800 | [diff] [blame] | 269 | } |
| 270 | } else if (isZero(a) && isZero(d)) { |
Mathias Agopian | 015b597 | 2010-03-09 19:17:47 -0800 | [diff] [blame] | 271 | flags |= ROT_90; |
Mathias Agopian | e031ba8 | 2010-10-25 18:29:35 -0700 | [diff] [blame] | 272 | if (b>0) flags |= FLIP_V; |
| 273 | if (c<0) flags |= FLIP_H; |
Mathias Agopian | 015b597 | 2010-03-09 19:17:47 -0800 | [diff] [blame] | 274 | if (!absIsOne(b) || !absIsOne(c)) { |
| 275 | scale = true; |
Mathias Agopian | 8c20ca3 | 2010-02-22 03:15:57 -0800 | [diff] [blame] | 276 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 277 | } else { |
Mathias Agopian | 9e37abb | 2011-07-12 14:51:45 -0700 | [diff] [blame] | 278 | // there is a skew component and/or a non 90 degrees rotation |
Mathias Agopian | 8c20ca3 | 2010-02-22 03:15:57 -0800 | [diff] [blame] | 279 | flags = ROT_INVALID; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 280 | } |
Mathias Agopian | 8c20ca3 | 2010-02-22 03:15:57 -0800 | [diff] [blame] | 281 | |
| 282 | mType = flags << 8; |
| 283 | if (flags & ROT_INVALID) { |
| 284 | mType |= UNKNOWN; |
| 285 | } else { |
| 286 | if ((flags & ROT_90) || ((flags & ROT_180) == ROT_180)) |
| 287 | mType |= ROTATE; |
| 288 | if (flags & FLIP_H) |
| 289 | mType ^= SCALE; |
| 290 | if (flags & FLIP_V) |
| 291 | mType ^= SCALE; |
| 292 | if (scale) |
| 293 | mType |= SCALE; |
| 294 | } |
| 295 | |
| 296 | if (!isZero(x) || !isZero(y)) |
| 297 | mType |= TRANSLATE; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 298 | } |
Mathias Agopian | 8c20ca3 | 2010-02-22 03:15:57 -0800 | [diff] [blame] | 299 | return mType; |
| 300 | } |
| 301 | |
| 302 | uint32_t Transform::getType() const { |
| 303 | return type() & 0xFF; |
| 304 | } |
| 305 | |
| 306 | uint32_t Transform::getOrientation() const |
| 307 | { |
| 308 | return (type() >> 8) & 0xFF; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 309 | } |
| 310 | |
| 311 | bool Transform::preserveRects() const |
| 312 | { |
Mathias Agopian | 9a817a3 | 2011-07-25 13:57:16 -0700 | [diff] [blame] | 313 | return (getOrientation() & ROT_INVALID) ? false : true; |
Mathias Agopian | 8c20ca3 | 2010-02-22 03:15:57 -0800 | [diff] [blame] | 314 | } |
| 315 | |
| 316 | void Transform::dump(const char* name) const |
| 317 | { |
| 318 | type(); // updates the type |
| 319 | |
| 320 | String8 flags, type; |
| 321 | const mat33& m(mMatrix); |
| 322 | uint32_t orient = mType >> 8; |
| 323 | |
Mathias Agopian | 015b597 | 2010-03-09 19:17:47 -0800 | [diff] [blame] | 324 | if (orient&ROT_INVALID) { |
Mathias Agopian | 8c20ca3 | 2010-02-22 03:15:57 -0800 | [diff] [blame] | 325 | flags.append("ROT_INVALID "); |
Mathias Agopian | 015b597 | 2010-03-09 19:17:47 -0800 | [diff] [blame] | 326 | } else { |
| 327 | if (orient&ROT_90) { |
| 328 | flags.append("ROT_90 "); |
| 329 | } else { |
| 330 | flags.append("ROT_0 "); |
| 331 | } |
| 332 | if (orient&FLIP_V) |
| 333 | flags.append("FLIP_V "); |
| 334 | if (orient&FLIP_H) |
| 335 | flags.append("FLIP_H "); |
| 336 | } |
Mathias Agopian | 8c20ca3 | 2010-02-22 03:15:57 -0800 | [diff] [blame] | 337 | |
Mathias Agopian | 015b597 | 2010-03-09 19:17:47 -0800 | [diff] [blame] | 338 | if (!(mType&(SCALE|ROTATE|TRANSLATE))) |
| 339 | type.append("IDENTITY "); |
Mathias Agopian | 8c20ca3 | 2010-02-22 03:15:57 -0800 | [diff] [blame] | 340 | if (mType&SCALE) |
| 341 | type.append("SCALE "); |
| 342 | if (mType&ROTATE) |
| 343 | type.append("ROTATE "); |
| 344 | if (mType&TRANSLATE) |
| 345 | type.append("TRANSLATE "); |
| 346 | |
Mathias Agopian | 015b597 | 2010-03-09 19:17:47 -0800 | [diff] [blame] | 347 | LOGD("%s 0x%08x (%s, %s)", name, mType, flags.string(), type.string()); |
| 348 | LOGD("%.4f %.4f %.4f", m[0][0], m[1][0], m[2][0]); |
| 349 | LOGD("%.4f %.4f %.4f", m[0][1], m[1][1], m[2][1]); |
| 350 | LOGD("%.4f %.4f %.4f", m[0][2], m[1][2], m[2][2]); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 351 | } |
| 352 | |
| 353 | // --------------------------------------------------------------------------- |
| 354 | |
| 355 | }; // namespace android |