Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Side by Side Diff: src/core/SkLightingShader.cpp

Issue 1753903002: fission bitmapprocstate (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: use real types instead of uint8_t, fix formatting Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/core/SkBitmapProcState_shaderproc.h ('k') | src/image/SkImageShader.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 664
665 SkMatrix normTotalInv; 665 SkMatrix normTotalInv;
666 if (!this->computeNormTotalInverse(rec, &normTotalInv)) { 666 if (!this->computeNormTotalInverse(rec, &normTotalInv)) {
667 return nullptr; 667 return nullptr;
668 } 668 }
669 669
670 void* diffuseStateStorage = (char*)storage + sizeof(LightingShaderContext); 670 void* diffuseStateStorage = (char*)storage + sizeof(LightingShaderContext);
671 SkBitmapProcState* diffuseState = new (diffuseStateStorage) SkBitmapProcStat e(fDiffuseMap, 671 SkBitmapProcState* diffuseState = new (diffuseStateStorage) SkBitmapProcStat e(fDiffuseMap,
672 SkShader::kClamp_TileMode, SkShade r::kClamp_TileMode); 672 SkShader::kClamp_TileMode, SkShade r::kClamp_TileMode);
673 SkASSERT(diffuseState); 673 SkASSERT(diffuseState);
674 if (!diffuseState->chooseProcs(diffTotalInv, *rec.fPaint)) { 674 if (!diffuseState->setup(diffTotalInv, *rec.fPaint)) {
675 diffuseState->~SkBitmapProcState(); 675 diffuseState->~SkBitmapProcState();
676 return nullptr; 676 return nullptr;
677 } 677 }
678 678
679 void* normalStateStorage = (char*)storage + sizeof(LightingShaderContext) + sizeof(SkBitmapProcState); 679 void* normalStateStorage = (char*)storage + sizeof(LightingShaderContext) + sizeof(SkBitmapProcState);
680 SkBitmapProcState* normalState = new (normalStateStorage) SkBitmapProcState( fNormalMap, 680 SkBitmapProcState* normalState = new (normalStateStorage) SkBitmapProcState( fNormalMap,
681 SkShader::kClamp_TileMode, SkShader: :kClamp_TileMode); 681 SkShader::kClamp_TileMode, SkShader: :kClamp_TileMode);
682 SkASSERT(normalState); 682 SkASSERT(normalState);
683 if (!normalState->chooseProcs(normTotalInv, *rec.fPaint)) { 683 if (!normalState->setup(normTotalInv, *rec.fPaint)) {
684 diffuseState->~SkBitmapProcState(); 684 diffuseState->~SkBitmapProcState();
685 normalState->~SkBitmapProcState(); 685 normalState->~SkBitmapProcState();
686 return nullptr; 686 return nullptr;
687 } 687 }
688 688
689 return new (storage) LightingShaderContext(*this, rec, diffuseState, normalS tate); 689 return new (storage) LightingShaderContext(*this, rec, diffuseState, normalS tate);
690 } 690 }
691 691
692 /////////////////////////////////////////////////////////////////////////////// 692 ///////////////////////////////////////////////////////////////////////////////
693 693
(...skipping 24 matching lines...) Expand all
718 normLocalM); 718 normLocalM);
719 } 719 }
720 720
721 /////////////////////////////////////////////////////////////////////////////// 721 ///////////////////////////////////////////////////////////////////////////////
722 722
723 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingShader) 723 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingShader)
724 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLightingShaderImpl) 724 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLightingShaderImpl)
725 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 725 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
726 726
727 /////////////////////////////////////////////////////////////////////////////// 727 ///////////////////////////////////////////////////////////////////////////////
OLDNEW
« no previous file with comments | « src/core/SkBitmapProcState_shaderproc.h ('k') | src/image/SkImageShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698