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 GrDisableColorXP_DEFINED | 8 #ifndef GrDisableColorXP_DEFINED |
9 #define GrDisableColorXP_DEFINED | 9 #define GrDisableColorXP_DEFINED |
10 | 10 |
11 #include "GrTypes.h" | 11 #include "GrTypes.h" |
12 #include "GrXferProcessor.h" | 12 #include "GrXferProcessor.h" |
13 | 13 |
14 class GrProcOptInfo; | 14 class GrProcOptInfo; |
15 | 15 |
16 class GrDisableColorXPFactory : public GrXPFactory { | 16 class GrDisableColorXPFactory : public GrXPFactory { |
17 public: | 17 public: |
18 static GrXPFactory* Create() { | 18 static GrXPFactory* Create() { |
19 return SkNEW(GrDisableColorXPFactory); | 19 return SkNEW(GrDisableColorXPFactory); |
20 } | 20 } |
21 | 21 |
22 bool supportsRGBCoverage(GrColor knownColor, uint32_t knownColorFlags) const
SK_OVERRIDE { | 22 bool supportsRGBCoverage(GrColor knownColor, uint32_t knownColorFlags) const
override { |
23 return true; | 23 return true; |
24 } | 24 } |
25 | 25 |
26 bool canTweakAlphaForCoverage() const SK_OVERRIDE { return true; } | 26 bool canTweakAlphaForCoverage() const override { return true; } |
27 | 27 |
28 void getInvariantOutput(const GrProcOptInfo& colorPOI, const GrProcOptInfo&
coveragePOI, | 28 void getInvariantOutput(const GrProcOptInfo& colorPOI, const GrProcOptInfo&
coveragePOI, |
29 GrXPFactory::InvariantOutput* output) const SK_OVERR
IDE { | 29 GrXPFactory::InvariantOutput* output) const override
{ |
30 output->fBlendedColorFlags = 0; | 30 output->fBlendedColorFlags = 0; |
31 output->fWillBlendWithDst = 0; | 31 output->fWillBlendWithDst = 0; |
32 } | 32 } |
33 | 33 |
34 private: | 34 private: |
35 GrDisableColorXPFactory(); | 35 GrDisableColorXPFactory(); |
36 | 36 |
37 GrXferProcessor* onCreateXferProcessor(const GrDrawTargetCaps& caps, | 37 GrXferProcessor* onCreateXferProcessor(const GrDrawTargetCaps& caps, |
38 const GrProcOptInfo& colorPOI, | 38 const GrProcOptInfo& colorPOI, |
39 const GrProcOptInfo& coveragePOI, | 39 const GrProcOptInfo& coveragePOI, |
40 const GrDeviceCoordTexture* dstCopy)
const SK_OVERRIDE; | 40 const GrDeviceCoordTexture* dstCopy)
const override; |
41 | 41 |
42 bool willReadDstColor(const GrDrawTargetCaps& caps, | 42 bool willReadDstColor(const GrDrawTargetCaps& caps, |
43 const GrProcOptInfo& colorPOI, | 43 const GrProcOptInfo& colorPOI, |
44 const GrProcOptInfo& coveragePOI) const SK_OVERRIDE { | 44 const GrProcOptInfo& coveragePOI) const override { |
45 return false; | 45 return false; |
46 } | 46 } |
47 | 47 |
48 bool onIsEqual(const GrXPFactory& xpfBase) const SK_OVERRIDE { | 48 bool onIsEqual(const GrXPFactory& xpfBase) const override { |
49 return true; | 49 return true; |
50 } | 50 } |
51 | 51 |
52 GR_DECLARE_XP_FACTORY_TEST; | 52 GR_DECLARE_XP_FACTORY_TEST; |
53 | 53 |
54 typedef GrXPFactory INHERITED; | 54 typedef GrXPFactory INHERITED; |
55 }; | 55 }; |
56 | 56 |
57 #endif | 57 #endif |
58 | 58 |
OLD | NEW |