From c526da94e4f2dc0c8521099dad2118c5d6b8da4a Mon Sep 17 00:00:00 2001 From: dvonbeck Date: Wed, 20 Jul 2016 11:20:30 -0700 Subject: 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 --- tests/SerializationTest.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'tests/SerializationTest.cpp') 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 diffuseShader = SkMakeBitmapShader(diffuse, SkShader::kClamp_TileMode, SkShader::kClamp_TileMode, &matrix, nullptr); - sk_sp lightingShader = SkLightingShader::Make(std::move(diffuseShader), - std::move(normalSource), + + sk_sp lightingShader = SkLightingShader::Make(diffuseShader, + normalSource, fLights); + SkAutoTUnref(TestFlattenableSerialization(lightingShader.get(), true, reporter)); + lightingShader = SkLightingShader::Make(std::move(diffuseShader), + nullptr, + fLights); SkAutoTUnref(TestFlattenableSerialization(lightingShader.get(), true, reporter)); - // TODO test equality? + lightingShader = SkLightingShader::Make(nullptr, + std::move(normalSource), + fLights); + SkAutoTUnref(TestFlattenableSerialization(lightingShader.get(), true, reporter)); + + lightingShader = SkLightingShader::Make(nullptr, + nullptr, + fLights); + SkAutoTUnref(TestFlattenableSerialization(lightingShader.get(), true, reporter)); } } -- cgit v1.2.3