| OLD | NEW |
| 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 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 friend class SkLightingImageFilter; | 484 friend class SkLightingImageFilter; |
| 485 typedef SkLightingImageFilterInternal INHERITED; | 485 typedef SkLightingImageFilterInternal INHERITED; |
| 486 }; | 486 }; |
| 487 | 487 |
| 488 #if SK_SUPPORT_GPU | 488 #if SK_SUPPORT_GPU |
| 489 | 489 |
| 490 class GrLightingEffect : public GrSingleTextureEffect { | 490 class GrLightingEffect : public GrSingleTextureEffect { |
| 491 public: | 491 public: |
| 492 GrLightingEffect(GrTexture* texture, const SkImageFilterLight* light, SkScal
ar surfaceScale, | 492 GrLightingEffect(GrTexture* texture, const SkImageFilterLight* light, SkScal
ar surfaceScale, |
| 493 const SkMatrix& matrix, BoundaryMode boundaryMode); | 493 const SkMatrix& matrix, BoundaryMode boundaryMode); |
| 494 virtual ~GrLightingEffect(); | 494 ~GrLightingEffect() override; |
| 495 | 495 |
| 496 const SkImageFilterLight* light() const { return fLight; } | 496 const SkImageFilterLight* light() const { return fLight; } |
| 497 SkScalar surfaceScale() const { return fSurfaceScale; } | 497 SkScalar surfaceScale() const { return fSurfaceScale; } |
| 498 const SkMatrix& filterMatrix() const { return fFilterMatrix; } | 498 const SkMatrix& filterMatrix() const { return fFilterMatrix; } |
| 499 BoundaryMode boundaryMode() const { return fBoundaryMode; } | 499 BoundaryMode boundaryMode() const { return fBoundaryMode; } |
| 500 | 500 |
| 501 protected: | 501 protected: |
| 502 bool onIsEqual(const GrFragmentProcessor&) const override; | 502 bool onIsEqual(const GrFragmentProcessor&) const override; |
| 503 | 503 |
| 504 void onComputeInvariantOutput(GrInvariantOutput* inout) const override { | 504 void onComputeInvariantOutput(GrInvariantOutput* inout) const override { |
| (...skipping 1509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2014 | 2014 |
| 2015 fsBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); | 2015 fsBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); |
| 2016 } | 2016 } |
| 2017 | 2017 |
| 2018 #endif | 2018 #endif |
| 2019 | 2019 |
| 2020 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) | 2020 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) |
| 2021 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) | 2021 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) |
| 2022 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) | 2022 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) |
| 2023 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 2023 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
| OLD | NEW |