Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Side by Side Diff: src/core/SkNormalSource.cpp

Issue 2137513002: Revert of Abstracted diffuse color map out of SkLightingShaderImpl into a generic SkShader (Closed) Base URL: https://skia.googlesource.com/skia@dvonbeck-normal-api-change
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/core/SkLightingShader.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 174
175 SkMatrix fInvCTM; 175 SkMatrix fInvCTM;
176 }; 176 };
177 177
178 sk_sp<GrFragmentProcessor> NormalMapSourceImpl::asFragmentProcessor( 178 sk_sp<GrFragmentProcessor> NormalMapSourceImpl::asFragmentProcessor(
179 GrContext *context, 179 GrContext *context,
180 const SkMatrix &viewM, 180 const SkMatrix &viewM,
181 const SkMatrix *localMatrix , 181 const SkMatrix *localMatrix ,
182 SkFilterQuality filterQuali ty, 182 SkFilterQuality filterQuali ty,
183 SkSourceGammaTreatment gamm aTreatment) const { 183 SkSourceGammaTreatment gamm aTreatment) const {
184
184 sk_sp<GrFragmentProcessor> mapFP = fMapShader->asFragmentProcessor(context, viewM, 185 sk_sp<GrFragmentProcessor> mapFP = fMapShader->asFragmentProcessor(context, viewM,
185 localMatrix, filterQuality, gammaTreatment); 186 localMatrix, filterQuality, gammaTreatment);
186 187
187 return sk_make_sp<NormalMapFP>(std::move(mapFP), fInvCTM); 188 return sk_make_sp<NormalMapFP>(std::move(mapFP), fInvCTM);
188 } 189 }
189 190
190 #endif // SK_SUPPORT_GPU 191 #endif // SK_SUPPORT_GPU
191 192
192 //////////////////////////////////////////////////////////////////////////// 193 ////////////////////////////////////////////////////////////////////////////
193 194
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 return sk_make_sp<NormalMapSourceImpl>(std::move(map), invCTM); 314 return sk_make_sp<NormalMapSourceImpl>(std::move(map), invCTM);
314 } 315 }
315 316
316 //////////////////////////////////////////////////////////////////////////// 317 ////////////////////////////////////////////////////////////////////////////
317 318
318 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkNormalSource) 319 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkNormalSource)
319 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(NormalMapSourceImpl) 320 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(NormalMapSourceImpl)
320 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 321 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
321 322
322 //////////////////////////////////////////////////////////////////////////// 323 ////////////////////////////////////////////////////////////////////////////
OLDNEW
« no previous file with comments | « src/core/SkLightingShader.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698