OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
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 | 9 |
10 #include "SkXfermode.h" | 10 #include "SkXfermode.h" |
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
829 const TransformedCoordsArray& coords, | 829 const TransformedCoordsArray& coords, |
830 const TextureSamplerArray& samplers) SK_OVERRIDE { | 830 const TextureSamplerArray& samplers) SK_OVERRIDE { |
831 SkXfermode::Mode mode = effect.cast<XferEffect>().mode(); | 831 SkXfermode::Mode mode = effect.cast<XferEffect>().mode(); |
832 const GrTexture* backgroundTex = | 832 const GrTexture* backgroundTex = |
833 effect.cast<XferEffect>().backgroundAccess().getTexture(); | 833 effect.cast<XferEffect>().backgroundAccess().getTexture(); |
834 GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBui
lder(); | 834 GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBui
lder(); |
835 const char* dstColor; | 835 const char* dstColor; |
836 if (backgroundTex) { | 836 if (backgroundTex) { |
837 dstColor = "bgColor"; | 837 dstColor = "bgColor"; |
838 fsBuilder->codeAppendf("\t\tvec4 %s = ", dstColor); | 838 fsBuilder->codeAppendf("\t\tvec4 %s = ", dstColor); |
839 fsBuilder->appendTextureLookup(samplers[0], coords[0].c_str(), c
oords[0].type()); | 839 fsBuilder->appendTextureLookup(samplers[0], coords[0].c_str(), c
oords[0].getType()); |
840 fsBuilder->codeAppendf(";\n"); | 840 fsBuilder->codeAppendf(";\n"); |
841 } else { | 841 } else { |
842 dstColor = fsBuilder->dstColor(); | 842 dstColor = fsBuilder->dstColor(); |
843 } | 843 } |
844 SkASSERT(dstColor); | 844 SkASSERT(dstColor); |
845 | 845 |
846 // We don't try to optimize for this case at all | 846 // We don't try to optimize for this case at all |
847 if (NULL == inputColor) { | 847 if (NULL == inputColor) { |
848 fsBuilder->codeAppendf("\t\tconst vec4 ones = vec4(1);\n"); | 848 fsBuilder->codeAppendf("\t\tconst vec4 ones = vec4(1);\n"); |
849 inputColor = "ones"; | 849 inputColor = "ones"; |
(...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1957 } else { | 1957 } else { |
1958 proc16 = rec.fProc16_General; | 1958 proc16 = rec.fProc16_General; |
1959 } | 1959 } |
1960 } | 1960 } |
1961 return proc16; | 1961 return proc16; |
1962 } | 1962 } |
1963 | 1963 |
1964 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkXfermode) | 1964 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkXfermode) |
1965 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkProcCoeffXfermode) | 1965 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkProcCoeffXfermode) |
1966 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 1966 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
OLD | NEW |