| 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 | 8 |
| 9 #ifndef SkLightingImageFilter_DEFINED | 9 #ifndef SkLightingImageFilter_DEFINED |
| 10 #define SkLightingImageFilter_DEFINED | 10 #define SkLightingImageFilter_DEFINED |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 } | 42 } |
| 43 bool operator==(const SkPoint3& other) const { | 43 bool operator==(const SkPoint3& other) const { |
| 44 return fX == other.fX && fY == other.fY && fZ == other.fZ; | 44 return fX == other.fX && fY == other.fY && fZ == other.fZ; |
| 45 } | 45 } |
| 46 SkScalar fX, fY, fZ; | 46 SkScalar fX, fY, fZ; |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 class SkLight; | 49 class SkLight; |
| 50 | 50 |
| 51 class SK_API SkLightingImageFilter : public SkImageFilter { | 51 class SK_API SkLightingImageFilter : public SkImageFilter { |
| 52 typedef SkImageFilter INHERITED; |
| 53 |
| 52 public: | 54 public: |
| 53 static SkImageFilter* CreateDistantLitDiffuse(const SkPoint3& direction, | 55 static SkImageFilter* CreateDistantLitDiffuse(const SkPoint3& direction, |
| 54 SkColor lightColor, SkScalar surfaceScale, SkScalar kd, | 56 SkColor lightColor, SkScalar surfaceScale, SkScalar kd, |
| 55 SkImageFilter* input = NULL, const SkIRect* cropRect = NULL); | 57 SkImageFilter* input = NULL, const SkIRect* cropRect = NULL); |
| 56 static SkImageFilter* CreatePointLitDiffuse(const SkPoint3& location, | 58 static SkImageFilter* CreatePointLitDiffuse(const SkPoint3& location, |
| 57 SkColor lightColor, SkScalar surfaceScale, SkScalar kd, | 59 SkColor lightColor, SkScalar surfaceScale, SkScalar kd, |
| 58 SkImageFilter* input = NULL, const SkIRect* cropRect = NULL); | 60 SkImageFilter* input = NULL, const SkIRect* cropRect = NULL); |
| 59 static SkImageFilter* CreateSpotLitDiffuse(const SkPoint3& location, | 61 static SkImageFilter* CreateSpotLitDiffuse(const SkPoint3& location, |
| 60 const SkPoint3& target, SkScalar specularExponent, SkScalar cutoffAngle, | 62 const SkPoint3& target, SkScalar specularExponent, SkScalar cutoffAngle, |
| 61 SkColor lightColor, SkScalar surfaceScale, SkScalar kd, | 63 SkColor lightColor, SkScalar surfaceScale, SkScalar kd, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 78 SkLightingImageFilter(SkLight* light, | 80 SkLightingImageFilter(SkLight* light, |
| 79 SkScalar surfaceScale, | 81 SkScalar surfaceScale, |
| 80 SkImageFilter* input, | 82 SkImageFilter* input, |
| 81 const SkIRect* cropRect = NULL); | 83 const SkIRect* cropRect = NULL); |
| 82 explicit SkLightingImageFilter(SkFlattenableReadBuffer& buffer); | 84 explicit SkLightingImageFilter(SkFlattenableReadBuffer& buffer); |
| 83 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; | 85 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; |
| 84 const SkLight* light() const { return fLight; } | 86 const SkLight* light() const { return fLight; } |
| 85 SkScalar surfaceScale() const { return fSurfaceScale; } | 87 SkScalar surfaceScale() const { return fSurfaceScale; } |
| 86 | 88 |
| 87 private: | 89 private: |
| 88 typedef SkImageFilter INHERITED; | |
| 89 SkLight* fLight; | 90 SkLight* fLight; |
| 90 SkScalar fSurfaceScale; | 91 SkScalar fSurfaceScale; |
| 91 }; | 92 }; |
| 92 | 93 |
| 93 #endif | 94 #endif |
| OLD | NEW |