OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2015 Google Inc. | 3 * Copyright 2015 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "SkBitmapProcState.h" | 9 #include "SkBitmapProcState.h" |
10 #include "SkColor.h" | 10 #include "SkColor.h" |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 SkAutoTUnref<GrTexture> normalTexture(GrRefCachedBitmapTexture(context, | 393 SkAutoTUnref<GrTexture> normalTexture(GrRefCachedBitmapTexture(context, |
394 fNormalMap, &
normParams)); | 394 fNormalMap, &
normParams)); |
395 if (!normalTexture) { | 395 if (!normalTexture) { |
396 SkErrorInternals::SetError(kInternalError_SkError, "Couldn't convert bit
map to texture."); | 396 SkErrorInternals::SetError(kInternalError_SkError, "Couldn't convert bit
map to texture."); |
397 return nullptr; | 397 return nullptr; |
398 } | 398 } |
399 | 399 |
400 SkAutoTUnref<const GrFragmentProcessor> inner ( | 400 SkAutoTUnref<const GrFragmentProcessor> inner ( |
401 new LightingFP(pdm, diffuseTexture, normalTexture, diffM, normM, diffPar
ams, normParams, | 401 new LightingFP(pdm, diffuseTexture, normalTexture, diffM, normM, diffPar
ams, normParams, |
402 fLights, fInvNormRotation)); | 402 fLights, fInvNormRotation)); |
403 return GrFragmentProcessor::MulOuputByInputAlpha(inner); | 403 return GrFragmentProcessor::MulOutputByInputAlpha(inner); |
404 } | 404 } |
405 | 405 |
406 #endif | 406 #endif |
407 | 407 |
408 //////////////////////////////////////////////////////////////////////////// | 408 //////////////////////////////////////////////////////////////////////////// |
409 | 409 |
410 bool SkLightingShaderImpl::isOpaque() const { | 410 bool SkLightingShaderImpl::isOpaque() const { |
411 return fDiffuseMap.isOpaque(); | 411 return fDiffuseMap.isOpaque(); |
412 } | 412 } |
413 | 413 |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 normLocalM); | 713 normLocalM); |
714 } | 714 } |
715 | 715 |
716 /////////////////////////////////////////////////////////////////////////////// | 716 /////////////////////////////////////////////////////////////////////////////// |
717 | 717 |
718 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingShader) | 718 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingShader) |
719 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLightingShaderImpl) | 719 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLightingShaderImpl) |
720 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 720 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
721 | 721 |
722 /////////////////////////////////////////////////////////////////////////////// | 722 /////////////////////////////////////////////////////////////////////////////// |
OLD | NEW |