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

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

Issue 617853003: Revert of Add isSingleComponent bool to getConstantColorComponent (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 343
344 class GrLightingEffect : public GrSingleTextureEffect { 344 class GrLightingEffect : public GrSingleTextureEffect {
345 public: 345 public:
346 GrLightingEffect(GrTexture* texture, const SkLight* light, SkScalar surfaceS cale, const SkMatrix& matrix); 346 GrLightingEffect(GrTexture* texture, const SkLight* light, SkScalar surfaceS cale, const SkMatrix& matrix);
347 virtual ~GrLightingEffect(); 347 virtual ~GrLightingEffect();
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 virtual void getConstantColorComponents(GrColor* color,
354 uint32_t* validFlags) const SK_OVERR IDE {
355 // lighting shaders are complicated. We just throw up our hands.
356 *validFlags = 0;
357 }
358
353 protected: 359 protected:
354 virtual bool onIsEqual(const GrProcessor&) const SK_OVERRIDE; 360 virtual bool onIsEqual(const GrProcessor&) const SK_OVERRIDE;
355 361
356 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR IDE {
357 // lighting shaders are complicated. We just throw up our hands.
358 inout->fValidFlags = 0;
359 inout->fIsSingleComponent = false;
360 }
361
362 private: 362 private:
363 typedef GrSingleTextureEffect INHERITED; 363 typedef GrSingleTextureEffect INHERITED;
364 const SkLight* fLight; 364 const SkLight* fLight;
365 SkScalar fSurfaceScale; 365 SkScalar fSurfaceScale;
366 SkMatrix fFilterMatrix; 366 SkMatrix fFilterMatrix;
367 }; 367 };
368 368
369 class GrDiffuseLightingEffect : public GrLightingEffect { 369 class GrDiffuseLightingEffect : public GrLightingEffect {
370 public: 370 public:
371 static GrFragmentProcessor* Create(GrTexture* texture, 371 static GrFragmentProcessor* Create(GrTexture* texture,
(...skipping 1347 matching lines...) Expand 10 before | Expand all | Expand 10 after
1719 1719
1720 fsBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); 1720 fsBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight);
1721 } 1721 }
1722 1722
1723 #endif 1723 #endif
1724 1724
1725 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) 1725 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter)
1726 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) 1726 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter)
1727 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) 1727 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter)
1728 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 1728 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