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 "GrColor.h" | 10 #include "GrColor.h" |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 const GrProcOptInfo& coverageP
OI, | 188 const GrProcOptInfo& coverageP
OI, |
189 GrXPFactory::InvariantOutput*
output) const { | 189 GrXPFactory::InvariantOutput*
output) const { |
190 if (SkRegion::kReplace_Op == fRegionOp) { | 190 if (SkRegion::kReplace_Op == fRegionOp) { |
191 if (coveragePOI.isSolidWhite()) { | 191 if (coveragePOI.isSolidWhite()) { |
192 output->fBlendedColor = GrColor_WHITE; | 192 output->fBlendedColor = GrColor_WHITE; |
193 output->fBlendedColorFlags = kRGBA_GrColorComponentFlags; | 193 output->fBlendedColorFlags = kRGBA_GrColorComponentFlags; |
194 } else { | 194 } else { |
195 output->fBlendedColorFlags = 0; | 195 output->fBlendedColorFlags = 0; |
196 } | 196 } |
197 | 197 |
198 if (coveragePOI.readsDst()) { | 198 output->fWillBlendWithDst = false; |
199 output->fWillBlendWithDst = true; | |
200 } else { | |
201 output->fWillBlendWithDst = false; | |
202 } | |
203 } else { | 199 } else { |
204 output->fBlendedColorFlags = 0; | 200 output->fBlendedColorFlags = 0; |
205 output->fWillBlendWithDst = true; | 201 output->fWillBlendWithDst = true; |
206 } | 202 } |
207 } | 203 } |
208 | 204 |
209 bool GrCoverageSetOpXPFactory::willReadDst(const GrProcOptInfo& colorPOI, | |
210 const GrProcOptInfo& coveragePOI) con
st { | |
211 return coveragePOI.readsDst(); | |
212 } | |
213 | |
214 GR_DEFINE_XP_FACTORY_TEST(GrCoverageSetOpXPFactory); | 205 GR_DEFINE_XP_FACTORY_TEST(GrCoverageSetOpXPFactory); |
215 | 206 |
216 GrXPFactory* GrCoverageSetOpXPFactory::TestCreate(SkRandom* random, | 207 GrXPFactory* GrCoverageSetOpXPFactory::TestCreate(SkRandom* random, |
217 GrContext*, | 208 GrContext*, |
218 const GrDrawTargetCaps&, | 209 const GrDrawTargetCaps&, |
219 GrTexture*[]) { | 210 GrTexture*[]) { |
220 SkRegion::Op regionOp = SkRegion::Op(random->nextULessThan(SkRegion::kLastOp
+ 1)); | 211 SkRegion::Op regionOp = SkRegion::Op(random->nextULessThan(SkRegion::kLastOp
+ 1)); |
221 bool invertCoverage = random->nextBool(); | 212 bool invertCoverage = random->nextBool(); |
222 return GrCoverageSetOpXPFactory::Create(regionOp, invertCoverage); | 213 return GrCoverageSetOpXPFactory::Create(regionOp, invertCoverage); |
223 } | 214 } |
224 | 215 |
OLD | NEW |