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

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

Issue 643743003: Create helper functions to use in computeInvariantOutput calls (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update blurMaskFilter Created 6 years, 2 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/SkDisplacementMapEffect.cpp ('k') | src/effects/SkLumaColorFilter.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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 348
349 const SkLight* light() const { return fLight; } 349 const SkLight* light() const { return fLight; }
350 SkScalar surfaceScale() const { return fSurfaceScale; } 350 SkScalar surfaceScale() const { return fSurfaceScale; }
351 const SkMatrix& filterMatrix() const { return fFilterMatrix; } 351 const SkMatrix& filterMatrix() const { return fFilterMatrix; }
352 352
353 protected: 353 protected:
354 virtual bool onIsEqual(const GrProcessor&) const SK_OVERRIDE; 354 virtual bool onIsEqual(const GrProcessor&) const SK_OVERRIDE;
355 355
356 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR IDE { 356 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR IDE {
357 // lighting shaders are complicated. We just throw up our hands. 357 // lighting shaders are complicated. We just throw up our hands.
358 inout->fValidFlags = 0; 358 inout->mulByUnknownColor();
359 inout->fIsSingleComponent = false;
360 } 359 }
361 360
362 private: 361 private:
363 typedef GrSingleTextureEffect INHERITED; 362 typedef GrSingleTextureEffect INHERITED;
364 const SkLight* fLight; 363 const SkLight* fLight;
365 SkScalar fSurfaceScale; 364 SkScalar fSurfaceScale;
366 SkMatrix fFilterMatrix; 365 SkMatrix fFilterMatrix;
367 }; 366 };
368 367
369 class GrDiffuseLightingEffect : public GrLightingEffect { 368 class GrDiffuseLightingEffect : public GrLightingEffect {
(...skipping 1349 matching lines...) Expand 10 before | Expand all | Expand 10 after
1719 1718
1720 fsBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); 1719 fsBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight);
1721 } 1720 }
1722 1721
1723 #endif 1722 #endif
1724 1723
1725 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) 1724 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter)
1726 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) 1725 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter)
1727 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) 1726 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter)
1728 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 1727 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW
« no previous file with comments | « src/effects/SkDisplacementMapEffect.cpp ('k') | src/effects/SkLumaColorFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698