| 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 GrPorterDuffXferProcessor_DEFINED | 8 #ifndef GrPorterDuffXferProcessor_DEFINED |
| 9 #define GrPorterDuffXferProcessor_DEFINED | 9 #define GrPorterDuffXferProcessor_DEFINED |
| 10 | 10 |
| 11 #include "GrTypes.h" | 11 #include "GrTypes.h" |
| 12 #include "GrXferProcessor.h" | 12 #include "GrXferProcessor.h" |
| 13 #include "SkXfermode.h" | 13 #include "SkXfermode.h" |
| 14 | 14 |
| 15 class GrProcOptInfo; | 15 class GrProcOptInfo; |
| 16 | 16 |
| 17 class GrPorterDuffXPFactory : public GrXPFactory { | 17 class GrPorterDuffXPFactory : public GrXPFactory { |
| 18 public: | 18 public: |
| 19 static GrXPFactory* Create(SkXfermode::Mode mode); | 19 static GrXPFactory* Create(SkXfermode::Mode mode); |
| 20 | 20 |
| 21 static GrXPFactory* Create(SkXfermode::Coeff src, SkXfermode::Coeff dst) { | 21 static GrXPFactory* Create(SkXfermode::Coeff src, SkXfermode::Coeff dst) { |
| 22 return SkNEW_ARGS(GrPorterDuffXPFactory, ((GrBlendCoeff)(src), (GrBlendC
oeff)(dst))); | 22 return SkNEW_ARGS(GrPorterDuffXPFactory, ((GrBlendCoeff)(src), (GrBlendC
oeff)(dst))); |
| 23 } | 23 } |
| 24 | 24 |
| 25 static GrXPFactory* Create(GrBlendCoeff src, GrBlendCoeff dst) { | |
| 26 return SkNEW_ARGS(GrPorterDuffXPFactory, (src, dst)); | |
| 27 } | |
| 28 | |
| 29 bool supportsRGBCoverage(GrColor knownColor, uint32_t knownColorFlags) const
SK_OVERRIDE; | 25 bool supportsRGBCoverage(GrColor knownColor, uint32_t knownColorFlags) const
SK_OVERRIDE; |
| 30 | 26 |
| 31 bool canApplyCoverage(const GrProcOptInfo& colorPOI, | 27 bool canApplyCoverage(const GrProcOptInfo& colorPOI, |
| 32 const GrProcOptInfo& coveragePOI) const SK_OVERRIDE; | 28 const GrProcOptInfo& coveragePOI) const SK_OVERRIDE; |
| 33 | 29 |
| 34 bool canTweakAlphaForCoverage() const SK_OVERRIDE; | 30 bool canTweakAlphaForCoverage() const SK_OVERRIDE; |
| 35 | 31 |
| 36 void getInvariantOutput(const GrProcOptInfo& colorPOI, const GrProcOptInfo&
coveragePOI, | 32 void getInvariantOutput(const GrProcOptInfo& colorPOI, const GrProcOptInfo&
coveragePOI, |
| 37 GrXPFactory::InvariantOutput*) const SK_OVERRIDE; | 33 GrXPFactory::InvariantOutput*) const SK_OVERRIDE; |
| 38 | 34 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 53 | 49 |
| 54 GR_DECLARE_XP_FACTORY_TEST; | 50 GR_DECLARE_XP_FACTORY_TEST; |
| 55 | 51 |
| 56 GrBlendCoeff fSrcCoeff; | 52 GrBlendCoeff fSrcCoeff; |
| 57 GrBlendCoeff fDstCoeff; | 53 GrBlendCoeff fDstCoeff; |
| 58 | 54 |
| 59 typedef GrXPFactory INHERITED; | 55 typedef GrXPFactory INHERITED; |
| 60 }; | 56 }; |
| 61 | 57 |
| 62 #endif | 58 #endif |
| OLD | NEW |