diff options
Diffstat (limited to 'samplecode')
-rwxr-xr-x | samplecode/SampleLighting.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/samplecode/SampleLighting.cpp b/samplecode/SampleLighting.cpp index 5171579f64..a27aa9de41 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); |