diff options
author | dvonbeck <dvonbeck@google.com> | 2016-07-20 11:20:30 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-07-20 11:20:30 -0700 |
commit | c526da94e4f2dc0c8521099dad2118c5d6b8da4a (patch) | |
tree | cacbe403042f6a407fc3ae052c0110a88942af09 /tests/SerializationTest.cpp | |
parent | f2944815e5e490c843c5a364fcaae2471526562f (diff) |
SkLS now accepting nullptr for diffuse shader and normal source, now accurately handling alpha
This CL's base is the CL for taking in a diffuse shader into SkLS on the API side: https://codereview.chromium.org/2064153002
BUG=skia:5502,skia:5517
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2132113002
Review-Url: https://codereview.chromium.org/2132113002
Diffstat (limited to 'tests/SerializationTest.cpp')
-rw-r--r-- | tests/SerializationTest.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/tests/SerializationTest.cpp b/tests/SerializationTest.cpp index 88f88fc2ac..f806c4a5cc 100644 --- a/tests/SerializationTest.cpp +++ b/tests/SerializationTest.cpp @@ -587,13 +587,26 @@ DEF_TEST(Serialization, reporter) { ctm); sk_sp<SkShader> diffuseShader = SkMakeBitmapShader(diffuse, SkShader::kClamp_TileMode, SkShader::kClamp_TileMode, &matrix, nullptr); - sk_sp<SkShader> lightingShader = SkLightingShader::Make(std::move(diffuseShader), - std::move(normalSource), + + sk_sp<SkShader> lightingShader = SkLightingShader::Make(diffuseShader, + normalSource, fLights); + SkAutoTUnref<SkShader>(TestFlattenableSerialization(lightingShader.get(), true, reporter)); + lightingShader = SkLightingShader::Make(std::move(diffuseShader), + nullptr, + fLights); SkAutoTUnref<SkShader>(TestFlattenableSerialization(lightingShader.get(), true, reporter)); - // TODO test equality? + lightingShader = SkLightingShader::Make(nullptr, + std::move(normalSource), + fLights); + SkAutoTUnref<SkShader>(TestFlattenableSerialization(lightingShader.get(), true, reporter)); + + lightingShader = SkLightingShader::Make(nullptr, + nullptr, + fLights); + SkAutoTUnref<SkShader>(TestFlattenableSerialization(lightingShader.get(), true, reporter)); } } |