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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 LocalCoords(Type type) : fType(type), fMatrix(nullptr) {} | 108 LocalCoords(Type type) : fType(type), fMatrix(nullptr) {} |
109 LocalCoords(Type type, const SkMatrix* matrix) : fType(type), fMatrix(ma
trix) { | 109 LocalCoords(Type type, const SkMatrix* matrix) : fType(type), fMatrix(ma
trix) { |
110 SkASSERT(kUnused_Type != type); | 110 SkASSERT(kUnused_Type != type); |
111 } | 111 } |
112 bool hasLocalMatrix() const { return nullptr != fMatrix; } | 112 bool hasLocalMatrix() const { return nullptr != fMatrix; } |
113 | 113 |
114 Type fType; | 114 Type fType; |
115 const SkMatrix* fMatrix; | 115 const SkMatrix* fMatrix; |
116 }; | 116 }; |
117 | 117 |
118 const GrGeometryProcessor* Create(const Color&, | 118 sk_sp<GrGeometryProcessor> Make(const Color&, |
119 const Coverage&, | 119 const Coverage&, |
120 const LocalCoords&, | 120 const LocalCoords&, |
121 const SkMatrix& viewMatrix); | 121 const SkMatrix& viewMatrix); |
122 | 122 |
123 /* | 123 /* |
124 * Use this factory to create a GrGeometryProcessor that expects a device sp
ace vertex position | 124 * Use this factory to create a GrGeometryProcessor that expects a device sp
ace vertex position |
125 * attribute. The view matrix must still be provided to compute correctly tr
ansformed | 125 * attribute. The view matrix must still be provided to compute correctly tr
ansformed |
126 * coordinates for GrFragmentProcessors. It may fail if the view matrix is n
ot invertible. | 126 * coordinates for GrFragmentProcessors. It may fail if the view matrix is n
ot invertible. |
127 */ | 127 */ |
128 const GrGeometryProcessor* CreateForDeviceSpace(const Color&, | 128 sk_sp<GrGeometryProcessor> MakeForDeviceSpace(const Color&, |
129 const Coverage&, | 129 const Coverage&, |
130 const LocalCoords&, | 130 const LocalCoords&, |
131 const SkMatrix& viewMatrix); | 131 const SkMatrix& viewMatrix); |
132 | 132 |
133 inline size_t DefaultVertexStride() { return sizeof(PositionAttr); } | 133 inline size_t DefaultVertexStride() { return sizeof(PositionAttr); } |
134 }; | 134 }; |
135 | 135 |
136 #endif | 136 #endif |
OLD | NEW |