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 1254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1265 UniformHandle fKSUni; | 1265 UniformHandle fKSUni; |
1266 UniformHandle fShininessUni; | 1266 UniformHandle fShininessUni; |
1267 }; | 1267 }; |
1268 | 1268 |
1269 /////////////////////////////////////////////////////////////////////////////// | 1269 /////////////////////////////////////////////////////////////////////////////// |
1270 | 1270 |
1271 GrLightingEffect::GrLightingEffect(GrTexture* texture, | 1271 GrLightingEffect::GrLightingEffect(GrTexture* texture, |
1272 const SkLight* light, | 1272 const SkLight* light, |
1273 SkScalar surfaceScale, | 1273 SkScalar surfaceScale, |
1274 const SkMatrix& matrix) | 1274 const SkMatrix& matrix) |
1275 : INHERITED(texture, MakeDivByTextureWHMatrix(texture)) | 1275 : INHERITED(texture, GrCoordTransform::MakeDivByTextureWHMatrix(texture)) |
1276 , fLight(light) | 1276 , fLight(light) |
1277 , fSurfaceScale(surfaceScale) | 1277 , fSurfaceScale(surfaceScale) |
1278 , fFilterMatrix(matrix) { | 1278 , fFilterMatrix(matrix) { |
1279 fLight->ref(); | 1279 fLight->ref(); |
1280 if (light->requiresFragmentPosition()) { | 1280 if (light->requiresFragmentPosition()) { |
1281 this->setWillReadFragmentPosition(); | 1281 this->setWillReadFragmentPosition(); |
1282 } | 1282 } |
1283 } | 1283 } |
1284 | 1284 |
1285 GrLightingEffect::~GrLightingEffect() { | 1285 GrLightingEffect::~GrLightingEffect() { |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1703 | 1703 |
1704 fsBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); | 1704 fsBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); |
1705 } | 1705 } |
1706 | 1706 |
1707 #endif | 1707 #endif |
1708 | 1708 |
1709 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) | 1709 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) |
1710 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) | 1710 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) |
1711 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) | 1711 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) |
1712 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 1712 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
OLD | NEW |