OLD | NEW |
---|---|
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 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 #include "effects/GrCoverageSetOpXP.h" | 9 #include "effects/GrCoverageSetOpXP.h" |
10 #include "GrCaps.h" | 10 #include "GrCaps.h" |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
217 } | 217 } |
218 default: | 218 default: |
219 return NULL; | 219 return NULL; |
220 } | 220 } |
221 } | 221 } |
222 | 222 |
223 GrXferProcessor* | 223 GrXferProcessor* |
224 GrCoverageSetOpXPFactory::onCreateXferProcessor(const GrCaps& caps, | 224 GrCoverageSetOpXPFactory::onCreateXferProcessor(const GrCaps& caps, |
225 const GrProcOptInfo& colorPOI, | 225 const GrProcOptInfo& colorPOI, |
226 const GrProcOptInfo& covPOI, | 226 const GrProcOptInfo& covPOI, |
227 bool hasMixedSamples, | |
227 const DstTexture* dst) const { | 228 const DstTexture* dst) const { |
229 // We don't support inverting coverage with mixed samples. We don't expect t o ever want this in | |
230 // the future, however we could at some point make this work using an invert ed coverage | |
231 // modulation table. Note that an inverted table still won't work if there a re coverage procs. | |
232 SkASSERT(!fInvertCoverage || !hasMixedSamples); | |
egdaniel
2015/06/08 21:29:45
Lets return NULL here if we hit this case
| |
233 | |
228 return CoverageSetOpXP::Create(fRegionOp, fInvertCoverage); | 234 return CoverageSetOpXP::Create(fRegionOp, fInvertCoverage); |
229 } | 235 } |
230 | 236 |
231 void GrCoverageSetOpXPFactory::getInvariantBlendedColor(const GrProcOptInfo& col orPOI, | 237 void GrCoverageSetOpXPFactory::getInvariantBlendedColor(const GrProcOptInfo& col orPOI, |
232 InvariantBlendedColor* b lendedColor) const { | 238 InvariantBlendedColor* b lendedColor) const { |
233 blendedColor->fWillBlendWithDst = SkRegion::kReplace_Op != fRegionOp; | 239 blendedColor->fWillBlendWithDst = SkRegion::kReplace_Op != fRegionOp; |
234 blendedColor->fKnownColorFlags = kNone_GrColorComponentFlags; | 240 blendedColor->fKnownColorFlags = kNone_GrColorComponentFlags; |
235 } | 241 } |
236 | 242 |
237 GR_DEFINE_XP_FACTORY_TEST(GrCoverageSetOpXPFactory); | 243 GR_DEFINE_XP_FACTORY_TEST(GrCoverageSetOpXPFactory); |
238 | 244 |
239 GrXPFactory* GrCoverageSetOpXPFactory::TestCreate(SkRandom* random, | 245 GrXPFactory* GrCoverageSetOpXPFactory::TestCreate(SkRandom* random, |
240 GrContext*, | 246 GrContext*, |
241 const GrCaps&, | 247 const GrCaps&, |
242 GrTexture*[]) { | 248 GrTexture*[]) { |
243 SkRegion::Op regionOp = SkRegion::Op(random->nextULessThan(SkRegion::kLastOp + 1)); | 249 SkRegion::Op regionOp = SkRegion::Op(random->nextULessThan(SkRegion::kLastOp + 1)); |
244 bool invertCoverage = random->nextBool(); | 250 bool invertCoverage = random->nextBool(); |
245 return GrCoverageSetOpXPFactory::Create(regionOp, invertCoverage); | 251 return GrCoverageSetOpXPFactory::Create(regionOp, invertCoverage); |
246 } | 252 } |
247 | 253 |
OLD | NEW |