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 "SkReadBuffer.h" | 10 #include "SkReadBuffer.h" |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 const char* outputColor, | 365 const char* outputColor, |
366 const char* inputColor, | 366 const char* inputColor, |
367 const TransformedCoordsArray& coords, | 367 const TransformedCoordsArray& coords, |
368 const TextureSamplerArray& samplers) { | 368 const TextureSamplerArray& samplers) { |
369 | 369 |
370 GrTexture* backgroundTex = effect.cast<GrArithmeticEffect>().backgroundTextu
re(); | 370 GrTexture* backgroundTex = effect.cast<GrArithmeticEffect>().backgroundTextu
re(); |
371 GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder(); | 371 GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder(); |
372 const char* dstColor; | 372 const char* dstColor; |
373 if (backgroundTex) { | 373 if (backgroundTex) { |
374 fsBuilder->codeAppend("\t\tvec4 bgColor = "); | 374 fsBuilder->codeAppend("\t\tvec4 bgColor = "); |
375 fsBuilder->appendTextureLookup(samplers[0], coords[0].c_str(), coords[0]
.type()); | 375 fsBuilder->appendTextureLookup(samplers[0], coords[0].c_str(), coords[0]
.getType()); |
376 fsBuilder->codeAppendf(";\n"); | 376 fsBuilder->codeAppendf(";\n"); |
377 dstColor = "bgColor"; | 377 dstColor = "bgColor"; |
378 } else { | 378 } else { |
379 dstColor = fsBuilder->dstColor(); | 379 dstColor = fsBuilder->dstColor(); |
380 } | 380 } |
381 | 381 |
382 SkASSERT(dstColor); | 382 SkASSERT(dstColor); |
383 fKUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility, | 383 fKUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility, |
384 kVec4f_GrSLType, "k"); | 384 kVec4f_GrSLType, "k"); |
385 const char* kUni = builder->getUniformCStr(fKUni); | 385 const char* kUni = builder->getUniformCStr(fKUni); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 background); | 449 background); |
450 } | 450 } |
451 return true; | 451 return true; |
452 } | 452 } |
453 | 453 |
454 #endif | 454 #endif |
455 | 455 |
456 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkArithmeticMode) | 456 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkArithmeticMode) |
457 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkArithmeticMode_scalar) | 457 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkArithmeticMode_scalar) |
458 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 458 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
OLD | NEW |