From 9ea3d57fde28a5fe4487a111dc3dd49418235e5e Mon Sep 17 00:00:00 2001 From: senorblanco Date: Tue, 8 Jul 2014 09:16:22 -0700 Subject: Clean up SkImageFilter constructors. Now that all creation of SkImageFilters goes through factory Create() methods, there's no real reason for the convenience constructors. Some SkImageFilter subclasses which actually have zero DAG-able inputs were passing NULL to the superclass constructor. This actually means 1 input, with a NULL value, not zero inputs. This becomes more relevant for the upcoming cache infrastructure, where this indicates that the filter will use its src input, where in fact some of these filters do not (they are image generators only). Limiting SkImageFilter to a single constructor resolves this ambiguity. Along the way, I removed all of the default parameters to the constructors, since the Create methods always call them with the full argument list. BUG=skia: R=reed@google.com Author: senorblanco@chromium.org Review URL: https://codereview.chromium.org/376953003 --- src/effects/SkLightingImageFilter.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/effects/SkLightingImageFilter.cpp') diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp index 5fc3474e3d..54bfc0408a 100644 --- a/src/effects/SkLightingImageFilter.cpp +++ b/src/effects/SkLightingImageFilter.cpp @@ -827,8 +827,9 @@ void SkLight::flattenLight(SkWriteBuffer& buffer) const { } /////////////////////////////////////////////////////////////////////////////// -SkLightingImageFilter::SkLightingImageFilter(SkLight* light, SkScalar surfaceScale, SkImageFilter* input, const CropRect* cropRect) - : INHERITED(input, cropRect), +SkLightingImageFilter::SkLightingImageFilter(SkLight* light, SkScalar surfaceScale, + SkImageFilter* input, const CropRect* cropRect) + : INHERITED(1, &input, cropRect), fLight(light), fSurfaceScale(SkScalarDiv(surfaceScale, SkIntToScalar(255))) { -- cgit v1.2.3