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

Unified Diff: src/core/SkLightingShader.cpp

Issue 2127233002: Added the framework for having canvas/recorder/picture record depth_set's. (Closed) Base URL: https://skia.googlesource.com/skia@master
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 side-by-side diff with in-line comments
Download patch
Index: src/core/SkLightingShader.cpp
diff --git a/src/core/SkLightingShader.cpp b/src/core/SkLightingShader.cpp
index 473028105a9c5a295b90dd438a43a3c6be0af353..400761d0ce7d4d38a2a7b7d193949961e1d1f45c 100644
--- a/src/core/SkLightingShader.cpp
+++ b/src/core/SkLightingShader.cpp
@@ -134,6 +134,7 @@ public:
// TODO: handle more than one of these
fLightColor = lights->light(i).color();
fLightDir = lights->light(i).dir();
+ // get the handle to the shadow map if there is one
}
}
@@ -176,6 +177,9 @@ public:
this->emitChild(0, nullptr, &dstNormalName, args);
fragBuilder->codeAppendf("vec3 normal = %s.xyz;", dstNormalName.c_str());
+
+ // TODO: make this a loop and modulate the contribution from each light
+ // based on the shadow map
fragBuilder->codeAppendf("float NdotL = clamp(dot(normal, %s), 0.0, 1.0);",
lightDirUniName);
// diffuse light
« src/core/SkCanvas.cpp ('K') | « src/core/SkCanvas.cpp ('k') | src/core/SkRecordDraw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698