Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: include/effects/SkLightingImageFilter.h

Issue 26371002: Change SkImageFilter's cropRect from SkIRect to a CropRect struct (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Alternate version, using a single fFlags member. Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « include/effects/SkColorFilterImageFilter.h ('k') | include/effects/SkMergeImageFilter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 public: 52 public:
53 static SkImageFilter* CreateDistantLitDiffuse(const SkPoint3& direction, 53 static SkImageFilter* CreateDistantLitDiffuse(const SkPoint3& direction,
54 SkColor lightColor, SkScalar surfaceScale, SkScalar kd, 54 SkColor lightColor, SkScalar surfaceScale, SkScalar kd,
55 SkImageFilter* input = NULL, const SkIRect* cropRect = NULL); 55 SkImageFilter* input = NULL, const CropRect* cropRect = NULL);
56 static SkImageFilter* CreatePointLitDiffuse(const SkPoint3& location, 56 static SkImageFilter* CreatePointLitDiffuse(const SkPoint3& location,
57 SkColor lightColor, SkScalar surfaceScale, SkScalar kd, 57 SkColor lightColor, SkScalar surfaceScale, SkScalar kd,
58 SkImageFilter* input = NULL, const SkIRect* cropRect = NULL); 58 SkImageFilter* input = NULL, const CropRect* cropRect = NULL);
59 static SkImageFilter* CreateSpotLitDiffuse(const SkPoint3& location, 59 static SkImageFilter* CreateSpotLitDiffuse(const SkPoint3& location,
60 const SkPoint3& target, SkScalar specularExponent, SkScalar cutoffAngle, 60 const SkPoint3& target, SkScalar specularExponent, SkScalar cutoffAngle,
61 SkColor lightColor, SkScalar surfaceScale, SkScalar kd, 61 SkColor lightColor, SkScalar surfaceScale, SkScalar kd,
62 SkImageFilter* input = NULL, const SkIRect* cropRect = NULL); 62 SkImageFilter* input = NULL, const CropRect* cropRect = NULL);
63 static SkImageFilter* CreateDistantLitSpecular(const SkPoint3& direction, 63 static SkImageFilter* CreateDistantLitSpecular(const SkPoint3& direction,
64 SkColor lightColor, SkScalar surfaceScale, SkScalar ks, 64 SkColor lightColor, SkScalar surfaceScale, SkScalar ks,
65 SkScalar shininess, SkImageFilter* input = NULL, const SkIRect* cropRect = NULL); 65 SkScalar shininess, SkImageFilter* input = NULL, const CropRect* cropRec t = NULL);
66 static SkImageFilter* CreatePointLitSpecular(const SkPoint3& location, 66 static SkImageFilter* CreatePointLitSpecular(const SkPoint3& location,
67 SkColor lightColor, SkScalar surfaceScale, SkScalar ks, 67 SkColor lightColor, SkScalar surfaceScale, SkScalar ks,
68 SkScalar shininess, SkImageFilter* input = NULL, const SkIRect* cropRect = NULL); 68 SkScalar shininess, SkImageFilter* input = NULL, const CropRect* cropRec t = NULL);
69 static SkImageFilter* CreateSpotLitSpecular(const SkPoint3& location, 69 static SkImageFilter* CreateSpotLitSpecular(const SkPoint3& location,
70 const SkPoint3& target, SkScalar specularExponent, SkScalar cutoffAngle, 70 const SkPoint3& target, SkScalar specularExponent, SkScalar cutoffAngle,
71 SkColor lightColor, SkScalar surfaceScale, SkScalar ks, 71 SkColor lightColor, SkScalar surfaceScale, SkScalar ks,
72 SkScalar shininess, SkImageFilter* input = NULL, const SkIRect* cropRect = NULL); 72 SkScalar shininess, SkImageFilter* input = NULL, const CropRect* cropRec t = NULL);
73 ~SkLightingImageFilter(); 73 ~SkLightingImageFilter();
74 74
75 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() 75 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP()
76 76
77 protected: 77 protected:
78 SkLightingImageFilter(SkLight* light, 78 SkLightingImageFilter(SkLight* light,
79 SkScalar surfaceScale, 79 SkScalar surfaceScale,
80 SkImageFilter* input, 80 SkImageFilter* input,
81 const SkIRect* cropRect = NULL); 81 const CropRect* cropRect = NULL);
82 explicit SkLightingImageFilter(SkFlattenableReadBuffer& buffer); 82 explicit SkLightingImageFilter(SkFlattenableReadBuffer& buffer);
83 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; 83 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE;
84 const SkLight* light() const { return fLight; } 84 const SkLight* light() const { return fLight; }
85 SkScalar surfaceScale() const { return fSurfaceScale; } 85 SkScalar surfaceScale() const { return fSurfaceScale; }
86 86
87 private: 87 private:
88 typedef SkImageFilter INHERITED; 88 typedef SkImageFilter INHERITED;
89 SkLight* fLight; 89 SkLight* fLight;
90 SkScalar fSurfaceScale; 90 SkScalar fSurfaceScale;
91 }; 91 };
92 92
93 #endif 93 #endif
OLDNEW
« no previous file with comments | « include/effects/SkColorFilterImageFilter.h ('k') | include/effects/SkMergeImageFilter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698