OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 GrCustomXfermodePriv_DEFINED | 8 #ifndef GrCustomXfermodePriv_DEFINED |
9 #define GrCustomXfermodePriv_DEFINED | 9 #define GrCustomXfermodePriv_DEFINED |
10 | 10 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 GrCustomXPFactory(SkXfermode::Mode mode); | 61 GrCustomXPFactory(SkXfermode::Mode mode); |
62 | 62 |
63 bool supportsRGBCoverage(GrColor knownColor, uint32_t knownColorFlags) const
override { | 63 bool supportsRGBCoverage(GrColor knownColor, uint32_t knownColorFlags) const
override { |
64 return true; | 64 return true; |
65 } | 65 } |
66 | 66 |
67 bool canTweakAlphaForCoverage() const override { | 67 bool canTweakAlphaForCoverage() const override { |
68 return false; | 68 return false; |
69 } | 69 } |
70 | 70 |
| 71 bool willBlendCoherently(const GrDrawTargetCaps& caps) const override { |
| 72 return true; |
| 73 } |
| 74 |
71 void getInvariantOutput(const GrProcOptInfo& colorPOI, const GrProcOptInfo&
coveragePOI, | 75 void getInvariantOutput(const GrProcOptInfo& colorPOI, const GrProcOptInfo&
coveragePOI, |
72 GrXPFactory::InvariantOutput*) const override; | 76 GrXPFactory::InvariantOutput*) const override; |
73 | 77 |
74 private: | 78 private: |
75 GrXferProcessor* onCreateXferProcessor(const GrDrawTargetCaps& caps, | 79 GrXferProcessor* onCreateXferProcessor(const GrDrawTargetCaps& caps, |
76 const GrProcOptInfo& colorPOI, | 80 const GrProcOptInfo& colorPOI, |
77 const GrProcOptInfo& coveragePOI, | 81 const GrProcOptInfo& coveragePOI, |
78 const GrDeviceCoordTexture* dstCopy)
const override; | 82 const GrDeviceCoordTexture* dstCopy)
const override; |
79 | 83 |
80 bool willReadDstColor(const GrDrawTargetCaps& caps, | 84 bool willReadDstColor(const GrDrawTargetCaps& caps, |
81 const GrProcOptInfo& colorPOI, | 85 const GrProcOptInfo& colorPOI, |
82 const GrProcOptInfo& coveragePOI) const override { | 86 const GrProcOptInfo& coveragePOI) const override { |
83 return true; | 87 return true; |
84 } | 88 } |
85 | 89 |
86 bool onIsEqual(const GrXPFactory& xpfBase) const override { | 90 bool onIsEqual(const GrXPFactory& xpfBase) const override { |
87 const GrCustomXPFactory& xpf = xpfBase.cast<GrCustomXPFactory>(); | 91 const GrCustomXPFactory& xpf = xpfBase.cast<GrCustomXPFactory>(); |
88 return fMode == xpf.fMode; | 92 return fMode == xpf.fMode; |
89 } | 93 } |
90 | 94 |
91 GR_DECLARE_XP_FACTORY_TEST; | 95 GR_DECLARE_XP_FACTORY_TEST; |
92 | 96 |
93 SkXfermode::Mode fMode; | 97 SkXfermode::Mode fMode; |
94 | 98 |
95 typedef GrXPFactory INHERITED; | 99 typedef GrXPFactory INHERITED; |
96 }; | 100 }; |
97 #endif | 101 #endif |
98 | 102 |
OLD | NEW |