aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/effects
diff options
context:
space:
mode:
authorGravatar senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-07-09 14:29:51 +0000
committerGravatar senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-07-09 14:29:51 +0000
commitbdb1ec453a36b3e8e8800713aef0dce934e6a6a7 (patch)
tree15c7ad8bbbfd0ca31813eb5fecbf22b3996983ba /include/effects
parent303b799ce1675056ff0e596013aecd7a0ffac440 (diff)
Minor cleanup in lighting image filters: Made the light color a member of the
light, rather than the filter, so computation is localized. Changed a couple of non-const refs in the image filter creation API const refs. Changed "const SkColor&" to "SkColor", since it's just a uint32_t anyway. Review URL: http://codereview.appspot.com/6352071/ git-svn-id: http://skia.googlecode.com/svn/trunk@4466 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/effects')
-rw-r--r--include/effects/SkLightingImageFilter.h21
1 files changed, 9 insertions, 12 deletions
diff --git a/include/effects/SkLightingImageFilter.h b/include/effects/SkLightingImageFilter.h
index 03dbff1972..5406e7e627 100644
--- a/include/effects/SkLightingImageFilter.h
+++ b/include/effects/SkLightingImageFilter.h
@@ -47,39 +47,36 @@ class SkLight;
class SK_API SkLightingImageFilter : public SkImageFilter {
public:
static SkImageFilter* CreateDistantLitDiffuse(const SkPoint3& direction,
- const SkColor& lightColor, SkScalar surfaceScale, SkScalar kd);
- static SkImageFilter* CreatePointLitDiffuse(SkPoint3& location,
- const SkColor& lightColor, SkScalar surfaceScale, SkScalar kd);
+ SkColor lightColor, SkScalar surfaceScale, SkScalar kd);
+ static SkImageFilter* CreatePointLitDiffuse(const SkPoint3& location,
+ SkColor lightColor, SkScalar surfaceScale, SkScalar kd);
static SkImageFilter* CreateSpotLitDiffuse(const SkPoint3& location,
const SkPoint3& target, SkScalar specularExponent, SkScalar cutoffAngle,
- const SkColor& lightColor, SkScalar surfaceScale, SkScalar kd);
+ SkColor lightColor, SkScalar surfaceScale, SkScalar kd);
static SkImageFilter* CreateDistantLitSpecular(const SkPoint3& direction,
- const SkColor& lightColor, SkScalar surfaceScale, SkScalar ks,
+ SkColor lightColor, SkScalar surfaceScale, SkScalar ks,
SkScalar shininess);
- static SkImageFilter* CreatePointLitSpecular(SkPoint3& location,
- const SkColor& lightColor, SkScalar surfaceScale, SkScalar ks,
+ static SkImageFilter* CreatePointLitSpecular(const SkPoint3& location,
+ SkColor lightColor, SkScalar surfaceScale, SkScalar ks,
SkScalar shininess);
static SkImageFilter* CreateSpotLitSpecular(const SkPoint3& location,
const SkPoint3& target, SkScalar specularExponent, SkScalar cutoffAngle,
- const SkColor& lightColor, SkScalar surfaceScale, SkScalar ks,
+ SkColor lightColor, SkScalar surfaceScale, SkScalar ks,
SkScalar shininess);
~SkLightingImageFilter();
SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP()
protected:
- SkLightingImageFilter(SkLight* light, const SkColor& lightColor,
- SkScalar surfaceScale);
+ SkLightingImageFilter(SkLight* light, SkScalar surfaceScale);
explicit SkLightingImageFilter(SkFlattenableReadBuffer& buffer);
virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE;
const SkLight* light() const { return fLight; }
- const SkPoint3& lightColor() const { return fLightColor; }
SkScalar surfaceScale() const { return fSurfaceScale; }
private:
typedef SkImageFilter INHERITED;
SkLight* fLight;
- SkPoint3 fLightColor;
SkScalar fSurfaceScale;
};