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

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

Issue 1842753002: Style bikeshed - remove extraneous whitespace (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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/SkLayerRasterizer.cpp ('k') | src/effects/SkMergeImageFilter.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 725 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 class GrGLLight; 736 class GrGLLight;
737 737
738 #endif 738 #endif
739 739
740 }; 740 };
741 741
742 /////////////////////////////////////////////////////////////////////////////// 742 ///////////////////////////////////////////////////////////////////////////////
743 743
744 class SkImageFilterLight : public SkRefCnt { 744 class SkImageFilterLight : public SkRefCnt {
745 public: 745 public:
746 746
747 747
748 enum LightType { 748 enum LightType {
749 kDistant_LightType, 749 kDistant_LightType,
750 kPoint_LightType, 750 kPoint_LightType,
751 kSpot_LightType, 751 kSpot_LightType,
752 }; 752 };
753 virtual LightType type() const = 0; 753 virtual LightType type() const = 0;
754 const SkPoint3& color() const { return fColor; } 754 const SkPoint3& color() const { return fColor; }
755 virtual GrGLLight* createGLLight() const = 0; 755 virtual GrGLLight* createGLLight() const = 0;
756 virtual bool isEqual(const SkImageFilterLight& other) const { 756 virtual bool isEqual(const SkImageFilterLight& other) const {
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
873 const SkPointLight& o = static_cast<const SkPointLight&>(other); 873 const SkPointLight& o = static_cast<const SkPointLight&>(other);
874 return INHERITED::isEqual(other) && 874 return INHERITED::isEqual(other) &&
875 fLocation == o.fLocation; 875 fLocation == o.fLocation;
876 } 876 }
877 SkImageFilterLight* transform(const SkMatrix& matrix) const override { 877 SkImageFilterLight* transform(const SkMatrix& matrix) const override {
878 SkPoint location2 = SkPoint::Make(fLocation.fX, fLocation.fY); 878 SkPoint location2 = SkPoint::Make(fLocation.fX, fLocation.fY);
879 matrix.mapPoints(&location2, 1); 879 matrix.mapPoints(&location2, 1);
880 // Use X scale and Y scale on Z and average the result 880 // Use X scale and Y scale on Z and average the result
881 SkPoint locationZ = SkPoint::Make(fLocation.fZ, fLocation.fZ); 881 SkPoint locationZ = SkPoint::Make(fLocation.fZ, fLocation.fZ);
882 matrix.mapVectors(&locationZ, 1); 882 matrix.mapVectors(&locationZ, 1);
883 SkPoint3 location = SkPoint3::Make(location2.fX, 883 SkPoint3 location = SkPoint3::Make(location2.fX,
884 location2.fY, 884 location2.fY,
885 SkScalarAve(locationZ.fX, locationZ.f Y)); 885 SkScalarAve(locationZ.fX, locationZ.f Y));
886 return new SkPointLight(location, color()); 886 return new SkPointLight(location, color());
887 } 887 }
888 888
889 SkPointLight(SkReadBuffer& buffer) : INHERITED(buffer) { 889 SkPointLight(SkReadBuffer& buffer) : INHERITED(buffer) {
890 fLocation = readPoint3(buffer); 890 fLocation = readPoint3(buffer);
891 } 891 }
892 892
893 protected: 893 protected:
894 SkPointLight(const SkPoint3& location, const SkPoint3& color) 894 SkPointLight(const SkPoint3& location, const SkPoint3& color)
(...skipping 1223 matching lines...) Expand 10 before | Expand all | Expand 10 after
2118 2118
2119 fragBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); 2119 fragBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight);
2120 } 2120 }
2121 2121
2122 #endif 2122 #endif
2123 2123
2124 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) 2124 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter)
2125 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) 2125 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter)
2126 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) 2126 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter)
2127 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 2127 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW
« no previous file with comments | « src/effects/SkLayerRasterizer.cpp ('k') | src/effects/SkMergeImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698