aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar Leon Scroggins III <scroggo@google.com>2018-06-25 14:01:29 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-26 17:30:52 +0000
commita57488a1f5c14c2114c57880b85c1bbc90024973 (patch)
tree7e811b7928e098560b8a8ebab12c3da960b5efc6 /tests
parent6a284b771632f547b8a2d31115d3df4601c53228 (diff)
Expose public factories for platform decoders
Bug: skia:8076 Move SkImageGeneratorCG and SkImageGeneratorWIC to include/ports/, and make them SK_API. Remove SkImageGeneratorCG::NewFromEncodedCG. No known clients are using it, and it was a private API in src/. There is already a MakeFromEncodedCG to replace it. Similarly, switch WIC from New to Make. Add a compile test for using them with SetImageGeneratorFromEncodedDataFactory. Change-Id: I897eb7a887b3736a6c614a68e38f38b6a1942cf1 Reviewed-on: https://skia-review.googlesource.com/137387 Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/ImageGeneratorTest.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ImageGeneratorTest.cpp b/tests/ImageGeneratorTest.cpp
index 574c8e8728..0bddcd939d 100644
--- a/tests/ImageGeneratorTest.cpp
+++ b/tests/ImageGeneratorTest.cpp
@@ -12,6 +12,12 @@
#include "SkImageInfoPriv.h"
#include "Test.h"
+#if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS)
+ #include "SkImageGeneratorCG.h"
+#elif defined(SK_BUILD_FOR_WIN)
+ #include "SkImageGeneratorWIC.h"
+#endif
+
static bool gMyFactoryWasCalled;
static std::unique_ptr<SkImageGenerator> my_factory(sk_sp<SkData>) {
@@ -36,6 +42,14 @@ static void test_imagegenerator_factory(skiatest::Reporter* reporter) {
gen = SkImageGenerator::MakeFromEncoded(data);
REPORTER_ASSERT(reporter, nullptr == gen);
REPORTER_ASSERT(reporter, gMyFactoryWasCalled);
+
+ // This just verifies that the signatures match.
+#if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS)
+ SkGraphics::SetImageGeneratorFromEncodedDataFactory(SkImageGeneratorCG::MakeFromEncodedCG);
+#elif defined(SK_BUILD_FOR_WIN)
+ SkGraphics::SetImageGeneratorFromEncodedDataFactory(SkImageGeneratorWIC::MakeFromEncodedWIC);
+#endif
+
SkGraphics::SetImageGeneratorFromEncodedDataFactory(prev);
}