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

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

Issue 794843002: Revert of Remove GP from drawstate, revision of invariant output for GP (Closed) Base URL: https://skia.googlesource.com/skia.git@color-to-gp
Patch Set: Created 6 years 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/SkBlurMaskFilter.cpp ('k') | src/effects/gradients/SkGradientShader.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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 342
343 const SkLight* light() const { return fLight; } 343 const SkLight* light() const { return fLight; }
344 SkScalar surfaceScale() const { return fSurfaceScale; } 344 SkScalar surfaceScale() const { return fSurfaceScale; }
345 const SkMatrix& filterMatrix() const { return fFilterMatrix; } 345 const SkMatrix& filterMatrix() const { return fFilterMatrix; }
346 346
347 protected: 347 protected:
348 virtual bool onIsEqual(const GrFragmentProcessor&) const SK_OVERRIDE; 348 virtual bool onIsEqual(const GrFragmentProcessor&) const SK_OVERRIDE;
349 349
350 virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const SK_OVE RRIDE { 350 virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const SK_OVE RRIDE {
351 // lighting shaders are complicated. We just throw up our hands. 351 // lighting shaders are complicated. We just throw up our hands.
352 inout->mulByUnknownFourComponents(); 352 inout->mulByUnknownColor();
353 } 353 }
354 354
355 private: 355 private:
356 typedef GrSingleTextureEffect INHERITED; 356 typedef GrSingleTextureEffect INHERITED;
357 const SkLight* fLight; 357 const SkLight* fLight;
358 SkScalar fSurfaceScale; 358 SkScalar fSurfaceScale;
359 SkMatrix fFilterMatrix; 359 SkMatrix fFilterMatrix;
360 }; 360 };
361 361
362 class GrDiffuseLightingEffect : public GrLightingEffect { 362 class GrDiffuseLightingEffect : public GrLightingEffect {
(...skipping 1335 matching lines...) Expand 10 before | Expand all | Expand 10 after
1698 1698
1699 fsBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); 1699 fsBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight);
1700 } 1700 }
1701 1701
1702 #endif 1702 #endif
1703 1703
1704 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) 1704 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter)
1705 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) 1705 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter)
1706 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) 1706 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter)
1707 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 1707 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW
« no previous file with comments | « src/effects/SkBlurMaskFilter.cpp ('k') | src/effects/gradients/SkGradientShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698