OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "GrDrawVerticesBatch.h" | 8 #include "GrDrawVerticesBatch.h" |
9 | 9 |
10 #include "GrBatchFlushState.h" | 10 #include "GrBatchFlushState.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 if (localCoords) { | 58 if (localCoords) { |
59 installedGeo.fLocalCoords.append(vertexCount, localCoords); | 59 installedGeo.fLocalCoords.append(vertexCount, localCoords); |
60 } | 60 } |
61 fVertexCount = vertexCount; | 61 fVertexCount = vertexCount; |
62 fIndexCount = indexCount; | 62 fIndexCount = indexCount; |
63 fPrimitiveType = primitiveType; | 63 fPrimitiveType = primitiveType; |
64 | 64 |
65 this->setBounds(bounds); | 65 this->setBounds(bounds); |
66 } | 66 } |
67 | 67 |
68 void GrDrawVerticesBatch::computePipelineOptimizations(GrInitInvariantOutput* co
lor, | 68 void GrDrawVerticesBatch::computePipelineOptimizations(GrInitInvariantOutput* co
lor, |
69 GrInitInvariantOutput* co
verage, | 69 GrInitInvariantOutput* co
verage, |
70 GrBatchToXPOverrides* ove
rrides) const { | 70 GrBatchToXPOverrides* ove
rrides) const { |
71 // When this is called on a batch, there is only one geometry bundle | 71 // When this is called on a batch, there is only one geometry bundle |
72 if (fVariableColor) { | 72 if (fVariableColor) { |
73 color->setUnknownFourComponents(); | 73 color->setUnknownFourComponents(); |
74 } else { | 74 } else { |
75 color->setKnownFourComponents(fGeoData[0].fColor); | 75 color->setKnownFourComponents(fGeoData[0].fColor); |
76 } | 76 } |
77 coverage->setKnownSingleComponent(0xff); | 77 coverage->setKnownSingleComponent(0xff); |
78 } | 78 } |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 geometry.fColor = GrRandomColor(random); | 317 geometry.fColor = GrRandomColor(random); |
318 return GrDrawVerticesBatch::Create(geometry, type, viewMatrix, | 318 return GrDrawVerticesBatch::Create(geometry, type, viewMatrix, |
319 positions.begin(), vertexCount, | 319 positions.begin(), vertexCount, |
320 indices.begin(), hasIndices ? vertexCount
: 0, | 320 indices.begin(), hasIndices ? vertexCount
: 0, |
321 colors.begin(), | 321 colors.begin(), |
322 texCoords.begin(), | 322 texCoords.begin(), |
323 bounds); | 323 bounds); |
324 } | 324 } |
325 | 325 |
326 #endif | 326 #endif |
OLD | NEW |