| 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 #ifndef GrCoverageSetOpXP_DEFINED | 8 #ifndef GrCoverageSetOpXP_DEFINED |
| 9 #define GrCoverageSetOpXP_DEFINED | 9 #define GrCoverageSetOpXP_DEFINED |
| 10 | 10 |
| 11 #include "GrTypes.h" | 11 #include "GrTypes.h" |
| 12 #include "GrXferProcessor.h" | 12 #include "GrXferProcessor.h" |
| 13 #include "SkRegion.h" | 13 #include "SkRegion.h" |
| 14 | 14 |
| 15 class GrProcOptInfo; | 15 class GrProcOptInfo; |
| 16 | 16 |
| 17 /** | 17 /** |
| 18 * This xfer processor directly blends the the src coverage with the dst using a
set operator. It is | 18 * This xfer processor directly blends the the src coverage with the dst using a
set operator. It is |
| 19 * useful for rendering coverage masks using CSG. It can optionally invert the s
rc coverage before | 19 * useful for rendering coverage masks using CSG. It can optionally invert the s
rc coverage before |
| 20 * applying the set operator. | 20 * applying the set operator. |
| 21 */ | 21 */ |
| 22 class GrCoverageSetOpXPFactory : public GrXPFactory { | 22 class GrCoverageSetOpXPFactory : public GrXPFactory { |
| 23 public: | 23 public: |
| 24 static GrXPFactory* Create(SkRegion::Op regionOp, bool invertCoverage = fals
e); | 24 static sk_sp<GrXPFactory> Make(SkRegion::Op regionOp, bool invertCoverage =
false); |
| 25 | 25 |
| 26 void getInvariantBlendedColor(const GrProcOptInfo& colorPOI, | 26 void getInvariantBlendedColor(const GrProcOptInfo& colorPOI, |
| 27 GrXPFactory::InvariantBlendedColor*) const ove
rride; | 27 GrXPFactory::InvariantBlendedColor*) const ove
rride; |
| 28 | 28 |
| 29 private: | 29 private: |
| 30 GrCoverageSetOpXPFactory(SkRegion::Op regionOp, bool invertCoverage); | 30 GrCoverageSetOpXPFactory(SkRegion::Op regionOp, bool invertCoverage); |
| 31 | 31 |
| 32 GrXferProcessor* onCreateXferProcessor(const GrCaps& caps, | 32 GrXferProcessor* onCreateXferProcessor(const GrCaps& caps, |
| 33 const GrPipelineOptimizations& optimi
zations, | 33 const GrPipelineOptimizations& optimi
zations, |
| 34 bool hasMixedSamples, | 34 bool hasMixedSamples, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 45 | 45 |
| 46 GR_DECLARE_XP_FACTORY_TEST; | 46 GR_DECLARE_XP_FACTORY_TEST; |
| 47 | 47 |
| 48 SkRegion::Op fRegionOp; | 48 SkRegion::Op fRegionOp; |
| 49 bool fInvertCoverage; | 49 bool fInvertCoverage; |
| 50 | 50 |
| 51 typedef GrXPFactory INHERITED; | 51 typedef GrXPFactory INHERITED; |
| 52 }; | 52 }; |
| 53 #endif | 53 #endif |
| 54 | 54 |
| OLD | NEW |