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 GrXferProcessor_DEFINED | 8 #ifndef GrXferProcessor_DEFINED |
9 #define GrXferProcessor_DEFINED | 9 #define GrXferProcessor_DEFINED |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... | |
36 * We install a GrXPFactory (XPF) early on in the pipeline before all the final draw information is | 36 * We install a GrXPFactory (XPF) early on in the pipeline before all the final draw information is |
37 * known (e.g. whether there is fractional pixel coverage, will coverage be 1 or 4 channel, is the | 37 * known (e.g. whether there is fractional pixel coverage, will coverage be 1 or 4 channel, is the |
38 * draw opaque, etc.). Once the state of the draw is finalized, we use the XPF a long with all the | 38 * draw opaque, etc.). Once the state of the draw is finalized, we use the XPF a long with all the |
39 * draw information to create a GrXferProcessor (XP) which can implement the des ired blending for | 39 * draw information to create a GrXferProcessor (XP) which can implement the des ired blending for |
40 * the draw. | 40 * the draw. |
41 * | 41 * |
42 * Before the XP is created, the XPF is able to answer queries about what functi onality the XPs it | 42 * Before the XP is created, the XPF is able to answer queries about what functi onality the XPs it |
43 * creates will have. For example, will the XP support RGB coverage or will the XP blend with the | 43 * creates will have. For example, will the XP support RGB coverage or will the XP blend with the |
44 * destination color. | 44 * destination color. |
45 */ | 45 */ |
46 class GrXPFactory : public GrProgramElement { | 46 class GrXPFactory : public SkRefCnt { |
47 public: | 47 public: |
48 virtual const GrXferProcessor* createXferProcessor() const = 0; | 48 virtual const GrXferProcessor* createXferProcessor() const = 0; |
49 | 49 |
50 /** | 50 /** |
51 * This function returns true if the GrXferProcessor generated from this fac tory will be able to | 51 * This function returns true if the GrXferProcessor generated from this fac tory will be able to |
52 * correctly blend when using RGB coverage. The knownColor and knownColorFla gs represent the | 52 * correctly blend when using RGB coverage. The knownColor and knownColorFla gs represent the |
53 * final computed color from the color stages. | 53 * final computed color from the color stages. |
54 */ | 54 */ |
55 virtual bool supportsRGBCoverage(GrColor knownColor, uint32_t knownColorFlag s) const = 0; | 55 virtual bool supportsRGBCoverage(GrColor knownColor, uint32_t knownColorFlag s) const = 0; |
56 | 56 |
57 private: | 57 private: |
58 typedef GrProgramElement INHERITED; | 58 typedef GrProgramElement INHERITED; |
59 }; | 59 }; |
60 | 60 |
61 #define GR_CREATE_STATIC_XP_FACTORY(NAME, XPF_CLASS, ARGS) \ | |
bsalomon
2014/12/03 17:44:56
Do you need this? Do they have to be created on th
egdaniel
2014/12/03 18:12:35
switched off heap and removed macro
| |
62 static XPF_CLASS* NAME = SkNEW_ARGS(XPF_CLASS, ARGS) | |
63 | |
61 #endif | 64 #endif |
62 | 65 |
OLD | NEW |