| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 The Android Open Source Project | 2 * Copyright (C) 2006 The Android Open Source Project |
| 3 * | 3 * |
| 4 * Licensed under the Apache License, Version 2.0 (the "License"); | 4 * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 * you may not use this file except in compliance with 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 | 6 * You may obtain a copy of the License at |
| 7 * | 7 * |
| 8 * http://www.apache.org/licenses/LICENSE-2.0 | 8 * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 * | 9 * |
| 10 * Unless required by applicable law or agreed to in writing, software | 10 * Unless required by applicable law or agreed to in writing, software |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 #undef SK_RESTRICT | 159 #undef SK_RESTRICT |
| 160 #define SK_RESTRICT | 160 #define SK_RESTRICT |
| 161 | 161 |
| 162 // Skia uses this deprecated bzero function to fill zeros into a string. | 162 // Skia uses this deprecated bzero function to fill zeros into a string. |
| 163 #define bzero(str, len) memset(str, 0, len) | 163 #define bzero(str, len) memset(str, 0, len) |
| 164 | 164 |
| 165 #elif defined(SK_BUILD_FOR_MAC) | 165 #elif defined(SK_BUILD_FOR_MAC) |
| 166 | 166 |
| 167 #define SK_CPU_LENDIAN | 167 #define SK_CPU_LENDIAN |
| 168 #undef SK_CPU_BENDIAN | 168 #undef SK_CPU_BENDIAN |
| 169 // we want (memory order) RGBA | 169 // we want (memory order) BGRA, because that's what core image uses with |
| 170 // kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host, which is what |
| 171 // Apple recommends for best performance (ARGB becomes BGRA in memory on |
| 172 // little-endian) -- and we want skia and coregraphic to have matching memory |
| 173 // layouts, so that we don't have to spend time converting between them. |
| 170 #define SK_A32_SHIFT 24 | 174 #define SK_A32_SHIFT 24 |
| 171 #define SK_R32_SHIFT 0 | 175 #define SK_R32_SHIFT 16 |
| 172 #define SK_G32_SHIFT 8 | 176 #define SK_G32_SHIFT 8 |
| 173 #define SK_B32_SHIFT 16 | 177 #define SK_B32_SHIFT 0 |
| 174 | 178 |
| 175 #elif defined(SK_BUILD_FOR_UNIX) | 179 #elif defined(SK_BUILD_FOR_UNIX) |
| 176 | 180 |
| 177 #ifdef SK_CPU_BENDIAN | 181 #ifdef SK_CPU_BENDIAN |
| 178 // Below we set the order for ARGB channels in registers. I suspect that, on | 182 // Below we set the order for ARGB channels in registers. I suspect that, on |
| 179 // big endian machines, you can keep this the same and everything will work. | 183 // big endian machines, you can keep this the same and everything will work. |
| 180 // The in-memory order will be different, of course, but as long as everything | 184 // The in-memory order will be different, of course, but as long as everything |
| 181 // is reading memory as words rather than bytes, it will all work. However, if | 185 // is reading memory as words rather than bytes, it will all work. However, if |
| 182 // you find that colours are messed up I thought that I would leave a helpful | 186 // you find that colours are messed up I thought that I would leave a helpful |
| 183 // locator for you. Also see the comments in | 187 // locator for you. Also see the comments in |
| (...skipping 29 matching lines...) Expand all Loading... |
| 213 #undef SK_DEBUG | 217 #undef SK_DEBUG |
| 214 //#endif | 218 //#endif |
| 215 | 219 |
| 216 // For now (and to avoid rebaselining 1700+ tests), we'll use the old version | 220 // For now (and to avoid rebaselining 1700+ tests), we'll use the old version |
| 217 // of SkAlpha255To256. | 221 // of SkAlpha255To256. |
| 218 #define SK_USE_OLD_255_TO_256 | 222 #define SK_USE_OLD_255_TO_256 |
| 219 | 223 |
| 220 // ===== End Chrome-specific definitions ===== | 224 // ===== End Chrome-specific definitions ===== |
| 221 | 225 |
| 222 #endif | 226 #endif |
| OLD | NEW |