| 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 1681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1692 } | 1692 } |
| 1693 | 1693 |
| 1694 }; | 1694 }; |
| 1695 | 1695 |
| 1696 GrLightingEffect::GrLightingEffect(GrTexture* texture, | 1696 GrLightingEffect::GrLightingEffect(GrTexture* texture, |
| 1697 const SkImageFilterLight* light, | 1697 const SkImageFilterLight* light, |
| 1698 SkScalar surfaceScale, | 1698 SkScalar surfaceScale, |
| 1699 const SkMatrix& matrix, | 1699 const SkMatrix& matrix, |
| 1700 BoundaryMode boundaryMode, | 1700 BoundaryMode boundaryMode, |
| 1701 const SkIRect* srcBounds) | 1701 const SkIRect* srcBounds) |
| 1702 : INHERITED(texture, GrCoordTransform::MakeDivByTextureWHMatrix(texture)) | 1702 : INHERITED(texture, nullptr, GrCoordTransform::MakeDivByTextureWHMatrix(tex
ture)) |
| 1703 , fLight(light) | 1703 , fLight(light) |
| 1704 , fSurfaceScale(surfaceScale) | 1704 , fSurfaceScale(surfaceScale) |
| 1705 , fFilterMatrix(matrix) | 1705 , fFilterMatrix(matrix) |
| 1706 , fBoundaryMode(boundaryMode) | 1706 , fBoundaryMode(boundaryMode) |
| 1707 , fDomain(create_domain(texture, srcBounds, GrTextureDomain::kDecal_Mode)) { | 1707 , fDomain(create_domain(texture, srcBounds, GrTextureDomain::kDecal_Mode)) { |
| 1708 fLight->ref(); | 1708 fLight->ref(); |
| 1709 if (light->requiresFragmentPosition()) { | 1709 if (light->requiresFragmentPosition()) { |
| 1710 this->setWillReadFragmentPosition(); | 1710 this->setWillReadFragmentPosition(); |
| 1711 } | 1711 } |
| 1712 } | 1712 } |
| (...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2168 | 2168 |
| 2169 fragBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); | 2169 fragBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); |
| 2170 } | 2170 } |
| 2171 | 2171 |
| 2172 #endif | 2172 #endif |
| 2173 | 2173 |
| 2174 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) | 2174 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) |
| 2175 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) | 2175 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) |
| 2176 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) | 2176 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) |
| 2177 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 2177 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
| OLD | NEW |