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

Unified Diff: samplecode/SampleLitAtlas.cpp

Issue 2063793002: API change to allow for NormalSource selection at the user level. (Closed) Base URL: https://skia.googlesource.com/skia@dvonbeck-normal-factor-out
Patch Set: Small rebase and comment fix Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: samplecode/SampleLitAtlas.cpp
diff --git a/samplecode/SampleLitAtlas.cpp b/samplecode/SampleLitAtlas.cpp
index f1d67e5c7933b0050e491e51c0d974898e810268..058ac5d05a2befdd7e3d2293b84f2657807846d7 100644
--- a/samplecode/SampleLitAtlas.cpp
+++ b/samplecode/SampleLitAtlas.cpp
@@ -132,8 +132,10 @@ protected:
SkVector invNormRotation = { m[SkMatrix::kMScaleX], m[SkMatrix::kMSkewY] };
SkASSERT(SkScalarNearlyEqual(invNormRotation.lengthSqd(), SK_Scalar1));
- paint.setShader(SkLightingShader::Make(fAtlas, fAtlas, fLights,
- invNormRotation, &diffMat, &normalMat));
+ auto normalSource = SkLightingShader::NormalMapSource::Make(fAtlas, invNormRotation,
+ &normalMat);
+ paint.setShader(SkLightingShader::Make(fAtlas, fLights, &diffMat,
+ std::move(normalSource)));
canvas->save();
canvas->setMatrix(m);

Powered by Google App Engine
This is Rietveld 408576698