Index: samplecode/SampleShadowing.cpp |
diff --git a/samplecode/SampleShadowing.cpp b/samplecode/SampleShadowing.cpp |
index 7b434bca80a5fc5a5be323c4b54f84594e7bc2e4..d0b37fb15ab7921f259a93f2ed2c236f3fb124cf 100644 |
--- a/samplecode/SampleShadowing.cpp |
+++ b/samplecode/SampleShadowing.cpp |
@@ -19,11 +19,11 @@ public: |
this->setBGColor(0xFFCCCCCC); |
SkLights::Builder builder; |
- builder.add(SkLights::Light(SkColor3f::Make(0.2f, 0.3f, 0.4f), |
- SkVector3::Make(0.2f, 0.05f, 1.0f))); |
- builder.add(SkLights::Light(SkColor3f::Make(0.4f, 0.3f, 0.2f), |
- SkVector3::Make(0.05f, 0.2f, 1.0f))); |
- builder.add(SkLights::Light(SkColor3f::Make(0.4f, 0.4f, 0.4f))); |
+ builder.add(SkLights::Light::MakeDirectional(SkColor3f::Make(0.2f, 0.3f, 0.4f), |
+ SkVector3::Make(0.2f, 0.05f, 1.0f))); |
+ builder.add(SkLights::Light::MakeDirectional(SkColor3f::Make(0.4f, 0.3f, 0.2f), |
+ SkVector3::Make(0.05f, 0.2f, 1.0f))); |
+ builder.add(SkLights::Light::MakeAmbient(SkColor3f::Make(0.4f, 0.4f, 0.4f))); |
fLights = builder.finish(); |
fTestRects[0].fColor = 0xFFEE8888; |
@@ -139,15 +139,18 @@ protected: |
float recipY = 1.0f / kHeight; |
SkLights::Builder builder; |
- builder.add(SkLights::Light(SkColor3f::Make(0.2f, 0.3f, 0.4f), |
- SkVector3::Make(0.2f + (200.0f - x) * recipX, |
- 0.05f + (200.0f - y) * recipY, |
- 1.0f))); |
- builder.add(SkLights::Light(SkColor3f::Make(0.4f, 0.3f, 0.2f), |
- SkVector3::Make(0.05f + (200.0f - x) * recipX, |
- 0.2f + (200.0f - y) * recipY, |
- 1.0f))); |
- builder.add(SkLights::Light(SkColor3f::Make(0.4f, 0.4f, 0.4f))); |
+ builder.add(SkLights::Light::MakeDirectional( |
+ SkColor3f::Make(0.2f, 0.3f, 0.4f), |
+ SkVector3::Make(0.2f + (200.0f - x) * recipX, |
+ 0.05f + (200.0f - y) * recipY, |
+ 1.0f))); |
+ builder.add(SkLights::Light::MakeDirectional( |
+ SkColor3f::Make(0.4f, 0.3f, 0.2f), |
+ SkVector3::Make(0.05f + (200.0f - x) * recipX, |
+ 0.2f + (200.0f - y) * recipY, |
+ 1.0f))); |
+ builder.add(SkLights::Light::MakeAmbient( |
+ SkColor3f::Make(0.4f, 0.4f, 0.4f))); |
fLights = builder.finish(); |
fLightsChanged = true; |