Chromium Code Reviews| Index: src/gpu/instanced/InstancedRendering.cpp |
| diff --git a/src/gpu/instanced/InstancedRendering.cpp b/src/gpu/instanced/InstancedRendering.cpp |
| index 165bff494b3fa0ab1f241c844ec59afb8b582da9..adb0738967cff82c429c54453b30c0946e8b70af 100644 |
| --- a/src/gpu/instanced/InstancedRendering.cpp |
| +++ b/src/gpu/instanced/InstancedRendering.cpp |
| @@ -328,6 +328,20 @@ void InstancedRendering::Batch::appendParamsTexel(SkScalar x, SkScalar y, SkScal |
| fInfo.fHasParams = true; |
| } |
| +void InstancedRendering::Batch::computePipelineOptimizations(GrInitInvariantOutput* color, |
| + GrInitInvariantOutput* coverage, |
| + GrBatchToXPOverrides* overrides) const { |
| + color->setKnownFourComponents(this->getSingleInstance().fColor); |
| + |
| + if (AntialiasMode::kCoverage == fInfo.fAntialiasMode || |
| + (AntialiasMode::kNone == fInfo.fAntialiasMode && |
| + !fInfo.isSimpleRects() && fInfo.fCannotDiscard)) { |
| + coverage->setUnknownSingleComponent(); |
| + } else { |
| + coverage->setKnownSingleComponent(255); |
| + } |
| +} |
| + |
| void InstancedRendering::Batch::initBatchTracker(const GrXPOverridesForBatch& overrides) { |
| Draw& draw = this->getSingleDraw(); // This will assert if we have > 1 command. |
| SkASSERT(draw.fGeometry.isEmpty()); |
| @@ -389,22 +403,6 @@ bool InstancedRendering::Batch::onCombineIfPossible(GrBatch* other, const GrCaps |
| return true; |
| } |
| -void InstancedRendering::Batch::computePipelineOptimizations(GrInitInvariantOutput* color, |
| - GrInitInvariantOutput* coverage, |
| - GrBatchToXPOverrides* overrides) const { |
| - // We need to be careful about fInfo here and consider how it might change as batches combine. |
| - // e.g. We can't make an assumption based on fInfo.isSimpleRects() because the batch might |
| - // later combine with a non-rect. |
|
csmartdalton
2016/07/03 17:36:43
This comment was actually just about a bug, fixed
|
| - color->setUnknownFourComponents(); |
| - if (fInfo.fAntialiasMode >= AntialiasMode::kMSAA) { |
| - coverage->setKnownSingleComponent(255); |
| - } else if (AntialiasMode::kNone == fInfo.fAntialiasMode && !fInfo.fCannotDiscard) { |
| - coverage->setKnownSingleComponent(255); |
| - } else { |
| - coverage->setUnknownSingleComponent(); |
| - } |
| -} |
| - |
| void InstancedRendering::beginFlush(GrResourceProvider* rp) { |
| SkASSERT(State::kRecordingDraws == fState); |
| fState = State::kFlushing; |