OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
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 "GrGpuGL.h" | 8 #include "GrGpuGL.h" |
9 | 9 |
10 #include "GrEffect.h" | 10 #include "GrEffect.h" |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 fEntries[entryIdx] = entry; | 158 fEntries[entryIdx] = entry; |
159 } else if (purgeIdx < entryIdx) { | 159 } else if (purgeIdx < entryIdx) { |
160 // If the entries array looks like this: | 160 // If the entries array looks like this: |
161 // aaaaPbbbbbEccccc | 161 // aaaaPbbbbbEccccc |
162 // we rearrange it to look like this: | 162 // we rearrange it to look like this: |
163 // aaaabbbbbPEccccc | 163 // aaaabbbbbPEccccc |
164 size_t copySize = (entryIdx - purgeIdx - 1) * sizeof(Entry*); | 164 size_t copySize = (entryIdx - purgeIdx - 1) * sizeof(Entry*); |
165 memmove(fEntries + purgeIdx, fEntries + purgeIdx + 1, copySize); | 165 memmove(fEntries + purgeIdx, fEntries + purgeIdx + 1, copySize); |
166 fEntries[entryIdx - 1] = entry; | 166 fEntries[entryIdx - 1] = entry; |
167 } | 167 } |
168 #if GR_DEBUG | 168 #if SK_DEBUG |
169 SkASSERT(NULL != fEntries[0]->fProgram.get()); | 169 SkASSERT(NULL != fEntries[0]->fProgram.get()); |
170 for (int i = 0; i < fCount - 1; ++i) { | 170 for (int i = 0; i < fCount - 1; ++i) { |
171 SkASSERT(NULL != fEntries[i + 1]->fProgram.get()); | 171 SkASSERT(NULL != fEntries[i + 1]->fProgram.get()); |
172 const GrGLProgramDesc& a = fEntries[i]->fProgram->getDesc(); | 172 const GrGLProgramDesc& a = fEntries[i]->fProgram->getDesc(); |
173 const GrGLProgramDesc& b = fEntries[i + 1]->fProgram->getDesc(); | 173 const GrGLProgramDesc& b = fEntries[i + 1]->fProgram->getDesc(); |
174 SkASSERT(GrGLProgramDesc::Less(a, b)); | 174 SkASSERT(GrGLProgramDesc::Less(a, b)); |
175 SkASSERT(!GrGLProgramDesc::Less(b, a)); | 175 SkASSERT(!GrGLProgramDesc::Less(b, a)); |
176 } | 176 } |
177 #endif | 177 #endif |
178 } | 178 } |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 GrGLAttribTypeToLayout(attribType).fCount, | 398 GrGLAttribTypeToLayout(attribType).fCount, |
399 GrGLAttribTypeToLayout(attribType).fType, | 399 GrGLAttribTypeToLayout(attribType).fType, |
400 GrGLAttribTypeToLayout(attribType).fNormalized, | 400 GrGLAttribTypeToLayout(attribType).fNormalized, |
401 stride, | 401 stride, |
402 reinterpret_cast<GrGLvoid*>( | 402 reinterpret_cast<GrGLvoid*>( |
403 vertexOffsetInBytes + vertexAttrib->fOffset)); | 403 vertexOffsetInBytes + vertexAttrib->fOffset)); |
404 } | 404 } |
405 | 405 |
406 attribState->disableUnusedAttribArrays(this, usedAttribArraysMask); | 406 attribState->disableUnusedAttribArrays(this, usedAttribArraysMask); |
407 } | 407 } |
OLD | NEW |