reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 1 | /* |
| 2 | Copyright 2010 Google Inc. |
| 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 | |
| 17 | |
| 18 | /* |
| 19 | These are our vertex-indices for a series of "quads", which we implement |
| 20 | as a series of pairs of triangles. See setRectFan() for the |
| 21 | vertex order. |
| 22 | |
| 23 | The largest value is 255, so we could store these in any size |
| 24 | (byte, short, int). Since the table is small, we just choose the size |
| 25 | that we think will be fastest (e.g. some drivers don't have native support |
| 26 | for byte-indices, so byte may not be the fastest) |
| 27 | */ |
| 28 | static const uint16_t gQuadIndexTable[] = { |
| 29 | 0, 1, 2, 0, 2, 3, |
| 30 | 4, 5, 6, 4, 6, 7, |
| 31 | 8, 9, 10, 8, 10, 11, |
| 32 | 12, 13, 14, 12, 14, 15, |
| 33 | 16, 17, 18, 16, 18, 19, |
| 34 | 20, 21, 22, 20, 22, 23, |
| 35 | 24, 25, 26, 24, 26, 27, |
| 36 | 28, 29, 30, 28, 30, 31, |
| 37 | 32, 33, 34, 32, 34, 35, |
| 38 | 36, 37, 38, 36, 38, 39, |
| 39 | 40, 41, 42, 40, 42, 43, |
| 40 | 44, 45, 46, 44, 46, 47, |
| 41 | 48, 49, 50, 48, 50, 51, |
| 42 | 52, 53, 54, 52, 54, 55, |
| 43 | 56, 57, 58, 56, 58, 59, |
| 44 | 60, 61, 62, 60, 62, 63, |
| 45 | 64, 65, 66, 64, 66, 67, |
| 46 | 68, 69, 70, 68, 70, 71, |
| 47 | 72, 73, 74, 72, 74, 75, |
| 48 | 76, 77, 78, 76, 78, 79, |
| 49 | 80, 81, 82, 80, 82, 83, |
| 50 | 84, 85, 86, 84, 86, 87, |
| 51 | 88, 89, 90, 88, 90, 91, |
| 52 | 92, 93, 94, 92, 94, 95, |
| 53 | 96, 97, 98, 96, 98, 99, |
| 54 | 100, 101, 102, 100, 102, 103, |
| 55 | 104, 105, 106, 104, 106, 107, |
| 56 | 108, 109, 110, 108, 110, 111, |
| 57 | 112, 113, 114, 112, 114, 115, |
| 58 | 116, 117, 118, 116, 118, 119, |
| 59 | 120, 121, 122, 120, 122, 123, |
| 60 | 124, 125, 126, 124, 126, 127, |
| 61 | 128, 129, 130, 128, 130, 131, |
| 62 | 132, 133, 134, 132, 134, 135, |
| 63 | 136, 137, 138, 136, 138, 139, |
| 64 | 140, 141, 142, 140, 142, 143, |
| 65 | 144, 145, 146, 144, 146, 147, |
| 66 | 148, 149, 150, 148, 150, 151, |
| 67 | 152, 153, 154, 152, 154, 155, |
| 68 | 156, 157, 158, 156, 158, 159, |
| 69 | 160, 161, 162, 160, 162, 163, |
| 70 | 164, 165, 166, 164, 166, 167, |
| 71 | 168, 169, 170, 168, 170, 171, |
| 72 | 172, 173, 174, 172, 174, 175, |
| 73 | 176, 177, 178, 176, 178, 179, |
| 74 | 180, 181, 182, 180, 182, 183, |
| 75 | 184, 185, 186, 184, 186, 187, |
| 76 | 188, 189, 190, 188, 190, 191, |
| 77 | 192, 193, 194, 192, 194, 195, |
| 78 | 196, 197, 198, 196, 198, 199, |
| 79 | 200, 201, 202, 200, 202, 203, |
| 80 | 204, 205, 206, 204, 206, 207, |
| 81 | 208, 209, 210, 208, 210, 211, |
| 82 | 212, 213, 214, 212, 214, 215, |
| 83 | 216, 217, 218, 216, 218, 219, |
| 84 | 220, 221, 222, 220, 222, 223, |
| 85 | 224, 225, 226, 224, 226, 227, |
| 86 | 228, 229, 230, 228, 230, 231, |
| 87 | 232, 233, 234, 232, 234, 235, |
| 88 | 236, 237, 238, 236, 238, 239, |
| 89 | 240, 241, 242, 240, 242, 243, |
| 90 | 244, 245, 246, 244, 246, 247, |
| 91 | 248, 249, 250, 248, 250, 251, |
| 92 | 252, 253, 254, 252, 254, 255, |
| 93 | }; |
| 94 | |
| 95 | #define GR_COUNT_QUADINDEXTABLE GR_ARRAY_COUNT(gQuadIndexTable) |
| 96 | |
| 97 | |
| 98 | |