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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 overrides->fUsePLSDstRead = false; | |
79 } | 78 } |
80 | 79 |
81 void GrDrawVerticesBatch::initBatchTracker(const GrXPOverridesForBatch& override
s) { | 80 void GrDrawVerticesBatch::initBatchTracker(const GrXPOverridesForBatch& override
s) { |
82 SkASSERT(fGeoData.count() == 1); | 81 SkASSERT(fGeoData.count() == 1); |
83 GrColor overrideColor; | 82 GrColor overrideColor; |
84 if (overrides.getOverrideColorIfSet(&overrideColor)) { | 83 if (overrides.getOverrideColorIfSet(&overrideColor)) { |
85 fGeoData[0].fColor = overrideColor; | 84 fGeoData[0].fColor = overrideColor; |
86 fGeoData[0].fColors.reset(); | 85 fGeoData[0].fColors.reset(); |
87 fVariableColor = false; | 86 fVariableColor = false; |
88 } | 87 } |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 geometry.fColor = GrRandomColor(random); | 317 geometry.fColor = GrRandomColor(random); |
319 return GrDrawVerticesBatch::Create(geometry, type, viewMatrix, | 318 return GrDrawVerticesBatch::Create(geometry, type, viewMatrix, |
320 positions.begin(), vertexCount, | 319 positions.begin(), vertexCount, |
321 indices.begin(), hasIndices ? vertexCount
: 0, | 320 indices.begin(), hasIndices ? vertexCount
: 0, |
322 colors.begin(), | 321 colors.begin(), |
323 texCoords.begin(), | 322 texCoords.begin(), |
324 bounds); | 323 bounds); |
325 } | 324 } |
326 | 325 |
327 #endif | 326 #endif |
OLD | NEW |