| 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 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 | 644 |
| 645 const SkMatrix* m = &total; | 645 const SkMatrix* m = &total; |
| 646 if (rec.fLocalMatrix) { | 646 if (rec.fLocalMatrix) { |
| 647 total.setConcat(*m, *rec.fLocalMatrix); | 647 total.setConcat(*m, *rec.fLocalMatrix); |
| 648 m = &total; | 648 m = &total; |
| 649 } | 649 } |
| 650 return m->invert(normTotalInverse); | 650 return m->invert(normTotalInverse); |
| 651 } | 651 } |
| 652 | 652 |
| 653 size_t SkLightingShaderImpl::onContextSize(const ContextRec&) const { | 653 size_t SkLightingShaderImpl::onContextSize(const ContextRec&) const { |
| 654 return SkAlign16(2 * sizeof(SkBitmapProcState) + sizeof(LightingShaderContex
t)); | 654 return 2 * sizeof(SkBitmapProcState) + sizeof(LightingShaderContext); |
| 655 } | 655 } |
| 656 | 656 |
| 657 SkShader::Context* SkLightingShaderImpl::onCreateContext(const ContextRec& rec, | 657 SkShader::Context* SkLightingShaderImpl::onCreateContext(const ContextRec& rec, |
| 658 void* storage) const { | 658 void* storage) const { |
| 659 | 659 |
| 660 SkMatrix diffTotalInv; | 660 SkMatrix diffTotalInv; |
| 661 // computeTotalInverse was called in SkShader::createContext so we know it w
ill succeed | 661 // computeTotalInverse was called in SkShader::createContext so we know it w
ill succeed |
| 662 SkAssertResult(this->computeTotalInverse(rec, &diffTotalInv)); | 662 SkAssertResult(this->computeTotalInverse(rec, &diffTotalInv)); |
| 663 | 663 |
| 664 SkMatrix normTotalInv; | 664 SkMatrix normTotalInv; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 normLocalM); | 717 normLocalM); |
| 718 } | 718 } |
| 719 | 719 |
| 720 /////////////////////////////////////////////////////////////////////////////// | 720 /////////////////////////////////////////////////////////////////////////////// |
| 721 | 721 |
| 722 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingShader) | 722 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingShader) |
| 723 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLightingShaderImpl) | 723 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLightingShaderImpl) |
| 724 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 724 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
| 725 | 725 |
| 726 /////////////////////////////////////////////////////////////////////////////// | 726 /////////////////////////////////////////////////////////////////////////////// |
| OLD | NEW |