aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-08-04 11:27:00 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-08-07 13:33:49 +0000
commit6dd8cf144ecbc395dc12bd5f775bbeee04b9d38c (patch)
treef05965ad55589843158accb1e538411a43068648 /tests
parent35ee0e09b4966bd087147e2c9b4c3177e9737d3b (diff)
Remove SkLightingShader and associated classes
Change-Id: I8050414c30dfdb5df23ca79955adc5ba3a29d3f5 Reviewed-on: https://skia-review.googlesource.com/31140 Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/SerializationTest.cpp60
1 files changed, 0 insertions, 60 deletions
diff --git a/tests/SerializationTest.cpp b/tests/SerializationTest.cpp
index 3c24c558ef..898b12f220 100644
--- a/tests/SerializationTest.cpp
+++ b/tests/SerializationTest.cpp
@@ -12,10 +12,8 @@
#include "SkFontDescriptor.h"
#include "SkImage.h"
#include "SkImageSource.h"
-#include "SkLightingShader.h"
#include "SkMakeUnique.h"
#include "SkMallocPixelRef.h"
-#include "SkNormalSource.h"
#include "SkOSFile.h"
#include "SkPictureRecorder.h"
#include "SkShaderBase.h"
@@ -552,64 +550,6 @@ DEF_TEST(Serialization, reporter) {
}
TestPictureTypefaceSerialization(reporter);
-
- // Test SkLightingShader/NormalMapSource serialization
- {
- const int kTexSize = 2;
-
- SkLights::Builder builder;
-
- builder.add(SkLights::Light::MakeDirectional(SkColor3f::Make(1.0f, 1.0f, 1.0f),
- SkVector3::Make(1.0f, 0.0f, 0.0f)));
- builder.setAmbientLightColor(SkColor3f::Make(0.2f, 0.2f, 0.2f));
-
- sk_sp<SkLights> fLights = builder.finish();
-
- SkBitmap diffuse = sk_tool_utils::create_checkerboard_bitmap(
- kTexSize, kTexSize,
- sk_tool_utils::color_to_565(0x0),
- sk_tool_utils::color_to_565(0xFF804020),
- 8);
-
- SkRect bitmapBounds = SkRect::MakeIWH(diffuse.width(), diffuse.height());
-
- SkMatrix matrix;
- SkRect r = SkRect::MakeWH(SkIntToScalar(kTexSize), SkIntToScalar(kTexSize));
- matrix.setRectToRect(bitmapBounds, r, SkMatrix::kFill_ScaleToFit);
-
- SkMatrix ctm;
- ctm.setRotate(45);
- SkBitmap normals;
- normals.allocN32Pixels(kTexSize, kTexSize);
-
- sk_tool_utils::create_frustum_normal_map(&normals, SkIRect::MakeWH(kTexSize, kTexSize));
- sk_sp<SkShader> normalMap = SkShader::MakeBitmapShader(normals, SkShader::kClamp_TileMode,
- SkShader::kClamp_TileMode, &matrix);
- sk_sp<SkNormalSource> normalSource = SkNormalSource::MakeFromNormalMap(std::move(normalMap),
- ctm);
- sk_sp<SkShader> diffuseShader = SkShader::MakeBitmapShader(diffuse,
- SkShader::kClamp_TileMode, SkShader::kClamp_TileMode, &matrix);
-
- sk_sp<SkShader> lightingShader = SkLightingShader::Make(diffuseShader,
- normalSource,
- fLights);
- sk_sp<SkShader>(TestFlattenableSerialization(as_SB(lightingShader.get()), true, reporter));
-
- lightingShader = SkLightingShader::Make(std::move(diffuseShader),
- nullptr,
- fLights);
- sk_sp<SkShader>(TestFlattenableSerialization(as_SB(lightingShader.get()), true, reporter));
-
- lightingShader = SkLightingShader::Make(nullptr,
- std::move(normalSource),
- fLights);
- sk_sp<SkShader>(TestFlattenableSerialization(as_SB(lightingShader.get()), true, reporter));
-
- lightingShader = SkLightingShader::Make(nullptr,
- nullptr,
- fLights);
- sk_sp<SkShader>(TestFlattenableSerialization(as_SB(lightingShader.get()), true, reporter));
- }
}
///////////////////////////////////////////////////////////////////////////////////////////////////