diff options
Diffstat (limited to 'gm/lightingshader.cpp')
-rw-r--r-- | gm/lightingshader.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gm/lightingshader.cpp b/gm/lightingshader.cpp index 3b1c224f2b..2cf4a953d8 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); } |