| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SampleCode.h" | 8 #include "SampleCode.h" |
| 9 #include "SkPictureRecorder.h" | 9 #include "SkPictureRecorder.h" |
| 10 #include "SkShadowPaintFilterCanvas.h" | 10 #include "SkShadowPaintFilterCanvas.h" |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, unsigned modi) ove
rride { | 159 SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, unsigned modi) ove
rride { |
| 160 return new SkView::Click(this); | 160 return new SkView::Click(this); |
| 161 } | 161 } |
| 162 | 162 |
| 163 void updateLights(int x, int y) { | 163 void updateLights(int x, int y) { |
| 164 SkLights::Builder builder; | 164 SkLights::Builder builder; |
| 165 builder.add(SkLights::Light::MakePoint(SkColor3f::Make(1.0f, 1.0f, 1.0f)
, | 165 builder.add(SkLights::Light::MakePoint(SkColor3f::Make(1.0f, 1.0f, 1.0f)
, |
| 166 SkVector3::Make(x, | 166 SkVector3::Make(x, |
| 167 kHeight - y, | 167 kHeight - y, |
| 168 fLightDepth), | 168 fLightDepth), |
| 169 100000, true)); | 169 400, true)); |
| 170 fLights = builder.finish(); | 170 fLights = builder.finish(); |
| 171 } | 171 } |
| 172 | 172 |
| 173 void updateFromSelectedSlider() { | 173 void updateFromSelectedSlider() { |
| 174 SkScalar newValue = fSliders[fSelectedSliderID].fGeometry.fLeft * | 174 SkScalar newValue = fSliders[fSelectedSliderID].fGeometry.fLeft * |
| 175 fSliders[fSelectedSliderID].fScale + | 175 fSliders[fSelectedSliderID].fScale + |
| 176 fSliders[fSelectedSliderID].fOffset; | 176 fSliders[fSelectedSliderID].fOffset; |
| 177 | 177 |
| 178 switch (fSelectedSliderID) { | 178 switch (fSelectedSliderID) { |
| 179 case 0: | 179 case 0: |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 sk_sp<SkLights> fLights; | 292 sk_sp<SkLights> fLights; |
| 293 | 293 |
| 294 typedef SampleView INHERITED; | 294 typedef SampleView INHERITED; |
| 295 }; | 295 }; |
| 296 | 296 |
| 297 ////////////////////////////////////////////////////////////////////////////// | 297 ////////////////////////////////////////////////////////////////////////////// |
| 298 static SkView* MyFactory() { return new ShadowingView; } | 298 static SkView* MyFactory() { return new ShadowingView; } |
| 299 static SkViewRegister reg(MyFactory); | 299 static SkViewRegister reg(MyFactory); |
| 300 | 300 |
| 301 #endif | 301 #endif |
| OLD | NEW |