| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 | 122 |
| 123 fColorStages = paint.fColorStages; | 123 fColorStages = paint.fColorStages; |
| 124 fCoverageStages = paint.fCoverageStages; | 124 fCoverageStages = paint.fCoverageStages; |
| 125 | 125 |
| 126 fXPFactory.reset(SkRef(paint.getXPFactory())); | 126 fXPFactory.reset(SkRef(paint.getXPFactory())); |
| 127 | 127 |
| 128 return *this; | 128 return *this; |
| 129 } | 129 } |
| 130 | 130 |
| 131 /** | 131 /** |
| 132 * Returns true if isOpaque would return true and the paint represents a sol
id constant color | 132 * Returns true if the paint's output color will be constant after blending.
If the result is |
| 133 * draw. If the result is true, constantColor will be updated to contain the
constant color. | 133 * true, constantColor will be updated to contain the constant color. Note t
hat we can conflate |
| 134 * coverage and color, so the actual values written to pixels with partial c
overage may still |
| 135 * not seem constant, even if this function returns true. |
| 134 */ | 136 */ |
| 135 bool isOpaqueAndConstantColor(GrColor* constantColor) const; | 137 bool isConstantBlendedColor(GrColor* constantColor) const; |
| 136 | 138 |
| 137 private: | 139 private: |
| 138 mutable SkAutoTUnref<const GrXPFactory> fXPFactory; | 140 mutable SkAutoTUnref<const GrXPFactory> fXPFactory; |
| 139 SkSTArray<4, GrFragmentStage> fColorStages; | 141 SkSTArray<4, GrFragmentStage> fColorStages; |
| 140 SkSTArray<2, GrFragmentStage> fCoverageStages; | 142 SkSTArray<2, GrFragmentStage> fCoverageStages; |
| 141 | 143 |
| 142 bool fAntiAlias; | 144 bool fAntiAlias; |
| 143 bool fDither; | 145 bool fDither; |
| 144 | 146 |
| 145 GrColor fColor; | 147 GrColor fColor; |
| 146 }; | 148 }; |
| 147 | 149 |
| 148 #endif | 150 #endif |
| OLD | NEW |