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

Unified Diff: src/core/SkLightingShader.cpp

Issue 2167223002: Revert of Creating framework for drawShadowedPicture (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
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | src/core/SkPictureFlat.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkLightingShader.cpp
diff --git a/src/core/SkLightingShader.cpp b/src/core/SkLightingShader.cpp
index 2272cf2e1a9faf2d8af24a791d4a57fd0ad2089d..02f14b34ddc9215c72070aeedc769a8f36418cd2 100644
--- a/src/core/SkLightingShader.cpp
+++ b/src/core/SkLightingShader.cpp
@@ -49,7 +49,7 @@
*/
SkLightingShaderImpl(sk_sp<SkShader> diffuseShader,
sk_sp<SkNormalSource> normalSource,
- sk_sp<SkLights> lights)
+ const sk_sp<SkLights> lights)
: fDiffuseShader(std::move(diffuseShader))
, fNormalSource(std::move(normalSource))
, fLights(std::move(lights)) {}
@@ -134,7 +134,6 @@
// TODO: handle more than one of these
fLightColor = lights->light(i).color();
fLightDir = lights->light(i).dir();
- // TODO get the handle to the shadow map if there is one
}
}
@@ -177,9 +176,6 @@
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
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | src/core/SkPictureFlat.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698