| 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" |
| 11 #include "GrDrawTargetCaps.h" | 11 #include "GrDrawTargetCaps.h" |
| 12 #include "GrProcessor.h" | 12 #include "GrProcessor.h" |
| 13 #include "GrProcOptInfo.h" | 13 #include "GrProcOptInfo.h" |
| 14 #include "gl/GrGLXferProcessor.h" | 14 #include "gl/GrGLXferProcessor.h" |
| 15 #include "gl/builders/GrGLFragmentShaderBuilder.h" | 15 #include "gl/builders/GrGLFragmentShaderBuilder.h" |
| 16 #include "gl/builders/GrGLProgramBuilder.h" | 16 #include "gl/builders/GrGLProgramBuilder.h" |
| 17 | 17 |
| 18 /** | |
| 19 * This xfer processor directly blends the the src coverage with the dst using a
set operator. It is | |
| 20 * useful for rendering coverage masks using CSG. It can optionally invert the s
rc coverage before | |
| 21 * applying the set operator. | |
| 22 * */ | |
| 23 class CoverageSetOpXP : public GrXferProcessor { | 18 class CoverageSetOpXP : public GrXferProcessor { |
| 24 public: | 19 public: |
| 25 static GrXferProcessor* Create(SkRegion::Op regionOp, bool invertCoverage) { | 20 static GrXferProcessor* Create(SkRegion::Op regionOp, bool invertCoverage) { |
| 26 return SkNEW_ARGS(CoverageSetOpXP, (regionOp, invertCoverage)); | 21 return SkNEW_ARGS(CoverageSetOpXP, (regionOp, invertCoverage)); |
| 27 } | 22 } |
| 28 | 23 |
| 29 ~CoverageSetOpXP() SK_OVERRIDE; | 24 ~CoverageSetOpXP() SK_OVERRIDE; |
| 30 | 25 |
| 31 const char* name() const SK_OVERRIDE { return "Coverage Set Op"; } | 26 const char* name() const SK_OVERRIDE { return "Coverage Set Op"; } |
| 32 | 27 |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 | 251 |
| 257 GrXPFactory* GrCoverageSetOpXPFactory::TestCreate(SkRandom* random, | 252 GrXPFactory* GrCoverageSetOpXPFactory::TestCreate(SkRandom* random, |
| 258 GrContext*, | 253 GrContext*, |
| 259 const GrDrawTargetCaps&, | 254 const GrDrawTargetCaps&, |
| 260 GrTexture*[]) { | 255 GrTexture*[]) { |
| 261 SkRegion::Op regionOp = SkRegion::Op(random->nextULessThan(SkRegion::kLastOp
+ 1)); | 256 SkRegion::Op regionOp = SkRegion::Op(random->nextULessThan(SkRegion::kLastOp
+ 1)); |
| 262 bool invertCoverage = random->nextBool(); | 257 bool invertCoverage = random->nextBool(); |
| 263 return GrCoverageSetOpXPFactory::Create(regionOp, invertCoverage); | 258 return GrCoverageSetOpXPFactory::Create(regionOp, invertCoverage); |
| 264 } | 259 } |
| 265 | 260 |
| OLD | NEW |