| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 The Android Open Source Project | 2 * Copyright 2012 The Android Open Source Project |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkLightingImageFilter_DEFINED | 8 #ifndef SkLightingImageFilter_DEFINED |
| 9 #define SkLightingImageFilter_DEFINED | 9 #define SkLightingImageFilter_DEFINED |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 static sk_sp<SkImageFilter> MakeDistantLitSpecular(const SkPoint3& direction
, | 30 static sk_sp<SkImageFilter> MakeDistantLitSpecular(const SkPoint3& direction
, |
| 31 SkColor lightColor, SkScalar surfaceScale, SkScalar ks, | 31 SkColor lightColor, SkScalar surfaceScale, SkScalar ks, |
| 32 SkScalar shininess, sk_sp<SkImageFilter> input, const CropRect* cropRect
= nullptr); | 32 SkScalar shininess, sk_sp<SkImageFilter> input, const CropRect* cropRect
= nullptr); |
| 33 static sk_sp<SkImageFilter> MakePointLitSpecular(const SkPoint3& location, | 33 static sk_sp<SkImageFilter> MakePointLitSpecular(const SkPoint3& location, |
| 34 SkColor lightColor, SkScalar surfaceScale, SkScalar ks, | 34 SkColor lightColor, SkScalar surfaceScale, SkScalar ks, |
| 35 SkScalar shininess, sk_sp<SkImageFilter> input, const CropRect* cropRect
= nullptr); | 35 SkScalar shininess, sk_sp<SkImageFilter> input, const CropRect* cropRect
= nullptr); |
| 36 static sk_sp<SkImageFilter> MakeSpotLitSpecular(const SkPoint3& location, | 36 static sk_sp<SkImageFilter> MakeSpotLitSpecular(const SkPoint3& location, |
| 37 const SkPoint3& target, SkScalar specularExponent, SkScalar cutoffAngle, | 37 const SkPoint3& target, SkScalar specularExponent, SkScalar cutoffAngle, |
| 38 SkColor lightColor, SkScalar surfaceScale, SkScalar ks, | 38 SkColor lightColor, SkScalar surfaceScale, SkScalar ks, |
| 39 SkScalar shininess, sk_sp<SkImageFilter> input, const CropRect* cropRect
= nullptr); | 39 SkScalar shininess, sk_sp<SkImageFilter> input, const CropRect* cropRect
= nullptr); |
| 40 ~SkLightingImageFilter() override; |
| 40 | 41 |
| 41 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() | 42 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() |
| 42 | 43 |
| 43 #ifdef SK_SUPPORT_LEGACY_IMAGEFILTER_PTR | 44 #ifdef SK_SUPPORT_LEGACY_IMAGEFILTER_PTR |
| 44 static SkImageFilter* CreateDistantLitDiffuse(const SkPoint3& direction, | 45 static SkImageFilter* CreateDistantLitDiffuse(const SkPoint3& direction, |
| 45 SkColor lightColor, SkScalar surfaceScale, SkScalar kd, | 46 SkColor lightColor, SkScalar surfaceScale, SkScalar kd, |
| 46 SkImageFilter* input = NULL, const CropRect* cropRect = NULL) { | 47 SkImageFilter* input = NULL, const CropRect* cropRect = NULL) { |
| 47 return MakeDistantLitDiffuse(direction, lightColor, surfaceScale, kd, | 48 return MakeDistantLitDiffuse(direction, lightColor, surfaceScale, kd, |
| 48 sk_ref_sp<SkImageFilter>(input), cropRect).
release(); | 49 sk_ref_sp<SkImageFilter>(input), cropRect).
release(); |
| 49 } | 50 } |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 bool affectsTransparentBlack() const override { return true; } | 95 bool affectsTransparentBlack() const override { return true; } |
| 95 | 96 |
| 96 private: | 97 private: |
| 97 sk_sp<SkImageFilterLight> fLight; | 98 sk_sp<SkImageFilterLight> fLight; |
| 98 SkScalar fSurfaceScale; | 99 SkScalar fSurfaceScale; |
| 99 | 100 |
| 100 typedef SkImageFilter INHERITED; | 101 typedef SkImageFilter INHERITED; |
| 101 }; | 102 }; |
| 102 | 103 |
| 103 #endif | 104 #endif |
| OLD | NEW |