| 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 bool supportsRGBCoverage(GrColor knownColor, uint32_t knownColorFlags) const
SK_OVERRIDE; | 21 bool supportsRGBCoverage(GrColor knownColor, uint32_t knownColorFlags) const
override; |
| 22 | 22 |
| 23 bool canTweakAlphaForCoverage() const SK_OVERRIDE; | 23 bool canTweakAlphaForCoverage() const override; |
| 24 | 24 |
| 25 void getInvariantOutput(const GrProcOptInfo& colorPOI, const GrProcOptInfo&
coveragePOI, | 25 void getInvariantOutput(const GrProcOptInfo& colorPOI, const GrProcOptInfo&
coveragePOI, |
| 26 GrXPFactory::InvariantOutput*) const SK_OVERRIDE; | 26 GrXPFactory::InvariantOutput*) const override; |
| 27 | 27 |
| 28 private: | 28 private: |
| 29 GrPorterDuffXPFactory(GrBlendCoeff src, GrBlendCoeff dst); | 29 GrPorterDuffXPFactory(GrBlendCoeff src, GrBlendCoeff dst); |
| 30 | 30 |
| 31 GrXferProcessor* onCreateXferProcessor(const GrDrawTargetCaps& caps, | 31 GrXferProcessor* onCreateXferProcessor(const GrDrawTargetCaps& caps, |
| 32 const GrProcOptInfo& colorPOI, | 32 const GrProcOptInfo& colorPOI, |
| 33 const GrProcOptInfo& coveragePOI, | 33 const GrProcOptInfo& coveragePOI, |
| 34 const GrDeviceCoordTexture* dstCopy)
const SK_OVERRIDE; | 34 const GrDeviceCoordTexture* dstCopy)
const override; |
| 35 | 35 |
| 36 bool willReadDstColor(const GrDrawTargetCaps& caps, | 36 bool willReadDstColor(const GrDrawTargetCaps& caps, |
| 37 const GrProcOptInfo& colorPOI, | 37 const GrProcOptInfo& colorPOI, |
| 38 const GrProcOptInfo& coveragePOI) const SK_OVERRIDE; | 38 const GrProcOptInfo& coveragePOI) const override; |
| 39 | 39 |
| 40 bool onIsEqual(const GrXPFactory& xpfBase) const SK_OVERRIDE { | 40 bool onIsEqual(const GrXPFactory& xpfBase) const override { |
| 41 const GrPorterDuffXPFactory& xpf = xpfBase.cast<GrPorterDuffXPFactory>()
; | 41 const GrPorterDuffXPFactory& xpf = xpfBase.cast<GrPorterDuffXPFactory>()
; |
| 42 return (fSrcCoeff == xpf.fSrcCoeff && fDstCoeff == xpf.fDstCoeff); | 42 return (fSrcCoeff == xpf.fSrcCoeff && fDstCoeff == xpf.fDstCoeff); |
| 43 } | 43 } |
| 44 | 44 |
| 45 GR_DECLARE_XP_FACTORY_TEST; | 45 GR_DECLARE_XP_FACTORY_TEST; |
| 46 | 46 |
| 47 GrBlendCoeff fSrcCoeff; | 47 GrBlendCoeff fSrcCoeff; |
| 48 GrBlendCoeff fDstCoeff; | 48 GrBlendCoeff fDstCoeff; |
| 49 | 49 |
| 50 typedef GrXPFactory INHERITED; | 50 typedef GrXPFactory INHERITED; |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 #endif | 53 #endif |
| OLD | NEW |