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 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 GrBlendCoeff fSrcBlend; | 46 GrBlendCoeff fSrcBlend; |
47 GrBlendCoeff fDstBlend; | 47 GrBlendCoeff fDstBlend; |
48 | 48 |
49 typedef GrXferProcessor INHERITED; | 49 typedef GrXferProcessor INHERITED; |
50 }; | 50 }; |
51 | 51 |
52 /////////////////////////////////////////////////////////////////////////////// | 52 /////////////////////////////////////////////////////////////////////////////// |
53 | 53 |
54 class GrPorterDuffXPFactory : public GrXPFactory { | 54 class GrPorterDuffXPFactory : public GrXPFactory { |
55 public: | 55 public: |
| 56 static GrXPFactory* Create(SkXfermode::Mode mode); |
| 57 |
56 static GrXPFactory* Create(SkXfermode::Coeff src, SkXfermode::Coeff dst) { | 58 static GrXPFactory* Create(SkXfermode::Coeff src, SkXfermode::Coeff dst) { |
57 return SkNEW_ARGS(GrPorterDuffXPFactory, ((GrBlendCoeff)(src), (GrBlendC
oeff)(dst))); | 59 return SkNEW_ARGS(GrPorterDuffXPFactory, ((GrBlendCoeff)(src), (GrBlendC
oeff)(dst))); |
58 } | 60 } |
59 | 61 |
60 static GrXPFactory* Create(GrBlendCoeff src, GrBlendCoeff dst) { | 62 static GrXPFactory* Create(GrBlendCoeff src, GrBlendCoeff dst) { |
61 return SkNEW_ARGS(GrPorterDuffXPFactory, (src, dst)); | 63 return SkNEW_ARGS(GrPorterDuffXPFactory, (src, dst)); |
62 } | 64 } |
63 | 65 |
64 const GrXferProcessor* createXferProcessor() const SK_OVERRIDE; | 66 const GrXferProcessor* createXferProcessor() const SK_OVERRIDE; |
65 | 67 |
66 bool supportsRGBCoverage(GrColor knownColor, uint32_t knownColorFlags) const
SK_OVERRIDE; | 68 bool supportsRGBCoverage(GrColor knownColor, uint32_t knownColorFlags) const
SK_OVERRIDE; |
67 | 69 |
68 private: | 70 private: |
69 GrPorterDuffXPFactory(GrBlendCoeff src, GrBlendCoeff dst) | 71 GrPorterDuffXPFactory(GrBlendCoeff src, GrBlendCoeff dst) |
70 : fSrc(src), fDst(dst) {} | 72 : fSrc(src), fDst(dst) {} |
71 | 73 |
72 GrBlendCoeff fSrc; | 74 GrBlendCoeff fSrc; |
73 GrBlendCoeff fDst; | 75 GrBlendCoeff fDst; |
74 | 76 |
75 typedef GrXPFactory INHERITED; | 77 typedef GrXPFactory INHERITED; |
76 }; | 78 }; |
77 | 79 |
78 #endif | 80 #endif |
OLD | NEW |