aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkLightingShader.h
diff options
context:
space:
mode:
authorGravatar dvonbeck <dvonbeck@google.com>2016-07-10 18:38:33 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-07-10 18:38:34 -0700
commit6af677ff8f549751352847ceefda4538236c8a20 (patch)
tree9a95a87e2c9903938117cbf334c5b35695317d50 /src/core/SkLightingShader.h
parent3ab14ca950d98a5c4d4c4a5f96ea8b0c984e0116 (diff)
Changed SkLightingShader API to take in a shader as color source
This CL's base is the CL for the same modification, but in the implementation side: https://codereview.chromium.org/2062703003/ BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2064153002 Review-Url: https://codereview.chromium.org/2064153002
Diffstat (limited to 'src/core/SkLightingShader.h')
-rw-r--r--src/core/SkLightingShader.h21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/core/SkLightingShader.h b/src/core/SkLightingShader.h
index f10382368a..bb642615a5 100644
--- a/src/core/SkLightingShader.h
+++ b/src/core/SkLightingShader.h
@@ -17,29 +17,22 @@ class SkNormalSource;
class SK_API SkLightingShader {
public:
- /** Returns a shader that lights the diffuse map using the normals and a set of lights.
+ /** 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 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()
};