Chromium Code Reviews| 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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 223 } | 223 } |
| 224 | 224 |
| 225 GrXferProcessor* | 225 GrXferProcessor* |
| 226 GrCoverageSetOpXPFactory::onCreateXferProcessor(const GrCaps& caps, | 226 GrCoverageSetOpXPFactory::onCreateXferProcessor(const GrCaps& caps, |
| 227 const GrProcOptInfo& colorPOI, | 227 const GrProcOptInfo& colorPOI, |
| 228 const GrProcOptInfo& covPOI, | 228 const GrProcOptInfo& covPOI, |
| 229 const DstTexture* dst) const { | 229 const DstTexture* dst) const { |
| 230 return CoverageSetOpXP::Create(fRegionOp, fInvertCoverage); | 230 return CoverageSetOpXP::Create(fRegionOp, fInvertCoverage); |
| 231 } | 231 } |
| 232 | 232 |
| 233 void GrCoverageSetOpXPFactory::getInvariantOutput(const GrProcOptInfo& colorPOI, | 233 void GrCoverageSetOpXPFactory::getInvariantBlendedColor(const GrProcOptInfo& /*c olorPOI*/, |
|
bsalomon
2015/06/02 13:44:33
Shouldn't need to comment out the param name. We o
egdaniel
2015/06/02 14:19:41
Does this guy really make sense in this new Blende
Chris Dalton
2015/06/02 16:06:06
My sense is that it does make sense, because this
egdaniel
2015/06/02 16:46:54
So my vote would be for option 1. As you said we c
Chris Dalton
2015/06/02 17:07:12
Agreed. Done.
| |
| 234 const GrProcOptInfo& coverageP OI, | 234 const GrProcOptInfo& cov eragePOI, |
| 235 GrXPFactory::InvariantOutput* output) const { | 235 InvariantBlendedColor* b lendedColor) const { |
| 236 if (SkRegion::kReplace_Op == fRegionOp) { | 236 if (SkRegion::kReplace_Op == fRegionOp) { |
| 237 if (coveragePOI.isSolidWhite()) { | 237 if (coveragePOI.isSolidWhite()) { |
| 238 output->fBlendedColor = GrColor_WHITE; | 238 blendedColor->fKnownColor = GrColor_WHITE; |
| 239 output->fBlendedColorFlags = kRGBA_GrColorComponentFlags; | 239 blendedColor->fKnownColorFlags = kRGBA_GrColorComponentFlags; |
| 240 } else { | 240 } else { |
| 241 output->fBlendedColorFlags = 0; | 241 blendedColor->fKnownColorFlags = kNone_GrColorComponentFlags; |
| 242 } | 242 } |
| 243 | 243 |
| 244 output->fWillBlendWithDst = false; | 244 blendedColor->fWillBlendWithDst = false; |
| 245 } else { | 245 } else { |
| 246 output->fBlendedColorFlags = 0; | 246 blendedColor->fKnownColorFlags = kNone_GrColorComponentFlags; |
| 247 output->fWillBlendWithDst = true; | 247 blendedColor->fWillBlendWithDst = true; |
| 248 } | 248 } |
| 249 } | 249 } |
| 250 | 250 |
| 251 GR_DEFINE_XP_FACTORY_TEST(GrCoverageSetOpXPFactory); | 251 GR_DEFINE_XP_FACTORY_TEST(GrCoverageSetOpXPFactory); |
| 252 | 252 |
| 253 GrXPFactory* GrCoverageSetOpXPFactory::TestCreate(SkRandom* random, | 253 GrXPFactory* GrCoverageSetOpXPFactory::TestCreate(SkRandom* random, |
| 254 GrContext*, | 254 GrContext*, |
| 255 const GrCaps&, | 255 const GrCaps&, |
| 256 GrTexture*[]) { | 256 GrTexture*[]) { |
| 257 SkRegion::Op regionOp = SkRegion::Op(random->nextULessThan(SkRegion::kLastOp + 1)); | 257 SkRegion::Op regionOp = SkRegion::Op(random->nextULessThan(SkRegion::kLastOp + 1)); |
| 258 bool invertCoverage = random->nextBool(); | 258 bool invertCoverage = random->nextBool(); |
| 259 return GrCoverageSetOpXPFactory::Create(regionOp, invertCoverage); | 259 return GrCoverageSetOpXPFactory::Create(regionOp, invertCoverage); |
| 260 } | 260 } |
| 261 | 261 |
| OLD | NEW |