| 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 "SkArithmeticMode.h" | 8 #include "SkArithmeticMode.h" |
| 9 #include "SkColorPriv.h" | 9 #include "SkColorPriv.h" |
| 10 #include "SkFlattenableBuffers.h" | 10 #include "SkFlattenableBuffers.h" |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 EffectKey bgKey = 0; | 408 EffectKey bgKey = 0; |
| 409 if (bgTex) { | 409 if (bgTex) { |
| 410 bgKey = GrGLEffectMatrix::GenKey(GrEffect::MakeDivByTextureWHMatrix(bgTe
x), | 410 bgKey = GrGLEffectMatrix::GenKey(GrEffect::MakeDivByTextureWHMatrix(bgTe
x), |
| 411 drawEffect, | 411 drawEffect, |
| 412 GrGLArithmeticEffect::kCoordsType, | 412 GrGLArithmeticEffect::kCoordsType, |
| 413 bgTex); | 413 bgTex); |
| 414 } | 414 } |
| 415 return bgKey; | 415 return bgKey; |
| 416 } | 416 } |
| 417 | 417 |
| 418 GrEffectRef* GrArithmeticEffect::TestCreate(SkMWCRandom* rand, | 418 GrEffectRef* GrArithmeticEffect::TestCreate(SkRandom* rand, |
| 419 GrContext*, | 419 GrContext*, |
| 420 const GrDrawTargetCaps&, | 420 const GrDrawTargetCaps&, |
| 421 GrTexture*[]) { | 421 GrTexture*[]) { |
| 422 float k1 = rand->nextF(); | 422 float k1 = rand->nextF(); |
| 423 float k2 = rand->nextF(); | 423 float k2 = rand->nextF(); |
| 424 float k3 = rand->nextF(); | 424 float k3 = rand->nextF(); |
| 425 float k4 = rand->nextF(); | 425 float k4 = rand->nextF(); |
| 426 | 426 |
| 427 static AutoEffectUnref gEffect(SkNEW_ARGS(GrArithmeticEffect, (k1, k2, k3, k
4, NULL))); | 427 static AutoEffectUnref gEffect(SkNEW_ARGS(GrArithmeticEffect, (k1, k2, k3, k
4, NULL))); |
| 428 return CreateEffectRef(gEffect); | 428 return CreateEffectRef(gEffect); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 443 background); | 443 background); |
| 444 } | 444 } |
| 445 return true; | 445 return true; |
| 446 } | 446 } |
| 447 | 447 |
| 448 #endif | 448 #endif |
| 449 | 449 |
| 450 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkArithmeticMode) | 450 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkArithmeticMode) |
| 451 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkArithmeticMode_scalar) | 451 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkArithmeticMode_scalar) |
| 452 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 452 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
| OLD | NEW |