OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #ifndef GrPaint_DEFINED | 10 #ifndef GrPaint_DEFINED |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 GrPaint& operator=(const GrPaint& paint) { | 118 GrPaint& operator=(const GrPaint& paint) { |
119 fAntiAlias = paint.fAntiAlias; | 119 fAntiAlias = paint.fAntiAlias; |
120 fDither = paint.fDither; | 120 fDither = paint.fDither; |
121 | 121 |
122 fColor = paint.fColor; | 122 fColor = paint.fColor; |
123 | 123 |
124 fColorStages = paint.fColorStages; | 124 fColorStages = paint.fColorStages; |
125 fCoverageStages = paint.fCoverageStages; | 125 fCoverageStages = paint.fCoverageStages; |
126 | 126 |
127 fXPFactory.reset(SkRef(paint.getXPFactory())); | 127 fXPFactory.reset(SkRef(paint.getXPFactory())); |
| 128 fProcDataManager.reset(SkNEW_ARGS(GrProcessorDataManager, (*paint.proces
sorDataManager()))); |
128 | 129 |
129 return *this; | 130 return *this; |
130 } | 131 } |
131 | 132 |
132 /** | 133 /** |
133 * Returns true if the paint's output color will be constant after blending.
If the result is | 134 * Returns true if the paint's output color will be constant after blending.
If the result is |
134 * true, constantColor will be updated to contain the constant color. Note t
hat we can conflate | 135 * true, constantColor will be updated to contain the constant color. Note t
hat we can conflate |
135 * coverage and color, so the actual values written to pixels with partial c
overage may still | 136 * coverage and color, so the actual values written to pixels with partial c
overage may still |
136 * not seem constant, even if this function returns true. | 137 * not seem constant, even if this function returns true. |
137 */ | 138 */ |
138 bool isConstantBlendedColor(GrColor* constantColor) const; | 139 bool isConstantBlendedColor(GrColor* constantColor) const; |
139 | 140 |
140 GrProcessorDataManager* getProcessorDataManager() { return &fProcDataManager
; } | 141 GrProcessorDataManager* getProcessorDataManager() { return fProcDataManager.
get(); } |
| 142 |
| 143 const GrProcessorDataManager* processorDataManager() const { return fProcDat
aManager.get(); } |
141 | 144 |
142 private: | 145 private: |
143 mutable SkAutoTUnref<const GrXPFactory> fXPFactory; | 146 mutable SkAutoTUnref<const GrXPFactory> fXPFactory; |
144 SkSTArray<4, GrFragmentStage> fColorStages; | 147 SkSTArray<4, GrFragmentStage> fColorStages; |
145 SkSTArray<2, GrFragmentStage> fCoverageStages; | 148 SkSTArray<2, GrFragmentStage> fCoverageStages; |
146 | 149 |
147 bool fAntiAlias; | 150 bool fAntiAlias; |
148 bool fDither; | 151 bool fDither; |
149 | 152 |
150 GrColor fColor; | 153 GrColor fColor; |
151 GrProcessorDataManager fProcDataManager; | 154 SkAutoTUnref<GrProcessorDataManager> fProcDataManager; |
152 }; | 155 }; |
153 | 156 |
154 #endif | 157 #endif |
OLD | NEW |