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

Unified Diff: samplecode/SampleLitAtlas.cpp

Issue 2064153002: Changed SkLightingShader API to take in a shader as color source (Closed) Base URL: https://skia.googlesource.com/skia@dvonbeck-diffuse-factor-out
Patch Set: rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « samplecode/SampleLighting.cpp ('k') | src/core/SkLightingShader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleLitAtlas.cpp
diff --git a/samplecode/SampleLitAtlas.cpp b/samplecode/SampleLitAtlas.cpp
index ba42ed8761ac9ad72fadd3f6514e2805f53359d8..f1882b789021743814b01375d2a4f638a80ae4a8 100644
--- a/samplecode/SampleLitAtlas.cpp
+++ b/samplecode/SampleLitAtlas.cpp
@@ -134,8 +134,10 @@ protected:
SkShader::kClamp_TileMode, &normalMat, nullptr);
sk_sp<SkNormalSource> normalSource = SkNormalSource::MakeFromNormalMap(
std::move(normalMap), m);
- paint.setShader(SkLightingShader::Make(fAtlas, fLights, &diffMat,
- std::move(normalSource)));
+ sk_sp<SkShader> diffuseShader = SkBitmapProcShader::MakeBitmapShader(fAtlas,
+ SkShader::kClamp_TileMode, SkShader::kClamp_TileMode, &diffMat);
+ paint.setShader(SkLightingShader::Make(std::move(diffuseShader),
+ std::move(normalSource), fLights));
canvas->save();
canvas->setMatrix(m);
« no previous file with comments | « samplecode/SampleLighting.cpp ('k') | src/core/SkLightingShader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698