Move deprecated image filter headers out of include/ and into src/

Bug: skia:9310
Change-Id: I387f0251f05a2b6f2bc5a759f608d5766ed11ce2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/357285
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Reed <reed@google.com>
This commit is contained in:
Michael Ludwig 2021-01-22 13:01:26 -05:00 committed by Skia Commit-Bot
parent e1f72f9392
commit ed552f8702
48 changed files with 70 additions and 75 deletions

View File

@ -7,6 +7,10 @@ This file includes a list of high level updates for each milestone release.
Milestone 90
------------
* Remove deprecated SkImageFilter factory functions and supporting types. All default-provided
SkImageFilters are now only constructed via 'include/effects/SkImageFilters.h'
https://review.skia.org/357285
* Added SkRuntimeEffect::makeImage() to capture the output of an SkRuntimeEffect in an SkImage.
https://review.skia.org/357284

View File

@ -5,7 +5,7 @@
REG_FIDDLE(Paint_refImageFilter, 256, 256, true, 0) {
void draw(SkCanvas* canvas) {
SkPaint paint1, paint2;
paint1.setImageFilter(SkOffsetImageFilter::Make(25, 25, nullptr));
paint1.setImageFilter(SkImageFilters::Offset(25, 25, nullptr));
SkDebugf("image filter unique: %s\n", paint1.getImageFilter()->unique() ? "true" : "false");
paint2.setImageFilter(paint1.refImageFilter());
SkDebugf("image filter unique: %s\n", paint1.getImageFilter()->unique() ? "true" : "false");

View File

@ -11,7 +11,7 @@ void draw(SkCanvas* canvas) {
canvas->save();
canvas->clipRRect(rr, true);
sk_sp<SkImageFilter> filter = SkBlurImageFilter::Make(10, 10, nullptr);
sk_sp<SkImageFilter> filter = SkImageFilters::Blur(10, 10, nullptr);
SkPaint p;
p.setImageFilter(std::move(filter));

View File

@ -16,7 +16,7 @@ void draw(SkCanvas* canvas) {
canvas->drawImageRect(image, {0, 0, 128, 128}, &paint);
SkPaint paint2;
paint2.setImageFilter(SkColorFilterImageFilter::Make(saturate(), nullptr));
paint2.setImageFilter(SkImageFilters::ColorFilter(saturate(), nullptr));
SkAutoCanvasRestore autoCanvasRestore(canvas, false);
canvas->saveLayer(nullptr, &paint2);
canvas->drawImageRect(image, {128, 0, 256, 128}, nullptr);

View File

@ -12,7 +12,7 @@ void draw(SkCanvas* canvas) {
SkFont font(nullptr, 96);
offscreen.clear(0);
offscreen.drawString("e", 20, 70, font, paint);
paint.setImageFilter(SkLightingImageFilter::MakePointLitDiffuse(
paint.setImageFilter(SkImageFilters::PointLitDiffuse(
SkPoint3::Make(80, 100, 10), SK_ColorWHITE, 1, 2, nullptr, nullptr));
canvas->drawBitmap(bitmap, 0, 0, &paint);
}

View File

@ -7,42 +7,44 @@
_src = get_path_info("../src", "abspath")
_include = get_path_info("../include", "abspath")
skia_effects_imagefilter_public = [
"$_include/effects/SkAlphaThresholdFilter.h",
"$_include/effects/SkArithmeticImageFilter.h",
"$_include/effects/SkBlurImageFilter.h",
"$_include/effects/SkColorFilterImageFilter.h",
"$_include/effects/SkDisplacementMapEffect.h",
"$_include/effects/SkDropShadowImageFilter.h",
"$_include/effects/SkImageFilters.h",
"$_include/effects/SkImageSource.h",
"$_include/effects/SkLightingImageFilter.h",
"$_include/effects/SkMagnifierImageFilter.h",
"$_include/effects/SkMorphologyImageFilter.h",
"$_include/effects/SkOffsetImageFilter.h",
"$_include/effects/SkPaintImageFilter.h",
"$_include/effects/SkTileImageFilter.h",
"$_include/effects/SkXfermodeImageFilter.h",
]
skia_effects_imagefilter_public = [ "$_include/effects/SkImageFilters.h" ]
skia_effects_imagefilter_sources = [
"$_src/effects/imagefilters/SkAlphaThresholdFilter.cpp",
"$_src/effects/imagefilters/SkAlphaThresholdFilter.h",
"$_src/effects/imagefilters/SkArithmeticImageFilter.cpp",
"$_src/effects/imagefilters/SkArithmeticImageFilter.h",
"$_src/effects/imagefilters/SkBlurImageFilter.cpp",
"$_src/effects/imagefilters/SkBlurImageFilter.h",
"$_src/effects/imagefilters/SkColorFilterImageFilter.cpp",
"$_src/effects/imagefilters/SkColorFilterImageFilter.h",
"$_src/effects/imagefilters/SkComposeImageFilter.cpp",
"$_src/effects/imagefilters/SkComposeImageFilter.h",
"$_src/effects/imagefilters/SkDisplacementMapEffect.cpp",
"$_src/effects/imagefilters/SkDisplacementMapEffect.h",
"$_src/effects/imagefilters/SkDropShadowImageFilter.cpp",
"$_src/effects/imagefilters/SkDropShadowImageFilter.h",
"$_src/effects/imagefilters/SkImageFilters.cpp",
"$_src/effects/imagefilters/SkImageSource.cpp",
"$_src/effects/imagefilters/SkImageSource.h",
"$_src/effects/imagefilters/SkLightingImageFilter.cpp",
"$_src/effects/imagefilters/SkLightingImageFilter.h",
"$_src/effects/imagefilters/SkMagnifierImageFilter.cpp",
"$_src/effects/imagefilters/SkMagnifierImageFilter.h",
"$_src/effects/imagefilters/SkMatrixConvolutionImageFilter.cpp",
"$_src/effects/imagefilters/SkMatrixConvolutionImageFilter.h",
"$_src/effects/imagefilters/SkMergeImageFilter.cpp",
"$_src/effects/imagefilters/SkMergeImageFilter.h",
"$_src/effects/imagefilters/SkMorphologyImageFilter.cpp",
"$_src/effects/imagefilters/SkMorphologyImageFilter.h",
"$_src/effects/imagefilters/SkOffsetImageFilter.cpp",
"$_src/effects/imagefilters/SkOffsetImageFilter.h",
"$_src/effects/imagefilters/SkPaintImageFilter.cpp",
"$_src/effects/imagefilters/SkPaintImageFilter.h",
"$_src/effects/imagefilters/SkPictureImageFilter.cpp",
"$_src/effects/imagefilters/SkPictureImageFilter.h",
"$_src/effects/imagefilters/SkTileImageFilter.cpp",
"$_src/effects/imagefilters/SkTileImageFilter.h",
"$_src/effects/imagefilters/SkXfermodeImageFilter.cpp",
"$_src/effects/imagefilters/SkXfermodeImageFilter.h",
]

View File

@ -9,7 +9,6 @@
#include "include/core/SkCanvas.h"
#include "include/core/SkRect.h"
#include "include/effects/SkComposeImageFilter.h"
#include "include/private/SkSafe32.h"
#include "src/core/SkFuzzLogging.h"
#include "src/core/SkImageFilterCache.h"

View File

@ -5,7 +5,7 @@
* found in the LICENSE file.
*/
#include "include/effects/SkAlphaThresholdFilter.h"
#include "src/effects/imagefilters/SkAlphaThresholdFilter.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkRegion.h"

View File

@ -5,17 +5,17 @@
* found in the LICENSE file.
*/
#include "include/effects/SkArithmeticImageFilter.h"
#include "src/effects/imagefilters/SkArithmeticImageFilter.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/effects/SkXfermodeImageFilter.h"
#include "include/private/SkNx.h"
#include "src/core/SkImageFilter_Base.h"
#include "src/core/SkReadBuffer.h"
#include "src/core/SkSpecialImage.h"
#include "src/core/SkSpecialSurface.h"
#include "src/core/SkWriteBuffer.h"
#include "src/effects/imagefilters/SkXfermodeImageFilter.h"
#if SK_SUPPORT_GPU
#include "include/effects/SkRuntimeEffect.h"
#include "include/gpu/GrRecordingContext.h"

View File

@ -5,7 +5,7 @@
* found in the LICENSE file.
*/
#include "include/effects/SkBlurImageFilter.h"
#include "src/effects/imagefilters/SkBlurImageFilter.h"
#include <algorithm>

View File

@ -5,7 +5,7 @@
* found in the LICENSE file.
*/
#include "include/effects/SkColorFilterImageFilter.h"
#include "src/effects/imagefilters/SkColorFilterImageFilter.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColorFilter.h"

View File

@ -5,7 +5,7 @@
* found in the LICENSE file.
*/
#include "include/effects/SkComposeImageFilter.h"
#include "src/effects/imagefilters/SkComposeImageFilter.h"
#include "src/core/SkImageFilter_Base.h"
#include "src/core/SkReadBuffer.h"

View File

@ -5,7 +5,7 @@
* found in the LICENSE file.
*/
#include "include/effects/SkDisplacementMapEffect.h"
#include "src/effects/imagefilters/SkDisplacementMapEffect.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkUnPreMultiply.h"

View File

@ -5,15 +5,15 @@
* found in the LICENSE file.
*/
#include "include/effects/SkDropShadowImageFilter.h"
#include "src/effects/imagefilters/SkDropShadowImageFilter.h"
#include "include/core/SkCanvas.h"
#include "include/effects/SkBlurImageFilter.h"
#include "src/core/SkImageFilter_Base.h"
#include "src/core/SkReadBuffer.h"
#include "src/core/SkSpecialImage.h"
#include "src/core/SkSpecialSurface.h"
#include "src/core/SkWriteBuffer.h"
#include "src/effects/imagefilters/SkBlurImageFilter.h"
namespace {
@ -180,4 +180,3 @@ SkIRect SkDropShadowImageFilterImpl::onFilterNodeBounds(
}
return dst;
}

View File

@ -9,30 +9,24 @@
#include "include/core/SkPaint.h"
// TODO (michaelludwig) - Right now there is a bit of a weird dependency where the implementations
// of the new, preferred filter factories depends on the per-filter headers in include/effects,
// which have themselves been marked as deprecated. But, once clients are updated to use the
// new factories implemented in this file, the per-filter headers can go into
// src/effects/imagefilters and will no longer be "deprecated" since they've been made fully
// internal at that point.
#include "include/effects/SkAlphaThresholdFilter.h"
#include "include/effects/SkArithmeticImageFilter.h"
#include "include/effects/SkBlurImageFilter.h"
#include "include/effects/SkColorFilterImageFilter.h"
#include "include/effects/SkComposeImageFilter.h"
#include "include/effects/SkDisplacementMapEffect.h"
#include "include/effects/SkDropShadowImageFilter.h"
#include "include/effects/SkImageSource.h"
#include "include/effects/SkLightingImageFilter.h"
#include "include/effects/SkMagnifierImageFilter.h"
#include "include/effects/SkMatrixConvolutionImageFilter.h"
#include "include/effects/SkMergeImageFilter.h"
#include "include/effects/SkMorphologyImageFilter.h"
#include "include/effects/SkOffsetImageFilter.h"
#include "include/effects/SkPaintImageFilter.h"
#include "include/effects/SkPictureImageFilter.h"
#include "include/effects/SkTileImageFilter.h"
#include "include/effects/SkXfermodeImageFilter.h"
#include "src/effects/imagefilters/SkAlphaThresholdFilter.h"
#include "src/effects/imagefilters/SkArithmeticImageFilter.h"
#include "src/effects/imagefilters/SkBlurImageFilter.h"
#include "src/effects/imagefilters/SkColorFilterImageFilter.h"
#include "src/effects/imagefilters/SkComposeImageFilter.h"
#include "src/effects/imagefilters/SkDisplacementMapEffect.h"
#include "src/effects/imagefilters/SkDropShadowImageFilter.h"
#include "src/effects/imagefilters/SkImageSource.h"
#include "src/effects/imagefilters/SkLightingImageFilter.h"
#include "src/effects/imagefilters/SkMagnifierImageFilter.h"
#include "src/effects/imagefilters/SkMatrixConvolutionImageFilter.h"
#include "src/effects/imagefilters/SkMergeImageFilter.h"
#include "src/effects/imagefilters/SkMorphologyImageFilter.h"
#include "src/effects/imagefilters/SkOffsetImageFilter.h"
#include "src/effects/imagefilters/SkPaintImageFilter.h"
#include "src/effects/imagefilters/SkPictureImageFilter.h"
#include "src/effects/imagefilters/SkTileImageFilter.h"
#include "src/effects/imagefilters/SkXfermodeImageFilter.h"
// TODO (michaelludwig) - Once SkCanvas can draw the results of a filter with any transform, this
// filter can be moved out of core

View File

@ -5,7 +5,7 @@
* found in the LICENSE file.
*/
#include "include/effects/SkImageSource.h"
#include "src/effects/imagefilters/SkImageSource.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkImage.h"

View File

@ -5,7 +5,7 @@
* found in the LICENSE file.
*/
#include "include/effects/SkLightingImageFilter.h"
#include "src/effects/imagefilters/SkLightingImageFilter.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkPoint3.h"

View File

@ -5,7 +5,7 @@
* found in the LICENSE file.
*/
#include "include/effects/SkMagnifierImageFilter.h"
#include "src/effects/imagefilters/SkMagnifierImageFilter.h"
#include "include/core/SkBitmap.h"
#include "include/private/SkColorData.h"

View File

@ -5,7 +5,7 @@
* found in the LICENSE file.
*/
#include "include/effects/SkMatrixConvolutionImageFilter.h"
#include "src/effects/imagefilters/SkMatrixConvolutionImageFilter.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkRect.h"

View File

@ -5,7 +5,7 @@
* found in the LICENSE file.
*/
#include "include/effects/SkMergeImageFilter.h"
#include "src/effects/imagefilters/SkMergeImageFilter.h"
#include "include/core/SkCanvas.h"
#include "src/core/SkImageFilter_Base.h"

View File

@ -5,7 +5,7 @@
* found in the LICENSE file.
*/
#include "include/effects/SkMorphologyImageFilter.h"
#include "src/effects/imagefilters/SkMorphologyImageFilter.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkRect.h"

View File

@ -5,7 +5,7 @@
* found in the LICENSE file.
*/
#include "include/effects/SkOffsetImageFilter.h"
#include "src/effects/imagefilters/SkOffsetImageFilter.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkMatrix.h"

View File

@ -5,7 +5,7 @@
* found in the LICENSE file.
*/
#include "include/effects/SkPaintImageFilter.h"
#include "src/effects/imagefilters/SkPaintImageFilter.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkPaint.h"

View File

@ -5,11 +5,10 @@
* found in the LICENSE file.
*/
#include "include/effects/SkPictureImageFilter.h"
#include "src/effects/imagefilters/SkPictureImageFilter.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkPicture.h"
#include "include/effects/SkImageSource.h"
#include "src/core/SkImageFilter_Base.h"
#include "src/core/SkPicturePriv.h"
#include "src/core/SkReadBuffer.h"

View File

@ -5,7 +5,7 @@
* found in the LICENSE file.
*/
#include "include/effects/SkTileImageFilter.h"
#include "src/effects/imagefilters/SkTileImageFilter.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkImage.h"
@ -13,13 +13,13 @@
#include "include/core/SkPaint.h"
#include "include/core/SkShader.h"
#include "include/core/SkSurface.h"
#include "include/effects/SkOffsetImageFilter.h"
#include "src/core/SkImageFilter_Base.h"
#include "src/core/SkReadBuffer.h"
#include "src/core/SkSpecialImage.h"
#include "src/core/SkSpecialSurface.h"
#include "src/core/SkValidationUtils.h"
#include "src/core/SkWriteBuffer.h"
#include "src/effects/imagefilters/SkOffsetImageFilter.h"
namespace {
@ -188,4 +188,3 @@ SkIRect SkTileImageFilterImpl::onFilterBounds(const SkIRect& src, const SkMatrix
SkRect SkTileImageFilterImpl::computeFastBounds(const SkRect& src) const {
return fDstRect;
}

View File

@ -5,7 +5,7 @@
* found in the LICENSE file.
*/
#include "include/effects/SkXfermodeImageFilter.h"
#include "src/effects/imagefilters/SkXfermodeImageFilter.h"
#include "include/core/SkCanvas.h"
#include "include/private/SkColorData.h"

View File

@ -6,7 +6,7 @@
*/
@header {
#include "include/effects/SkArithmeticImageFilter.h"
#include "src/effects/imagefilters/SkArithmeticImageFilter.h"
}
in fragmentProcessor srcFP;

View File

@ -236,7 +236,6 @@ GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrSkSLFP);
#if GR_TEST_UTILS
#include "include/effects/SkArithmeticImageFilter.h"
#include "include/effects/SkOverdrawColorFilter.h"
#include "src/core/SkColorFilterBase.h"
#include "src/gpu/effects/generated/GrConstColorProcessor.h"

View File

@ -14,7 +14,7 @@
#include "include/core/SkM44.h"
#include "include/core/SkTypes.h"
#include "include/effects/SkArithmeticImageFilter.h"
#include "src/effects/imagefilters/SkArithmeticImageFilter.h"
#include "src/gpu/GrFragmentProcessor.h"

View File

@ -17,7 +17,7 @@
#include "include/core/SkScalar.h"
#include "include/core/SkStream.h"
#include "include/core/SkTypes.h"
#include "include/effects/SkMorphologyImageFilter.h"
#include "include/effects/SkImageFilters.h"
#include "include/effects/SkPerlinNoiseShader.h"
#include "include/private/SkTo.h"
#include "src/core/SkGlyphRun.h"
@ -453,7 +453,7 @@ DEF_TEST(fuzz875632f0, reporter) {
SkAutoCanvasRestore autoCanvasRestore(canvas, false);
SkPaint layerPaint({0, 0, 0, 0});
layerPaint.setImageFilter(SkDilateImageFilter::Make(536870912, 0, nullptr, nullptr));
layerPaint.setImageFilter(SkImageFilters::Dilate(536870912, 0, nullptr, nullptr));
layerPaint.setBlendMode(SkBlendMode::kClear);
canvas->saveLayer(nullptr, &layerPaint);