| 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
override; | 21 bool supportsRGBCoverage(GrColor /*knownColor*/, uint32_t /*knownColorFlags*
/) const override { |
| 22 return true; |
| 23 } |
| 22 | 24 |
| 23 void getInvariantBlendedColor(const GrProcOptInfo& colorPOI, | 25 void getInvariantBlendedColor(const GrProcOptInfo& colorPOI, |
| 24 GrXPFactory::InvariantBlendedColor*) const ove
rride; | 26 GrXPFactory::InvariantBlendedColor*) const ove
rride; |
| 25 | 27 |
| 26 private: | 28 private: |
| 27 GrPorterDuffXPFactory(SkXfermode::Mode); | 29 GrPorterDuffXPFactory(SkXfermode::Mode); |
| 28 | 30 |
| 29 GrXferProcessor* onCreateXferProcessor(const GrCaps& caps, | 31 GrXferProcessor* onCreateXferProcessor(const GrCaps& caps, |
| 30 const GrProcOptInfo& colorPOI, | 32 const GrProcOptInfo& colorPOI, |
| 31 const GrProcOptInfo& coveragePOI, | 33 const GrProcOptInfo& coveragePOI, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 45 GR_DECLARE_XP_FACTORY_TEST; | 47 GR_DECLARE_XP_FACTORY_TEST; |
| 46 static void TestGetXPOutputTypes(const GrXferProcessor*, int* outPrimary, in
t* outSecondary); | 48 static void TestGetXPOutputTypes(const GrXferProcessor*, int* outPrimary, in
t* outSecondary); |
| 47 | 49 |
| 48 SkXfermode::Mode fXfermode; | 50 SkXfermode::Mode fXfermode; |
| 49 | 51 |
| 50 friend class GrPorterDuffTest; // for TestGetXPOutputTypes() | 52 friend class GrPorterDuffTest; // for TestGetXPOutputTypes() |
| 51 typedef GrXPFactory INHERITED; | 53 typedef GrXPFactory INHERITED; |
| 52 }; | 54 }; |
| 53 | 55 |
| 54 #endif | 56 #endif |
| OLD | NEW |