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

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: Fixed 100-col issues 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
« no previous file with comments | « src/effects/SkDropShadowImageFilter.cpp ('k') | src/effects/SkMagnifierImageFilter.cpp » ('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 #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,
833 : INHERITED(input, cropRect), 833 SkImageFilter* input, const CropRec t* cropRect)
834 : INHERITED(1, &input, cropRect),
834 fLight(light), 835 fLight(light),
835 fSurfaceScale(SkScalarDiv(surfaceScale, SkIntToScalar(255))) 836 fSurfaceScale(SkScalarDiv(surfaceScale, SkIntToScalar(255)))
836 { 837 {
837 SkASSERT(fLight); 838 SkASSERT(fLight);
838 // our caller knows that we take ownership of the light, so we don't 839 // our caller knows that we take ownership of the light, so we don't
839 // need to call ref() here. 840 // need to call ref() here.
840 } 841 }
841 842
842 SkImageFilter* SkLightingImageFilter::CreateDistantLitDiffuse( 843 SkImageFilter* SkLightingImageFilter::CreateDistantLitDiffuse(
843 const SkPoint3& direction, SkColor lightColor, SkScalar surfaceScale, 844 const SkPoint3& direction, SkColor lightColor, SkScalar surfaceScale,
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after
1612 1613
1613 builder->fsCodeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); 1614 builder->fsCodeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight);
1614 } 1615 }
1615 1616
1616 #endif 1617 #endif
1617 1618
1618 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) 1619 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter)
1619 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) 1620 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter)
1620 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) 1621 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter)
1621 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 1622 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW
« no previous file with comments | « src/effects/SkDropShadowImageFilter.cpp ('k') | src/effects/SkMagnifierImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698