Remove unnecessary SkImageFilters.cpp

After having moved all other filter factory definitions into their
per-filter implementation files, all that remained was the
MatrixTransform factory, which is just moved into the
SkMatrixImageFilter CPP file.

Bug: skia:11230
Change-Id: Ifd7f3eb58ef1d05ed6d0aef0517ca9caa01436d8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372121
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
This commit is contained in:
Michael Ludwig 2021-02-18 14:04:55 -05:00 committed by Skia Commit-Bot
parent 1cc7d45f9a
commit 1f57a0f1ae
4 changed files with 20 additions and 31 deletions

View File

@ -18,7 +18,6 @@ skia_effects_imagefilter_sources = [
"$_src/effects/imagefilters/SkComposeImageFilter.cpp",
"$_src/effects/imagefilters/SkDisplacementMapImageFilter.cpp",
"$_src/effects/imagefilters/SkDropShadowImageFilter.cpp",
"$_src/effects/imagefilters/SkImageFilters.cpp",
"$_src/effects/imagefilters/SkImageImageFilter.cpp",
"$_src/effects/imagefilters/SkLightingImageFilter.cpp",
"$_src/effects/imagefilters/SkMagnifierImageFilter.cpp",

View File

@ -9,6 +9,7 @@
#include "include/core/SkCanvas.h"
#include "include/core/SkRect.h"
#include "include/effects/SkImageFilters.h"
#include "src/core/SkReadBuffer.h"
#include "src/core/SkSamplingPriv.h"
#include "src/core/SkSpecialImage.h"
@ -31,6 +32,20 @@ sk_sp<SkImageFilter> SkMatrixImageFilter::Make(const SkMatrix& transform,
std::move(input)));
}
sk_sp<SkImageFilter> SkImageFilters::MatrixTransform(
const SkMatrix& transform, const SkSamplingOptions& sampling, sk_sp<SkImageFilter> input) {
return SkMatrixImageFilter::Make(transform, sampling, std::move(input));
}
#ifdef SK_SUPPORT_LEGACY_MATRIX_IMAGEFILTER
sk_sp<SkImageFilter> SkImageFilters::MatrixTransform(
const SkMatrix& transform, SkFilterQuality filterQuality, sk_sp<SkImageFilter> input) {
auto sampling = SkSamplingOptions(filterQuality,
SkSamplingOptions::kMedium_asMipmapLinear);
return SkMatrixImageFilter::Make(transform, sampling, std::move(input));
}
#endif
sk_sp<SkFlattenable> SkMatrixImageFilter::CreateProc(SkReadBuffer& buffer) {
SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1);
SkMatrix matrix;
@ -53,6 +68,8 @@ void SkMatrixImageFilter::flatten(SkWriteBuffer& buffer) const {
SkSamplingPriv::Write(buffer, fSampling);
}
///////////////////////////////////////////////////////////////////////////////////////////////////
sk_sp<SkSpecialImage> SkMatrixImageFilter::onFilterImage(const Context& ctx,
SkIPoint* offset) const {

View File

@ -17,6 +17,9 @@
input transformed by the given matrix.
*/
// TODO(michaelludwig): Once SkCanvas no longer relies on this for handling complex CTMs with
// filters, this class declaration can be hidden in its cpp file, header deleted, and cpp moved
// into src/effects/imagefilters along with all the other image filters.
class SkMatrixImageFilter : public SkImageFilter_Base {
public:
/** Construct a 2D transformation image filter.

View File

@ -1,30 +0,0 @@
/*
* Copyright 2019 Google LLC
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "include/effects/SkImageFilters.h"
#include "include/core/SkPaint.h"
// TODO (michaelludwig) - Once SkCanvas can draw the results of a filter with any transform, this
// filter can be moved out of core
#include "src/core/SkMatrixImageFilter.h"
///////////////////////////////////////////////////////////////////////////////////////////////////
sk_sp<SkImageFilter> SkImageFilters::MatrixTransform(
const SkMatrix& transform, const SkSamplingOptions& sampling, sk_sp<SkImageFilter> input) {
return SkMatrixImageFilter::Make(transform, sampling, std::move(input));
}
#ifdef SK_SUPPORT_LEGACY_MATRIX_IMAGEFILTER
sk_sp<SkImageFilter> SkImageFilters::MatrixTransform(
const SkMatrix& transform, SkFilterQuality filterQuality, sk_sp<SkImageFilter> input) {
auto sampling = SkSamplingOptions(filterQuality,
SkSamplingOptions::kMedium_asMipmapLinear);
return SkMatrixImageFilter::Make(transform, sampling, std::move(input));
}
#endif