Index: samplecode/SampleLighting.cpp |
diff --git a/samplecode/SampleLighting.cpp b/samplecode/SampleLighting.cpp |
index 5171579f6459d0b5ce9665c4985a143b8f0c8ae9..a27aa9de41b117667e030ff9c6cdd61c13e6de5a 100755 |
--- a/samplecode/SampleLighting.cpp |
+++ b/samplecode/SampleLighting.cpp |
@@ -12,16 +12,16 @@ |
#include "SkLightingShader.h" |
#include "SkPoint3.h" |
-static const SkLightingShader::Lights* create_lights(SkScalar angle, SkScalar blue) { |
+static sk_sp<SkLights> create_lights(SkScalar angle, SkScalar blue) { |
const SkVector3 dir = SkVector3::Make(SkScalarSin(angle)*SkScalarSin(SK_ScalarPI*0.25f), |
SkScalarCos(angle)*SkScalarSin(SK_ScalarPI*0.25f), |
SkScalarCos(SK_ScalarPI*0.25f)); |
- SkLightingShader::Lights::Builder builder; |
+ SkLights::Builder builder; |
- builder.add(SkLight(SkColor3f::Make(1.0f, 1.0f, blue), dir)); |
- builder.add(SkLight(SkColor3f::Make(0.1f, 0.1f, 0.1f))); |
+ builder.add(SkLights::Light(SkColor3f::Make(1.0f, 1.0f, blue), dir)); |
+ builder.add(SkLights::Light(SkColor3f::Make(0.1f, 0.1f, 0.1f))); |
return builder.finish(); |
} |
@@ -62,11 +62,10 @@ protected: |
fColorFactor = 0.0f; |
} |
- SkAutoTUnref<const SkLightingShader::Lights> lights(create_lights(fLightAngle, |
- fColorFactor)); |
+ sk_sp<SkLights> lights(create_lights(fLightAngle, fColorFactor)); |
SkPaint paint; |
paint.setShader(SkLightingShader::Make(fDiffuseBitmap, fNormalBitmap, |
- lights, SkVector::Make(1.0f, 0.0f), |
+ std::move(lights), SkVector::Make(1.0f, 0.0f), |
nullptr, nullptr)); |
paint.setColor(SK_ColorBLACK); |