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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 builder->appendTextureLookup(GrGLShaderBuilder::kFragment_ShaderType, | 357 builder->appendTextureLookup(GrGLShaderBuilder::kFragment_ShaderType, |
358 samplers[0], | 358 samplers[0], |
359 bgCoords, | 359 bgCoords, |
360 bgCoordsType); | 360 bgCoordsType); |
361 builder->fsCodeAppendf(";\n"); | 361 builder->fsCodeAppendf(";\n"); |
362 dstColor = "bgColor"; | 362 dstColor = "bgColor"; |
363 } else { | 363 } else { |
364 dstColor = builder->dstColor(); | 364 dstColor = builder->dstColor(); |
365 } | 365 } |
366 | 366 |
367 GrAssert(NULL != dstColor); | 367 SkASSERT(NULL != dstColor); |
368 fKUni = builder->addUniform(GrGLShaderBuilder::kFragment_ShaderType, | 368 fKUni = builder->addUniform(GrGLShaderBuilder::kFragment_ShaderType, |
369 kVec4f_GrSLType, "k"); | 369 kVec4f_GrSLType, "k"); |
370 const char* kUni = builder->getUniformCStr(fKUni); | 370 const char* kUni = builder->getUniformCStr(fKUni); |
371 | 371 |
372 // We don't try to optimize for this case at all | 372 // We don't try to optimize for this case at all |
373 if (NULL == inputColor) { | 373 if (NULL == inputColor) { |
374 builder->fsCodeAppendf("\t\tconst vec4 src = %s;\n", GrGLSLOnesVecf(4)); | 374 builder->fsCodeAppendf("\t\tconst vec4 src = %s;\n", GrGLSLOnesVecf(4)); |
375 } else { | 375 } else { |
376 builder->fsCodeAppendf("\t\tvec4 src = %s;\n", inputColor); | 376 builder->fsCodeAppendf("\t\tvec4 src = %s;\n", inputColor); |
377 if (gUseUnpremul) { | 377 if (gUseUnpremul) { |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 background); | 446 background); |
447 } | 447 } |
448 return true; | 448 return true; |
449 } | 449 } |
450 | 450 |
451 #endif | 451 #endif |
452 | 452 |
453 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkArithmeticMode) | 453 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkArithmeticMode) |
454 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkArithmeticMode_scalar) | 454 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkArithmeticMode_scalar) |
455 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 455 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
OLD | NEW |