OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 #include "SkError.h" | 8 #include "SkError.h" |
9 #include "SkErrorInternals.h" | 9 #include "SkErrorInternals.h" |
10 #include "SkLightingShader.h" | 10 #include "SkLightingShader.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 | 173 |
174 SkMatrix fInvCTM; | 174 SkMatrix fInvCTM; |
175 }; | 175 }; |
176 | 176 |
177 sk_sp<GrFragmentProcessor> NormalMapSourceImpl::asFragmentProcessor( | 177 sk_sp<GrFragmentProcessor> NormalMapSourceImpl::asFragmentProcessor( |
178 GrContext *context, | 178 GrContext *context, |
179 const SkMatrix &viewM, | 179 const SkMatrix &viewM, |
180 const SkMatrix *localMatrix
, | 180 const SkMatrix *localMatrix
, |
181 SkFilterQuality filterQuali
ty, | 181 SkFilterQuality filterQuali
ty, |
182 SkSourceGammaTreatment gamm
aTreatment) const { | 182 SkSourceGammaTreatment gamm
aTreatment) const { |
183 | |
184 sk_sp<GrFragmentProcessor> mapFP = fMapShader->asFragmentProcessor(context,
viewM, | 183 sk_sp<GrFragmentProcessor> mapFP = fMapShader->asFragmentProcessor(context,
viewM, |
185 localMatrix, filterQuality, gammaTreatment); | 184 localMatrix, filterQuality, gammaTreatment); |
186 | 185 |
187 return sk_make_sp<NormalMapFP>(std::move(mapFP), fInvCTM); | 186 return sk_make_sp<NormalMapFP>(std::move(mapFP), fInvCTM); |
188 } | 187 } |
189 | 188 |
190 #endif // SK_SUPPORT_GPU | 189 #endif // SK_SUPPORT_GPU |
191 | 190 |
192 //////////////////////////////////////////////////////////////////////////// | 191 //////////////////////////////////////////////////////////////////////////// |
193 | 192 |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 return sk_make_sp<NormalMapSourceImpl>(std::move(map), invCTM); | 312 return sk_make_sp<NormalMapSourceImpl>(std::move(map), invCTM); |
314 } | 313 } |
315 | 314 |
316 //////////////////////////////////////////////////////////////////////////// | 315 //////////////////////////////////////////////////////////////////////////// |
317 | 316 |
318 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkNormalSource) | 317 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkNormalSource) |
319 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(NormalMapSourceImpl) | 318 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(NormalMapSourceImpl) |
320 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 319 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
321 | 320 |
322 //////////////////////////////////////////////////////////////////////////// | 321 //////////////////////////////////////////////////////////////////////////// |
OLD | NEW |