diff options
author | dvonbeck <dvonbeck@google.com> | 2016-07-10 18:38:33 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-07-10 18:38:34 -0700 |
commit | 6af677ff8f549751352847ceefda4538236c8a20 (patch) | |
tree | 9a95a87e2c9903938117cbf334c5b35695317d50 /samplecode/SampleLighting.cpp | |
parent | 3ab14ca950d98a5c4d4c4a5f96ea8b0c984e0116 (diff) | |
download | platform_external_skqp-6af677ff8f549751352847ceefda4538236c8a20.tar.gz platform_external_skqp-6af677ff8f549751352847ceefda4538236c8a20.tar.bz2 platform_external_skqp-6af677ff8f549751352847ceefda4538236c8a20.zip |
Changed SkLightingShader API to take in a shader as color source
This CL's base is the CL for the same modification, but in the implementation side: https://codereview.chromium.org/2062703003/
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2064153002
Review-Url: https://codereview.chromium.org/2064153002
Diffstat (limited to 'samplecode/SampleLighting.cpp')
-rwxr-xr-x | samplecode/SampleLighting.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/samplecode/SampleLighting.cpp b/samplecode/SampleLighting.cpp index 5949f4961b..c191a6c749 100755 --- a/samplecode/SampleLighting.cpp +++ b/samplecode/SampleLighting.cpp @@ -70,8 +70,10 @@ protected: SkShader::kClamp_TileMode, SkShader::kClamp_TileMode, nullptr, nullptr); sk_sp<SkNormalSource> normalSource = SkNormalSource::MakeFromNormalMap( std::move(normalMap), SkMatrix::I()); - paint.setShader(SkLightingShader::Make(fDiffuseBitmap, std::move(lights), nullptr, - std::move(normalSource))); + sk_sp<SkShader> diffuseShader = SkBitmapProcShader::MakeBitmapShader(fDiffuseBitmap, + SkShader::kClamp_TileMode, SkShader::kClamp_TileMode, nullptr); + paint.setShader(SkLightingShader::Make(std::move(diffuseShader), std::move(normalSource), + std::move(lights))); paint.setColor(SK_ColorBLACK); SkRect r = SkRect::MakeWH((SkScalar)fDiffuseBitmap.width(), |