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 GrDefaultGeoProcFactory_DEFINED | 8 #ifndef GrDefaultGeoProcFactory_DEFINED |
9 #define GrDefaultGeoProcFactory_DEFINED | 9 #define GrDefaultGeoProcFactory_DEFINED |
10 | 10 |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
120 } | 120 } |
121 bool hasLocalMatrix() const { return NULL != fMatrix; } | 121 bool hasLocalMatrix() const { return NULL != fMatrix; } |
122 | 122 |
123 Type fType; | 123 Type fType; |
124 const SkMatrix* fMatrix; | 124 const SkMatrix* fMatrix; |
125 }; | 125 }; |
126 | 126 |
127 const GrGeometryProcessor* Create(const Color&, | 127 const GrGeometryProcessor* Create(const Color&, |
128 const Coverage&, | 128 const Coverage&, |
129 const LocalCoords&, | 129 const LocalCoords&, |
130 const SkMatrix& viewMatrix = SkMatrix::I() ); | 130 const SkMatrix& viewMatrix); |
131 | 131 |
132 /* | 132 /* |
133 * Use this factory to create a GrGeometryProcessor that expects a device sp ace vertex position | 133 * Use this factory to create a GrGeometryProcessor that expects a device sp ace vertex position |
134 * attribute. The view matrix must still be provided to compute correctly tr ansformed | 134 * attribute. The view matrix must still be provided to compute correctly tr ansformed |
135 * coordinates for GrFragmentProcessors. It may fail if the view matrix is n ot invertible. | 135 * coordinates for GrFragmentProcessors. It may fail if the view matrix is n ot invertible. |
136 */ | 136 */ |
137 const GrGeometryProcessor* CreateForDeviceSpace(const Color&, | 137 const GrGeometryProcessor* CreateForDeviceSpace(const Color&, |
138 const Coverage&, | 138 const Coverage&, |
139 const LocalCoords&, | 139 const LocalCoords&, |
140 const SkMatrix& viewMatrix); | 140 const SkMatrix& viewMatrix); |
141 | 141 |
142 // TODO deprecate this | 142 /* |
143 const GrGeometryProcessor* Create(uint32_t gpTypeFlags, | 143 * This factory is for the very specific, but common use case, of drawing in device space but |
144 GrColor, | 144 * also wanting to tweak alpha for coverage if possible. This use case also assumes vertex |
145 bool localCoordsWillBeRead, | 145 * color |
146 bool coverageWillBeIgnored, | 146 */ |
147 const SkMatrix& viewMatrix = SkMatrix::I() , | 147 const GrGeometryProcessor* CreateForDeviceSpaceAlphaTweakIfPossible(const Sk Matrix& viewMatrix, |
bsalomon
2015/07/29 19:43:54
Head spinning, what if I set coverageIgnored and t
| |
148 const SkMatrix& localMatrix = SkMatrix::I( ), | 148 bool use sLocalCoords, |
149 uint8_t coverage = 0xff); | 149 bool cov erageIgnored, |
150 bool twe akAlphaForCoverage); | |
150 | 151 |
151 inline size_t DefaultVertexStride() { return sizeof(PositionAttr); } | 152 inline size_t DefaultVertexStride() { return sizeof(PositionAttr); } |
152 }; | 153 }; |
153 | 154 |
154 #endif | 155 #endif |
OLD | NEW |