Index: samplecode/SampleLighting.cpp |
diff --git a/samplecode/SampleLighting.cpp b/samplecode/SampleLighting.cpp |
index 16b187408ac2051615cd97fb5f17b64909a23803..48d3f8a15ca51a804815b855c2da8a9766a19cf1 100755 |
--- a/samplecode/SampleLighting.cpp |
+++ b/samplecode/SampleLighting.cpp |
@@ -8,6 +8,7 @@ |
#include "SampleCode.h" |
#include "Resources.h" |
+#include "SkBitmapProcShader.h" |
#include "SkCanvas.h" |
#include "SkLightingShader.h" |
#include "SkNormalSource.h" |
@@ -65,11 +66,13 @@ protected: |
sk_sp<SkLights> lights(create_lights(fLightAngle, fColorFactor)); |
SkPaint paint; |
+ sk_sp<SkShader> diffuseShader = SkBitmapProcShader::MakeBitmapShader(fDiffuseBitmap, |
+ SkShader::kClamp_TileMode, SkShader::kClamp_TileMode, nullptr); |
sk_sp<SkNormalSource> normalSource = SkNormalSource::MakeMap(fNormalBitmap, |
SkVector::Make(1.0f, 0.0f), |
nullptr); |
- paint.setShader(SkLightingShader::Make(fDiffuseBitmap, std::move(lights), nullptr, |
- std::move(normalSource))); |
+ paint.setShader(SkLightingShader::Make(std::move(diffuseShader), std::move(normalSource), |
+ std::move(lights))); |
paint.setColor(SK_ColorBLACK); |
SkRect r = SkRect::MakeWH((SkScalar)fDiffuseBitmap.width(), |