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

Side by Side Diff: src/effects/SkLightingImageFilter.cpp

Issue 376953003: Clean up SkImageFilter constructors. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix deserializing constructor for SkRectShaderImageFilter Created 6 years, 5 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
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 #include "SkLightingImageFilter.h" 8 #include "SkLightingImageFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 case SkLight::kPoint_LightType: return SkNEW_ARGS(SkPointLight, (buffe r)); 822 case SkLight::kPoint_LightType: return SkNEW_ARGS(SkPointLight, (buffe r));
823 case SkLight::kSpot_LightType: return SkNEW_ARGS(SkSpotLight, (buffer )); 823 case SkLight::kSpot_LightType: return SkNEW_ARGS(SkSpotLight, (buffer ));
824 default: 824 default:
825 SkDEBUGFAIL("Unknown LightType."); 825 SkDEBUGFAIL("Unknown LightType.");
826 buffer.validate(false); 826 buffer.validate(false);
827 return NULL; 827 return NULL;
828 } 828 }
829 } 829 }
830 /////////////////////////////////////////////////////////////////////////////// 830 ///////////////////////////////////////////////////////////////////////////////
831 831
832 SkLightingImageFilter::SkLightingImageFilter(SkLight* light, SkScalar surfaceSca le, SkImageFilter* input, const CropRect* cropRect) 832 SkLightingImageFilter::SkLightingImageFilter(SkLight* light, SkScalar surfaceSca le, SkImageFilter* input, const CropRect* cropRect)
reed1 2014/07/08 15:15:24 nit: 100 col
Stephen White 2014/07/08 15:33:30 Fixed.
833 : INHERITED(input, cropRect), 833 : INHERITED(1, &input, cropRect),
834 fLight(light), 834 fLight(light),
835 fSurfaceScale(SkScalarDiv(surfaceScale, SkIntToScalar(255))) 835 fSurfaceScale(SkScalarDiv(surfaceScale, SkIntToScalar(255)))
836 { 836 {
837 SkASSERT(fLight); 837 SkASSERT(fLight);
838 // our caller knows that we take ownership of the light, so we don't 838 // our caller knows that we take ownership of the light, so we don't
839 // need to call ref() here. 839 // need to call ref() here.
840 } 840 }
841 841
842 SkImageFilter* SkLightingImageFilter::CreateDistantLitDiffuse( 842 SkImageFilter* SkLightingImageFilter::CreateDistantLitDiffuse(
843 const SkPoint3& direction, SkColor lightColor, SkScalar surfaceScale, 843 const SkPoint3& direction, SkColor lightColor, SkScalar surfaceScale,
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after
1612 1612
1613 builder->fsCodeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); 1613 builder->fsCodeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight);
1614 } 1614 }
1615 1615
1616 #endif 1616 #endif
1617 1617
1618 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) 1618 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter)
1619 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) 1619 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter)
1620 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) 1620 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter)
1621 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 1621 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698