aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--fuzz/fuzz.cpp1
-rw-r--r--gn/core.gni2
-rw-r--r--include/core/SkFlattenableSerialization.h24
-rw-r--r--samplecode/SampleFilterFuzz.cpp5
-rw-r--r--src/core/SkFlattenableSerialization.cpp23
-rw-r--r--tests/ImageFilterTest.cpp9
6 files changed, 5 insertions, 59 deletions
diff --git a/fuzz/fuzz.cpp b/fuzz/fuzz.cpp
index c4de6c49f3..37029949ed 100644
--- a/fuzz/fuzz.cpp
+++ b/fuzz/fuzz.cpp
@@ -10,7 +10,6 @@
#include "SkCodec.h"
#include "SkCommandLineFlags.h"
#include "SkData.h"
-#include "SkFlattenableSerialization.h"
#include "SkImage.h"
#include "SkImageEncoder.h"
#include "SkImageFilter.h"
diff --git a/gn/core.gni b/gn/core.gni
index da59e2fff1..abd49e8022 100644
--- a/gn/core.gni
+++ b/gn/core.gni
@@ -141,7 +141,6 @@ skia_core_sources = [
"$_src/core/SkGaussFilter.cpp",
"$_src/core/SkGaussFilter.h",
"$_src/core/SkFlattenable.cpp",
- "$_src/core/SkFlattenableSerialization.cpp",
"$_src/core/SkFont.cpp",
"$_src/core/SkFontLCDConfig.cpp",
"$_src/core/SkFontMgr.cpp",
@@ -385,7 +384,6 @@ skia_core_sources = [
"$_include/core/SkDrawFilter.h",
"$_include/core/SkDrawLooper.h",
"$_include/core/SkFlattenable.h",
- "$_include/core/SkFlattenableSerialization.h",
"$_include/core/SkFontArguments.h",
"$_include/core/SkFontLCDConfig.h",
"$_include/core/SkFontStyle.h",
diff --git a/include/core/SkFlattenableSerialization.h b/include/core/SkFlattenableSerialization.h
deleted file mode 100644
index f6525cb217..0000000000
--- a/include/core/SkFlattenableSerialization.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright 2013 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef SkFlattenableSerialization_DEFINED
-#define SkFlattenableSerialization_DEFINED
-
-#include "SkFlattenable.h"
-
-class SkData;
-class SkImageFilter;
-
-// DEPRECATED -- these can all be called directly using SkFlattenable.h
-
-SK_API SkData* SkValidatingSerializeFlattenable(SkFlattenable*);
-SK_API SkFlattenable* SkValidatingDeserializeFlattenable(const void* data, size_t size,
- SkFlattenable::Type type);
-
-SK_API sk_sp<SkImageFilter> SkValidatingDeserializeImageFilter(const void* data, size_t size);
-
-#endif
diff --git a/samplecode/SampleFilterFuzz.cpp b/samplecode/SampleFilterFuzz.cpp
index 21e491494d..28ba1e69d6 100644
--- a/samplecode/SampleFilterFuzz.cpp
+++ b/samplecode/SampleFilterFuzz.cpp
@@ -22,7 +22,6 @@
#include "SkDisplacementMapEffect.h"
#include "SkDropShadowImageFilter.h"
#include "SkEmbossMaskFilter.h"
-#include "SkFlattenableSerialization.h"
#include "SkImageSource.h"
#include "SkLightingImageFilter.h"
#include "SkLumaColorFilter.h"
@@ -715,7 +714,7 @@ static sk_sp<SkImageFilter> make_image_filter(bool canBeNull) {
static sk_sp<SkImageFilter> make_serialized_image_filter() {
sk_sp<SkImageFilter> filter(make_image_filter(false));
- sk_sp<SkData> data(SkValidatingSerializeFlattenable(filter.get()));
+ sk_sp<SkData> data(filter->serialize());
const unsigned char* ptr = static_cast<const unsigned char*>(data->data());
size_t len = data->size();
#ifdef SK_ADD_RANDOM_BIT_FLIPS
@@ -740,7 +739,7 @@ static sk_sp<SkImageFilter> make_serialized_image_filter() {
}
}
#endif // SK_ADD_RANDOM_BIT_FLIPS
- return SkValidatingDeserializeImageFilter(ptr, len);
+ return SkImageFilter::Deserialize(ptr, len);
}
static void drawClippedBitmap(SkCanvas* canvas, int x, int y, const SkPaint& paint) {
diff --git a/src/core/SkFlattenableSerialization.cpp b/src/core/SkFlattenableSerialization.cpp
deleted file mode 100644
index b2d4aa83f6..0000000000
--- a/src/core/SkFlattenableSerialization.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright 2013 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "SkFlattenableSerialization.h"
-#include "SkData.h"
-#include "SkImageFilter.h"
-
-SkData* SkValidatingSerializeFlattenable(SkFlattenable* flattenable) {
- return flattenable->serialize().release();
-}
-
-SkFlattenable* SkValidatingDeserializeFlattenable(const void* data, size_t size,
- SkFlattenable::Type type) {
- return SkFlattenable::Deserialize(type, data, size).release();
-}
-
-sk_sp<SkImageFilter> SkValidatingDeserializeImageFilter(const void* data, size_t size) {
- return SkImageFilter::Deserialize(data, size);
-}
diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp
index e17a94f68f..8aa3190bcd 100644
--- a/tests/ImageFilterTest.cpp
+++ b/tests/ImageFilterTest.cpp
@@ -15,7 +15,6 @@
#include "SkComposeImageFilter.h"
#include "SkDisplacementMapEffect.h"
#include "SkDropShadowImageFilter.h"
-#include "SkFlattenableSerialization.h"
#include "SkGradientShader.h"
#include "SkImage.h"
#include "SkImageFilterPriv.h"
@@ -1644,9 +1643,8 @@ DEF_TEST(ImageFilterImageSourceSerialization, reporter) {
sk_sp<SkImage> image(surface->makeImageSnapshot());
sk_sp<SkImageFilter> filter(SkImageSource::Make(std::move(image)));
- sk_sp<SkData> data(SkValidatingSerializeFlattenable(filter.get()));
- sk_sp<SkImageFilter> unflattenedFilter = SkValidatingDeserializeImageFilter(data->data(),
- data->size());
+ sk_sp<SkData> data(filter->serialize());
+ sk_sp<SkImageFilter> unflattenedFilter = SkImageFilter::Deserialize(data->data(), data->size());
REPORTER_ASSERT(reporter, unflattenedFilter);
SkBitmap bm;
@@ -1666,8 +1664,7 @@ DEF_TEST(ImageFilterImageSourceUninitialized, r) {
if (!data) {
return;
}
- sk_sp<SkImageFilter> unflattenedFilter = SkValidatingDeserializeImageFilter(data->data(),
- data->size());
+ sk_sp<SkImageFilter> unflattenedFilter = SkImageFilter::Deserialize(data->data(), data->size());
// This will fail. More importantly, msan will verify that we did not
// compare against uninitialized memory.
REPORTER_ASSERT(r, !unflattenedFilter);