Index: gm/lightingshader.cpp |
diff --git a/gm/lightingshader.cpp b/gm/lightingshader.cpp |
index 3b1c224f2bf980ab91a3e2524d36a4eaa2b22b10..2cf4a953d800b78c0577a57f48daa020168ee698 100644 |
--- a/gm/lightingshader.cpp |
+++ b/gm/lightingshader.cpp |
@@ -100,12 +100,14 @@ protected: |
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); |
} |