OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
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 "GrGLProgramEffects.h" | 8 #include "GrGLProgramEffects.h" |
9 #include "GrDrawEffect.h" | 9 #include "GrDrawEffect.h" |
10 #include "gl/GrGLEffect.h" | 10 #include "gl/GrGLEffect.h" |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 const GrDrawEffect& drawEffect, | 418 const GrDrawEffect& drawEffect, |
419 int effectIdx) { | 419 int effectIdx) { |
420 SkTArray<Transform, true>& transforms = fTransforms[effectIdx]; | 420 SkTArray<Transform, true>& transforms = fTransforms[effectIdx]; |
421 int numTransforms = transforms.count(); | 421 int numTransforms = transforms.count(); |
422 SkASSERT(numTransforms == (*drawEffect.effect())->numTransforms()); | 422 SkASSERT(numTransforms == (*drawEffect.effect())->numTransforms()); |
423 for (int t = 0; t < numTransforms; ++t) { | 423 for (int t = 0; t < numTransforms; ++t) { |
424 SkASSERT(transforms[t].fHandle.isValid() != (kVoid_GrSLType == transform
s[t].fType)); | 424 SkASSERT(transforms[t].fHandle.isValid() != (kVoid_GrSLType == transform
s[t].fType)); |
425 switch (transforms[t].fType) { | 425 switch (transforms[t].fType) { |
426 case kVoid_GrSLType: | 426 case kVoid_GrSLType: |
427 SkASSERT(get_transform_matrix(drawEffect, t).isIdentity()); | 427 SkASSERT(get_transform_matrix(drawEffect, t).isIdentity()); |
428 return; | 428 break; |
429 case kVec2f_GrSLType: { | 429 case kVec2f_GrSLType: { |
430 GrGLfloat tx, ty; | 430 GrGLfloat tx, ty; |
431 get_transform_translation(drawEffect, t, &tx, &ty); | 431 get_transform_translation(drawEffect, t, &tx, &ty); |
432 if (transforms[t].fCurrentValue.get(SkMatrix::kMTransX) != tx || | 432 if (transforms[t].fCurrentValue.get(SkMatrix::kMTransX) != tx || |
433 transforms[t].fCurrentValue.get(SkMatrix::kMTransY) != ty) { | 433 transforms[t].fCurrentValue.get(SkMatrix::kMTransY) != ty) { |
434 uniformManager.set2f(transforms[t].fHandle, tx, ty); | 434 uniformManager.set2f(transforms[t].fHandle, tx, ty); |
435 transforms[t].fCurrentValue.set(SkMatrix::kMTransX, tx); | 435 transforms[t].fCurrentValue.set(SkMatrix::kMTransX, tx); |
436 transforms[t].fCurrentValue.set(SkMatrix::kMTransY, ty); | 436 transforms[t].fCurrentValue.set(SkMatrix::kMTransY, ty); |
437 } | 437 } |
438 break; | 438 break; |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 } | 577 } |
578 | 578 |
579 void GrGLTexGenProgramEffectsBuilder::emitEffect(const GrEffectStage& stage, | 579 void GrGLTexGenProgramEffectsBuilder::emitEffect(const GrEffectStage& stage, |
580 GrGLProgramEffects::EffectKey k
ey, | 580 GrGLProgramEffects::EffectKey k
ey, |
581 const char* outColor, | 581 const char* outColor, |
582 const char* inColor, | 582 const char* inColor, |
583 int stageIndex) { | 583 int stageIndex) { |
584 SkASSERT(NULL != fProgramEffects.get()); | 584 SkASSERT(NULL != fProgramEffects.get()); |
585 fProgramEffects->emitEffect(fBuilder, stage, key, outColor, inColor, stageIn
dex); | 585 fProgramEffects->emitEffect(fBuilder, stage, key, outColor, inColor, stageIn
dex); |
586 } | 586 } |
OLD | NEW |