| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "effects/GrCoverageSetOpXP.h" | 8 #include "effects/GrCoverageSetOpXP.h" |
| 9 #include "GrCaps.h" | 9 #include "GrCaps.h" |
| 10 #include "GrColor.h" | 10 #include "GrColor.h" |
| 11 #include "GrDrawContext.h" |
| 11 #include "GrPipeline.h" | 12 #include "GrPipeline.h" |
| 12 #include "GrProcessor.h" | 13 #include "GrProcessor.h" |
| 13 #include "GrProcOptInfo.h" | 14 #include "GrProcOptInfo.h" |
| 14 #include "glsl/GrGLSLBlend.h" | 15 #include "glsl/GrGLSLBlend.h" |
| 15 #include "glsl/GrGLSLFragmentShaderBuilder.h" | 16 #include "glsl/GrGLSLFragmentShaderBuilder.h" |
| 16 #include "glsl/GrGLSLUniformHandler.h" | 17 #include "glsl/GrGLSLUniformHandler.h" |
| 17 #include "glsl/GrGLSLXferProcessor.h" | 18 #include "glsl/GrGLSLXferProcessor.h" |
| 18 | 19 |
| 19 class CoverageSetOpXP : public GrXferProcessor { | 20 class CoverageSetOpXP : public GrXferProcessor { |
| 20 public: | 21 public: |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 void GrCoverageSetOpXPFactory::getInvariantBlendedColor(const GrProcOptInfo& col
orPOI, | 332 void GrCoverageSetOpXPFactory::getInvariantBlendedColor(const GrProcOptInfo& col
orPOI, |
| 332 InvariantBlendedColor* b
lendedColor) const { | 333 InvariantBlendedColor* b
lendedColor) const { |
| 333 blendedColor->fWillBlendWithDst = SkRegion::kReplace_Op != fRegionOp; | 334 blendedColor->fWillBlendWithDst = SkRegion::kReplace_Op != fRegionOp; |
| 334 blendedColor->fKnownColorFlags = kNone_GrColorComponentFlags; | 335 blendedColor->fKnownColorFlags = kNone_GrColorComponentFlags; |
| 335 } | 336 } |
| 336 | 337 |
| 337 GR_DEFINE_XP_FACTORY_TEST(GrCoverageSetOpXPFactory); | 338 GR_DEFINE_XP_FACTORY_TEST(GrCoverageSetOpXPFactory); |
| 338 | 339 |
| 339 const GrXPFactory* GrCoverageSetOpXPFactory::TestCreate(GrProcessorTestData* d)
{ | 340 const GrXPFactory* GrCoverageSetOpXPFactory::TestCreate(GrProcessorTestData* d)
{ |
| 340 SkRegion::Op regionOp = SkRegion::Op(d->fRandom->nextULessThan(SkRegion::kLa
stOp + 1)); | 341 SkRegion::Op regionOp = SkRegion::Op(d->fRandom->nextULessThan(SkRegion::kLa
stOp + 1)); |
| 341 bool invertCoverage = !d->fRenderTarget->hasMixedSamples() && d->fRandom->ne
xtBool(); | 342 bool invertCoverage = !d->fDrawContext->hasMixedSamples() && d->fRandom->nex
tBool(); |
| 342 return GrCoverageSetOpXPFactory::Create(regionOp, invertCoverage); | 343 return GrCoverageSetOpXPFactory::Create(regionOp, invertCoverage); |
| 343 } | 344 } |
| OLD | NEW |