| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 | 10 |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 #ifdef SK_DEBUG | 266 #ifdef SK_DEBUG |
| 267 geoSrc.fIndexBuffer = (GrIndexBuffer*)DEBUG_INVAL_BUFFER; | 267 geoSrc.fIndexBuffer = (GrIndexBuffer*)DEBUG_INVAL_BUFFER; |
| 268 #endif | 268 #endif |
| 269 break; | 269 break; |
| 270 default: | 270 default: |
| 271 SkFAIL("Unknown Index Source Type."); | 271 SkFAIL("Unknown Index Source Type."); |
| 272 break; | 272 break; |
| 273 } | 273 } |
| 274 } | 274 } |
| 275 | 275 |
| 276 void GrDrawTarget::setVertexSourceToArray(const void* vertexArray, | |
| 277 int vertexCount) { | |
| 278 this->releasePreviousVertexSource(); | |
| 279 GeometrySrcState& geoSrc = fGeoSrcStateStack.back(); | |
| 280 geoSrc.fVertexSrc = kArray_GeometrySrcType; | |
| 281 geoSrc.fVertexSize = this->drawState()->getVertexStride(); | |
| 282 geoSrc.fVertexCount = vertexCount; | |
| 283 this->onSetVertexSourceToArray(vertexArray, vertexCount); | |
| 284 } | |
| 285 | |
| 286 void GrDrawTarget::setIndexSourceToArray(const void* indexArray, | |
| 287 int indexCount) { | |
| 288 this->releasePreviousIndexSource(); | |
| 289 GeometrySrcState& geoSrc = fGeoSrcStateStack.back(); | |
| 290 geoSrc.fIndexSrc = kArray_GeometrySrcType; | |
| 291 geoSrc.fIndexCount = indexCount; | |
| 292 this->onSetIndexSourceToArray(indexArray, indexCount); | |
| 293 } | |
| 294 | |
| 295 void GrDrawTarget::setVertexSourceToBuffer(const GrVertexBuffer* buffer) { | 276 void GrDrawTarget::setVertexSourceToBuffer(const GrVertexBuffer* buffer) { |
| 296 this->releasePreviousVertexSource(); | 277 this->releasePreviousVertexSource(); |
| 297 GeometrySrcState& geoSrc = fGeoSrcStateStack.back(); | 278 GeometrySrcState& geoSrc = fGeoSrcStateStack.back(); |
| 298 geoSrc.fVertexSrc = kBuffer_GeometrySrcType; | 279 geoSrc.fVertexSrc = kBuffer_GeometrySrcType; |
| 299 geoSrc.fVertexBuffer = buffer; | 280 geoSrc.fVertexBuffer = buffer; |
| 300 buffer->ref(); | 281 buffer->ref(); |
| 301 geoSrc.fVertexSize = this->drawState()->getVertexStride(); | 282 geoSrc.fVertexSize = this->drawState()->getVertexStride(); |
| 302 } | 283 } |
| 303 | 284 |
| 304 void GrDrawTarget::setIndexSourceToBuffer(const GrIndexBuffer* buffer) { | 285 void GrDrawTarget::setIndexSourceToBuffer(const GrIndexBuffer* buffer) { |
| (...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1143 | 1124 |
| 1144 uint32_t GrDrawTargetCaps::CreateUniqueID() { | 1125 uint32_t GrDrawTargetCaps::CreateUniqueID() { |
| 1145 static int32_t gUniqueID = SK_InvalidUniqueID; | 1126 static int32_t gUniqueID = SK_InvalidUniqueID; |
| 1146 uint32_t id; | 1127 uint32_t id; |
| 1147 do { | 1128 do { |
| 1148 id = static_cast<uint32_t>(sk_atomic_inc(&gUniqueID) + 1); | 1129 id = static_cast<uint32_t>(sk_atomic_inc(&gUniqueID) + 1); |
| 1149 } while (id == SK_InvalidUniqueID); | 1130 } while (id == SK_InvalidUniqueID); |
| 1150 return id; | 1131 return id; |
| 1151 } | 1132 } |
| 1152 | 1133 |
| OLD | NEW |