Delete deprecated SkLightingImageFilter header
Bug: skia:11230 Change-Id: I8983d160ff0317514572d13aa2a3f1218e15da8e Reviewed-on: https://skia-review.googlesource.com/c/skia/+/371959 Commit-Queue: Michael Ludwig <michaelludwig@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
This commit is contained in:
parent
af8db303f7
commit
a50940da6d
@ -21,7 +21,6 @@ skia_effects_imagefilter_sources = [
|
||||
"$_src/effects/imagefilters/SkImageFilters.cpp",
|
||||
"$_src/effects/imagefilters/SkImageImageFilter.cpp",
|
||||
"$_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",
|
||||
|
@ -492,5 +492,6 @@ void SkRegisterComposeImageFilterFlattenable();
|
||||
void SkRegisterDisplacementMapImageFilterFlattenable();
|
||||
void SkRegisterDropShadowImageFilterFlattenable();
|
||||
void SkRegisterImageImageFilterFlattenable();
|
||||
void SkRegisterLightingImageFilterFlattenables();
|
||||
|
||||
#endif // SkImageFilter_Base_DEFINED
|
||||
|
@ -9,7 +9,6 @@
|
||||
|
||||
#include "include/core/SkPaint.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"
|
||||
@ -25,7 +24,6 @@
|
||||
|
||||
void SkImageFilters::RegisterFlattenables() {
|
||||
SkDilateImageFilter::RegisterFlattenables();
|
||||
SkLightingImageFilter::RegisterFlattenables();
|
||||
SkMagnifierImageFilter::RegisterFlattenables();
|
||||
SkMatrixConvolutionImageFilter::RegisterFlattenables();
|
||||
SkMergeImageFilter::RegisterFlattenables();
|
||||
@ -121,51 +119,3 @@ sk_sp<SkImageFilter> SkImageFilters::Erode(
|
||||
SkScalar radiusX, SkScalar radiusY, sk_sp<SkImageFilter> input, const CropRect& cropRect) {
|
||||
return SkErodeImageFilter::Make(radiusX, radiusY, std::move(input), cropRect);
|
||||
}
|
||||
|
||||
// Lighting filter effects
|
||||
|
||||
sk_sp<SkImageFilter> SkImageFilters::DistantLitDiffuse(
|
||||
const SkPoint3& direction, SkColor lightColor, SkScalar surfaceScale, SkScalar kd,
|
||||
sk_sp<SkImageFilter> input, const CropRect& cropRect) {
|
||||
return SkLightingImageFilter::MakeDistantLitDiffuse(direction, lightColor, surfaceScale, kd,
|
||||
std::move(input), cropRect);
|
||||
}
|
||||
|
||||
sk_sp<SkImageFilter> SkImageFilters::PointLitDiffuse(
|
||||
const SkPoint3& location, SkColor lightColor, SkScalar surfaceScale, SkScalar kd,
|
||||
sk_sp<SkImageFilter> input, const CropRect& cropRect) {
|
||||
return SkLightingImageFilter::MakePointLitDiffuse(location, lightColor, surfaceScale, kd,
|
||||
std::move(input), cropRect);
|
||||
}
|
||||
|
||||
sk_sp<SkImageFilter> SkImageFilters::SpotLitDiffuse(
|
||||
const SkPoint3& location, const SkPoint3& target, SkScalar falloffExponent,
|
||||
SkScalar cutoffAngle, SkColor lightColor, SkScalar surfaceScale, SkScalar kd,
|
||||
sk_sp<SkImageFilter> input, const CropRect& cropRect) {
|
||||
return SkLightingImageFilter::MakeSpotLitDiffuse(location, target, falloffExponent, cutoffAngle,
|
||||
lightColor, surfaceScale, kd,
|
||||
std::move(input), cropRect);
|
||||
}
|
||||
|
||||
sk_sp<SkImageFilter> SkImageFilters::DistantLitSpecular(
|
||||
const SkPoint3& direction, SkColor lightColor, SkScalar surfaceScale, SkScalar ks,
|
||||
SkScalar shininess, sk_sp<SkImageFilter> input, const CropRect& cropRect) {
|
||||
return SkLightingImageFilter::MakeDistantLitSpecular(direction, lightColor, surfaceScale,
|
||||
ks, shininess, std::move(input), cropRect);
|
||||
}
|
||||
|
||||
sk_sp<SkImageFilter> SkImageFilters::PointLitSpecular(
|
||||
const SkPoint3& location, SkColor lightColor, SkScalar surfaceScale, SkScalar ks,
|
||||
SkScalar shininess, sk_sp<SkImageFilter> input, const CropRect& cropRect) {
|
||||
return SkLightingImageFilter::MakePointLitSpecular(location, lightColor, surfaceScale, ks,
|
||||
shininess, std::move(input), cropRect);
|
||||
}
|
||||
|
||||
sk_sp<SkImageFilter> SkImageFilters::SpotLitSpecular(
|
||||
const SkPoint3& location, const SkPoint3& target, SkScalar falloffExponent,
|
||||
SkScalar cutoffAngle, SkColor lightColor, SkScalar surfaceScale, SkScalar ks,
|
||||
SkScalar shininess, sk_sp<SkImageFilter> input, const CropRect& cropRect) {
|
||||
return SkLightingImageFilter::MakeSpotLitSpecular(location, target, falloffExponent,
|
||||
cutoffAngle, lightColor, surfaceScale,
|
||||
ks, shininess, std::move(input), cropRect);
|
||||
}
|
||||
|
@ -5,11 +5,10 @@
|
||||
* found in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "src/effects/imagefilters/SkLightingImageFilter.h"
|
||||
|
||||
#include "include/core/SkBitmap.h"
|
||||
#include "include/core/SkPoint3.h"
|
||||
#include "include/core/SkTypes.h"
|
||||
#include "include/effects/SkImageFilters.h"
|
||||
#include "include/private/SkColorData.h"
|
||||
#include "include/private/SkTPin.h"
|
||||
#include "src/core/SkImageFilter_Base.h"
|
||||
@ -566,7 +565,7 @@ protected:
|
||||
|
||||
private:
|
||||
SK_FLATTENABLE_HOOKS(SkDiffuseLightingImageFilter)
|
||||
friend class SkLightingImageFilter;
|
||||
friend void ::SkRegisterLightingImageFilterFlattenables();
|
||||
SkScalar fKD;
|
||||
|
||||
using INHERITED = SkLightingImageFilterInternal;
|
||||
@ -601,10 +600,11 @@ protected:
|
||||
|
||||
private:
|
||||
SK_FLATTENABLE_HOOKS(SkSpecularLightingImageFilter)
|
||||
friend void ::SkRegisterLightingImageFilterFlattenables();
|
||||
|
||||
SkScalar fKS;
|
||||
SkScalar fShininess;
|
||||
friend class SkLightingImageFilter;
|
||||
|
||||
using INHERITED = SkLightingImageFilterInternal;
|
||||
};
|
||||
|
||||
@ -1140,58 +1140,63 @@ void SkImageFilterLight::flattenLight(SkWriteBuffer& buffer) const {
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
sk_sp<SkImageFilter> SkLightingImageFilter::MakeDistantLitDiffuse(
|
||||
sk_sp<SkImageFilter> SkImageFilters::DistantLitDiffuse(
|
||||
const SkPoint3& direction, SkColor lightColor, SkScalar surfaceScale, SkScalar kd,
|
||||
sk_sp<SkImageFilter> input, const SkRect* cropRect) {
|
||||
sk_sp<SkImageFilter> input, const CropRect& cropRect) {
|
||||
sk_sp<SkImageFilterLight> light(new SkDistantLight(direction, lightColor));
|
||||
return SkDiffuseLightingImageFilter::Make(std::move(light), surfaceScale, kd,
|
||||
std::move(input), cropRect);
|
||||
}
|
||||
|
||||
sk_sp<SkImageFilter> SkLightingImageFilter::MakePointLitDiffuse(
|
||||
sk_sp<SkImageFilter> SkImageFilters::PointLitDiffuse(
|
||||
const SkPoint3& location, SkColor lightColor, SkScalar surfaceScale, SkScalar kd,
|
||||
sk_sp<SkImageFilter> input, const SkRect* cropRect) {
|
||||
sk_sp<SkImageFilter> input, const CropRect& cropRect) {
|
||||
sk_sp<SkImageFilterLight> light(new SkPointLight(location, lightColor));
|
||||
return SkDiffuseLightingImageFilter::Make(std::move(light), surfaceScale, kd,
|
||||
std::move(input), cropRect);
|
||||
}
|
||||
|
||||
sk_sp<SkImageFilter> SkLightingImageFilter::MakeSpotLitDiffuse(
|
||||
const SkPoint3& location, const SkPoint3& target, SkScalar specularExponent,
|
||||
sk_sp<SkImageFilter> SkImageFilters::SpotLitDiffuse(
|
||||
const SkPoint3& location, const SkPoint3& target, SkScalar falloffExponent,
|
||||
SkScalar cutoffAngle, SkColor lightColor, SkScalar surfaceScale, SkScalar kd,
|
||||
sk_sp<SkImageFilter> input, const SkRect* cropRect) {
|
||||
sk_sp<SkImageFilterLight> light(
|
||||
new SkSpotLight(location, target, specularExponent, cutoffAngle, lightColor));
|
||||
sk_sp<SkImageFilter> input, const CropRect& cropRect) {
|
||||
sk_sp<SkImageFilterLight> light(new SkSpotLight(location, target, falloffExponent,
|
||||
cutoffAngle, lightColor));
|
||||
return SkDiffuseLightingImageFilter::Make(std::move(light), surfaceScale, kd,
|
||||
std::move(input), cropRect);
|
||||
}
|
||||
|
||||
sk_sp<SkImageFilter> SkLightingImageFilter::MakeDistantLitSpecular(
|
||||
const SkPoint3& direction, SkColor lightColor, SkScalar surfaceScale, SkScalar ks,
|
||||
SkScalar shininess, sk_sp<SkImageFilter> input, const SkRect* cropRect) {
|
||||
sk_sp<SkImageFilter> SkImageFilters::DistantLitSpecular(
|
||||
const SkPoint3& direction, SkColor lightColor, SkScalar surfaceScale, SkScalar ks,
|
||||
SkScalar shininess, sk_sp<SkImageFilter> input, const CropRect& cropRect) {
|
||||
sk_sp<SkImageFilterLight> light(new SkDistantLight(direction, lightColor));
|
||||
return SkSpecularLightingImageFilter::Make(std::move(light), surfaceScale, ks, shininess,
|
||||
std::move(input), cropRect);
|
||||
}
|
||||
|
||||
sk_sp<SkImageFilter> SkLightingImageFilter::MakePointLitSpecular(
|
||||
sk_sp<SkImageFilter> SkImageFilters::PointLitSpecular(
|
||||
const SkPoint3& location, SkColor lightColor, SkScalar surfaceScale, SkScalar ks,
|
||||
SkScalar shininess, sk_sp<SkImageFilter> input, const SkRect* cropRect) {
|
||||
SkScalar shininess, sk_sp<SkImageFilter> input, const CropRect& cropRect) {
|
||||
sk_sp<SkImageFilterLight> light(new SkPointLight(location, lightColor));
|
||||
return SkSpecularLightingImageFilter::Make(std::move(light), surfaceScale, ks, shininess,
|
||||
std::move(input), cropRect);
|
||||
}
|
||||
|
||||
sk_sp<SkImageFilter> SkLightingImageFilter::MakeSpotLitSpecular(
|
||||
const SkPoint3& location, const SkPoint3& target, SkScalar specularExponent,
|
||||
sk_sp<SkImageFilter> SkImageFilters::SpotLitSpecular(
|
||||
const SkPoint3& location, const SkPoint3& target, SkScalar falloffExponent,
|
||||
SkScalar cutoffAngle, SkColor lightColor, SkScalar surfaceScale, SkScalar ks,
|
||||
SkScalar shininess, sk_sp<SkImageFilter> input, const SkRect* cropRect) {
|
||||
sk_sp<SkImageFilterLight> light(
|
||||
new SkSpotLight(location, target, specularExponent, cutoffAngle, lightColor));
|
||||
SkScalar shininess, sk_sp<SkImageFilter> input, const CropRect& cropRect) {
|
||||
sk_sp<SkImageFilterLight> light(new SkSpotLight(location, target, falloffExponent,
|
||||
cutoffAngle, lightColor));
|
||||
return SkSpecularLightingImageFilter::Make(std::move(light), surfaceScale, ks, shininess,
|
||||
std::move(input), cropRect);
|
||||
}
|
||||
|
||||
void SkRegisterLightingImageFilterFlattenables() {
|
||||
SK_REGISTER_FLATTENABLE(SkDiffuseLightingImageFilter);
|
||||
SK_REGISTER_FLATTENABLE(SkSpecularLightingImageFilter);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
sk_sp<SkImageFilter> SkDiffuseLightingImageFilter::Make(sk_sp<SkImageFilterLight> light,
|
||||
@ -2109,8 +2114,3 @@ void GrGLSpotLight::emitLightColor(const GrFragmentProcessor* owner,
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void SkLightingImageFilter::RegisterFlattenables() {
|
||||
SK_REGISTER_FLATTENABLE(SkDiffuseLightingImageFilter);
|
||||
SK_REGISTER_FLATTENABLE(SkSpecularLightingImageFilter);
|
||||
}
|
||||
|
@ -1,46 +0,0 @@
|
||||
/*
|
||||
* Copyright 2012 The Android Open Source Project
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license that can be
|
||||
* found in the LICENSE file.
|
||||
*/
|
||||
|
||||
#ifndef SkLightingImageFilter_DEFINED
|
||||
#define SkLightingImageFilter_DEFINED
|
||||
|
||||
#include "include/core/SkColor.h"
|
||||
#include "include/core/SkImageFilter.h"
|
||||
|
||||
struct SkPoint3;
|
||||
|
||||
// DEPRECATED: Use include/effects/SkImageFilters::[Diffuse|Specular]Light[Distant|Point|Spot]
|
||||
class SK_API SkLightingImageFilter {
|
||||
public:
|
||||
static sk_sp<SkImageFilter> MakeDistantLitDiffuse(const SkPoint3& direction,
|
||||
SkColor lightColor, SkScalar surfaceScale, SkScalar kd,
|
||||
sk_sp<SkImageFilter> input, const SkRect* cropRect = nullptr);
|
||||
static sk_sp<SkImageFilter> MakePointLitDiffuse(const SkPoint3& location,
|
||||
SkColor lightColor, SkScalar surfaceScale, SkScalar kd,
|
||||
sk_sp<SkImageFilter> input, const SkRect* cropRect = nullptr);
|
||||
static sk_sp<SkImageFilter> MakeSpotLitDiffuse(const SkPoint3& location,
|
||||
const SkPoint3& target, SkScalar specularExponent, SkScalar cutoffAngle,
|
||||
SkColor lightColor, SkScalar surfaceScale, SkScalar kd,
|
||||
sk_sp<SkImageFilter> input, const SkRect* cropRect = nullptr);
|
||||
static sk_sp<SkImageFilter> MakeDistantLitSpecular(const SkPoint3& direction,
|
||||
SkColor lightColor, SkScalar surfaceScale, SkScalar ks, SkScalar shininess,
|
||||
sk_sp<SkImageFilter> input, const SkRect* cropRect = nullptr);
|
||||
static sk_sp<SkImageFilter> MakePointLitSpecular(const SkPoint3& location,
|
||||
SkColor lightColor, SkScalar surfaceScale, SkScalar ks, SkScalar shininess,
|
||||
sk_sp<SkImageFilter> input, const SkRect* cropRect = nullptr);
|
||||
static sk_sp<SkImageFilter> MakeSpotLitSpecular(const SkPoint3& location,
|
||||
const SkPoint3& target, SkScalar specularExponent, SkScalar cutoffAngle,
|
||||
SkColor lightColor, SkScalar surfaceScale, SkScalar ks, SkScalar shininess,
|
||||
sk_sp<SkImageFilter> input, const SkRect* cropRect = nullptr);
|
||||
|
||||
static void RegisterFlattenables();
|
||||
|
||||
private:
|
||||
SkLightingImageFilter() = delete;
|
||||
};
|
||||
|
||||
#endif
|
@ -125,6 +125,7 @@
|
||||
SkRegisterDisplacementMapImageFilterFlattenable();
|
||||
SkRegisterDropShadowImageFilterFlattenable();
|
||||
SkRegisterImageImageFilterFlattenable();
|
||||
SkRegisterLightingImageFilterFlattenables();
|
||||
SK_REGISTER_FLATTENABLE(SkLocalMatrixImageFilter);
|
||||
SK_REGISTER_FLATTENABLE(SkMatrixImageFilter);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user