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

Unified Diff: src/core/SkLightingShader.h

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, 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
« no previous file with comments | « samplecode/SampleLitAtlas.cpp ('k') | src/core/SkLightingShader.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 be932423e94e281648fd8364c5dd7c2dc2436f58..ce1f37a52de5fb00337b30b64859e5384c4d4da7 100644
--- a/src/core/SkLightingShader.h
+++ b/src/core/SkLightingShader.h
@@ -17,29 +17,22 @@ class SkNormalSource;
class SK_API SkLightingShader {
public:
robertphillips 2016/07/06 15:38:15 "textured by" -> "lit using" ?
dvonbeck 2016/07/06 15:53:05 Done.
- /** Returns a shader that lights the diffuse map and normals with a set of lights.
+ /** Returns a shader that lights the shape, colored by the diffuseShader, and textured by the
+ normals from normalSource, with a set of lights.
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 diffuse the diffuse bitmap
- @param lights the lights applied to the normal map
- @param diffLocalMatrix the local matrix for the diffuse map (transform from
- texture coordinates to shape source coordinates). nullptr is
- interpreted as an identity matrix.
- @param normalSource the source for the normals
-
- nullptr will be returned if:
- 'diffuse' is empty
- 'diffuse' is too big (> 65535 on any side)
+ @param diffuseShader the shader that provides the colors
+ @param normalSource the source for the shape's normals
+ @param lights the lights applied to the normals
The lighting equation is currently:
result = LightColor * DiffuseColor * (Normal * LightDir) + AmbientColor
*/
- static sk_sp<SkShader> Make(const SkBitmap& diffuse, sk_sp<SkLights> lights,
- const SkMatrix* diffLocalMatrix,
- sk_sp<SkNormalSource> normalSource);
+ static sk_sp<SkShader> Make(sk_sp<SkShader> diffuseShader, sk_sp<SkNormalSource> normalSource,
+ sk_sp<SkLights> lights);
SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP()
};
« no previous file with comments | « samplecode/SampleLitAtlas.cpp ('k') | src/core/SkLightingShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698