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

Unified Diff: src/core/SkLightingShader.h

Issue 2237963002: LightingShader and NormalSource comment and style fixes (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Addressed patch 1 comment Created 4 years, 4 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 | « no previous file | src/core/SkNormalBevelSource.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkLightingShader.h
diff --git a/src/core/SkLightingShader.h b/src/core/SkLightingShader.h
index 41e3ca239440cb9e92e491958e258c3a7a249e5f..aa90710aa45053826376b8ab39cf883484ec21bd 100644
--- a/src/core/SkLightingShader.h
+++ b/src/core/SkLightingShader.h
@@ -20,9 +20,6 @@ public:
/** Returns a shader that lights the shape, colored by the diffuseShader, using the
normals from normalSource, with the set of lights provided.
- It returns a shader with a reference count of 1.
- The caller should decrement the shader's reference count when done with the shader.
- It is an error for count to be < 2.
@param diffuseShader the shader that provides the colors. If nullptr, uses the paint's
color.
@param normalSource the source for the shape's normals. If nullptr, assumes straight
@@ -30,7 +27,7 @@ public:
@param lights the lights applied to the normals
The lighting equation is currently:
- result = LightColor * DiffuseColor * (Normal * LightDir) + AmbientColor
+ result = (LightColor * dot(Normal, LightDir) + AmbientColor) * DiffuseColor
*/
static sk_sp<SkShader> Make(sk_sp<SkShader> diffuseShader, sk_sp<SkNormalSource> normalSource,
« no previous file with comments | « no previous file | src/core/SkNormalBevelSource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698