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
diff --git a/gm/lightingshader.cpp b/gm/lightingshader.cpp
index 3b1c224..2cf4a95 100644
--- a/gm/lightingshader.cpp
+++ b/gm/lightingshader.cpp
@@ -100,12 +100,14 @@
const SkMatrix& ctm = canvas->getTotalMatrix();
SkPaint paint;
+ sk_sp<SkShader> diffuseShader = SkMakeBitmapShader(fDiffuse,
+ SkShader::kClamp_TileMode, SkShader::kClamp_TileMode, &matrix, nullptr);
sk_sp<SkShader> normalMap = SkMakeBitmapShader(fNormalMaps[mapType],
SkShader::kClamp_TileMode, SkShader::kClamp_TileMode, &matrix, nullptr);
sk_sp<SkNormalSource> normalSource = SkNormalSource::MakeFromNormalMap(std::move(normalMap),
ctm);
- paint.setShader(SkLightingShader::Make(fDiffuse, fLights, &matrix,
- std::move(normalSource)));
+ paint.setShader(SkLightingShader::Make(std::move(diffuseShader), std::move(normalSource),
+ fLights));
canvas->drawRect(r, paint);
}