/external/skia/tests/sksl/fp/ |
D | GrFunctionReturnTypes.cpp | 19 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local 22 SkString returns_float_name = fragBuilder->getMangledFunctionName("returns_float"); in emitCode() 24 SkString returns_float2_name = fragBuilder->getMangledFunctionName("returns_float2"); in emitCode() 26 SkString returns_float3_name = fragBuilder->getMangledFunctionName("returns_float3"); in emitCode() 28 SkString returns_float4_name = fragBuilder->getMangledFunctionName("returns_float4"); in emitCode() 30 SkString returns_float2x2_name = fragBuilder->getMangledFunctionName("returns_float2x2"); in emitCode() 32 SkString returns_float3x3_name = fragBuilder->getMangledFunctionName("returns_float3x3"); in emitCode() 34 SkString returns_float4x4_name = fragBuilder->getMangledFunctionName("returns_float4x4"); in emitCode() 36 SkString returns_half_name = fragBuilder->getMangledFunctionName("returns_half"); in emitCode() 38 SkString returns_half2_name = fragBuilder->getMangledFunctionName("returns_half2"); in emitCode() [all …]
|
D | GrGrSLTypesAreSupported.cpp | 19 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local 22 SkString test_i_name = fragBuilder->getMangledFunctionName("test_i"); in emitCode() 24 SkString test_i2_name = fragBuilder->getMangledFunctionName("test_i2"); in emitCode() 26 SkString test_i3_name = fragBuilder->getMangledFunctionName("test_i3"); in emitCode() 28 SkString test_i4_name = fragBuilder->getMangledFunctionName("test_i4"); in emitCode() 30 SkString test_h3x3_name = fragBuilder->getMangledFunctionName("test_h3x3"); in emitCode() 32 SkString test_f2x2_name = fragBuilder->getMangledFunctionName("test_f2x2"); in emitCode() 34 fragBuilder->emitFunction(kInt_GrSLType, test_i_name.c_str(), {test_i_args, 1}, in emitCode() 39 fragBuilder->emitFunction(kInt2_GrSLType, test_i2_name.c_str(), {test_i2_args, 1}, in emitCode() 44 fragBuilder->emitFunction(kInt3_GrSLType, test_i3_name.c_str(), {test_i3_args, 1}, in emitCode() [all …]
|
D | GrFunctionArgTypes.cpp | 19 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local 22 SkString takes_float_name = fragBuilder->getMangledFunctionName("takes_float"); in emitCode() 24 … SkString takes_float_matrix_name = fragBuilder->getMangledFunctionName("takes_float_matrix"); in emitCode() 26 SkString takes_half_name = fragBuilder->getMangledFunctionName("takes_half"); in emitCode() 28 SkString takes_half_matrix_name = fragBuilder->getMangledFunctionName("takes_half_matrix"); in emitCode() 30 SkString takes_bool_name = fragBuilder->getMangledFunctionName("takes_bool"); in emitCode() 32 SkString takes_int_name = fragBuilder->getMangledFunctionName("takes_int"); in emitCode() 34 fragBuilder->emitFunction(kBool_GrSLType, takes_float_name.c_str(), {takes_float_args, 4}, in emitCode() 37 …fragBuilder->emitFunction(kBool_GrSLType, takes_float_matrix_name.c_str(), {takes_float_matrix_arg… in emitCode() 40 fragBuilder->emitFunction(kBool_GrSLType, takes_half_name.c_str(), {takes_half_args, 4}, in emitCode() [all …]
|
D | GrNestedCall.cpp | 19 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local 22 SkString func1_name = fragBuilder->getMangledFunctionName("func1"); in emitCode() 24 SkString func2_name = fragBuilder->getMangledFunctionName("func2"); in emitCode() 26 SkString func3_name = fragBuilder->getMangledFunctionName("func3"); in emitCode() 28 fragBuilder->emitFunctionPrototype(kHalf4_GrSLType, func1_name.c_str(), {func1_args, 0}); in emitCode() 29 fragBuilder->emitFunctionPrototype(kHalf4_GrSLType, func2_name.c_str(), {func2_args, 0}); in emitCode() 30 fragBuilder->emitFunctionPrototype(kHalf4_GrSLType, func3_name.c_str(), {func3_args, 0}); in emitCode() 34 …fragBuilder->emitFunction(kHalf4_GrSLType, func1_name.c_str(), {func1_args, 0}, func1_impl.c_str()… in emitCode() 38 …fragBuilder->emitFunction(kHalf4_GrSLType, func2_name.c_str(), {func2_args, 0}, func2_impl.c_str()… in emitCode() 39 fragBuilder->codeAppendf( in emitCode()
|
/external/skqp/src/effects/ |
D | SkHighContrastFilter.cpp | 245 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local 247 fragBuilder->codeAppendf("half4 color = %s;", args.fInputColor); in emitCode() 250 fragBuilder->codeAppendf("half nonZeroAlpha = max(color.a, 0.00001);"); in emitCode() 251 fragBuilder->codeAppendf("color = half4(color.rgb / nonZeroAlpha, nonZeroAlpha);"); in emitCode() 254 fragBuilder->codeAppend("color.rgb = color.rgb * color.rgb;"); in emitCode() 259 fragBuilder->codeAppendf("half luma = dot(color, half4(%f, %f, %f, 0));", in emitCode() 261 fragBuilder->codeAppendf("color = half4(luma, luma, luma, 0);"); in emitCode() 265 fragBuilder->codeAppendf("color = half4(1, 1, 1, 1) - color;"); in emitCode() 270 fragBuilder->codeAppendf("half fmax = max(color.r, max(color.g, color.b));"); in emitCode() 271 fragBuilder->codeAppendf("half fmin = min(color.r, min(color.g, color.b));"); in emitCode() [all …]
|
D | SkTableColorFilter.cpp | 344 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local 348 fragBuilder->codeAppendf("\t\thalf4 coord = half4(%f, %f, %f, %f);\n", in emitCode() 352 fragBuilder->codeAppendf("\t\thalf nonZeroAlpha = max(%s.a, .0001);\n", args.fInputColor); in emitCode() 353 fragBuilder->codeAppendf("\t\thalf4 coord = half4(%s.rgb / nonZeroAlpha, nonZeroAlpha);\n", in emitCode() 355 fragBuilder->codeAppendf("\t\tcoord = coord * %f + half4(%f, %f, %f, %f);\n", in emitCode() 363 fragBuilder->codeAppendf("\t\t%s.a = ", args.fOutputColor); in emitCode() 365 fragBuilder->appendTextureLookup(args.fTexSamplers[0], coord.c_str()); in emitCode() 366 fragBuilder->codeAppend(".a;\n"); in emitCode() 368 fragBuilder->codeAppendf("\t\t%s.r = ", args.fOutputColor); in emitCode() 370 fragBuilder->appendTextureLookup(args.fTexSamplers[0], coord.c_str()); in emitCode() [all …]
|
/external/skqp/src/gpu/glsl/ |
D | GrGLSLXferProcessor.cpp | 20 static void adjust_for_lcd_coverage(GrGLSLXPFragmentBuilder* fragBuilder, in adjust_for_lcd_coverage() argument 24 fragBuilder->codeAppendf("%s.a = max(max(%s.r, %s.g), %s.b);", in adjust_for_lcd_coverage() 37 GrGLSLXPFragmentBuilder* fragBuilder = args.fXPFragBuilder; in emitCode() local 39 const char* dstColor = fragBuilder->dstColor(); in emitCode() 55 fragBuilder->codeAppendf("if (all(lessThanEqual(%s.rgb, half3(0)))) {" in emitCode() 72 fragBuilder->codeAppend("// Read color from copy of the destination.\n"); in emitCode() 73 fragBuilder->codeAppendf("half2 _dstTexCoord = (sk_FragCoord.xy - %s) * %s;", in emitCode() 77 fragBuilder->codeAppend("_dstTexCoord.y = 1.0 - _dstTexCoord.y;"); in emitCode() 80 fragBuilder->codeAppendf("half4 %s = ", dstColor); in emitCode() 81 fragBuilder->appendTextureLookup(args.fDstTextureSamplerHandle, "_dstTexCoord", in emitCode() [all …]
|
D | GrGLSLFragmentProcessor.cpp | 26 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitChild() local 27 outputColor->append(fragBuilder->getMangleString()); in emitChild() 28 fragBuilder->codeAppendf("half4 %s;", outputColor->c_str()); in emitChild() 34 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in internalEmitChild() local 36 fragBuilder->onBeforeChildProcEmitCode(); // call first so mangleString is updated in internalEmitChild() 45 inputName.appendf("_childInput%s", fragBuilder->getMangleString().c_str()); in internalEmitChild() 46 fragBuilder->codeAppendf("half4 %s = %s;", inputName.c_str(), inputColor); in internalEmitChild() 52 fragBuilder->codeAppend("{\n"); in internalEmitChild() 53 fragBuilder->codeAppendf("// Child Index %d (mangle: %s): %s\n", childIndex, in internalEmitChild() 54 fragBuilder->getMangleString().c_str(), childProc.name()); in internalEmitChild() [all …]
|
/external/skia/src/gpu/effects/ |
D | GrDistanceFieldGeoProc.cpp | 31 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in onEmitCode() local 56 fragBuilder->codeAppendf("half4 %s;\n", args.fOutputColor); in onEmitCode() 84 fragBuilder->codeAppendf("float2 uv = %s;\n", uv.fsIn()); in onEmitCode() 85 fragBuilder->codeAppend("half4 texColor;"); in onEmitCode() 89 fragBuilder->codeAppend("half distance = " in onEmitCode() 93 fragBuilder->codeAppendf("distance -= %s;", distanceAdjustUniName); in onEmitCode() 96 fragBuilder->codeAppend("half afwidth;"); in onEmitCode() 104 fragBuilder->codeAppendf( in onEmitCode() 107 fragBuilder->codeAppendf( in onEmitCode() 118 fragBuilder->codeAppendf("half st_grad_len = length(half2(dFdy(%s)));", st.fsIn()); in onEmitCode() [all …]
|
D | GrBezierEffect.cpp | 78 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in onEmitCode() local 80 fragBuilder->codeAppendf("half4 %s;", args.fOutputColor); in onEmitCode() 81 this->setupUniformColor(fragBuilder, uniformHandler, args.fOutputColor, &fColorUniform); in onEmitCode() 114 fragBuilder->declAppend(edgeAlpha); in onEmitCode() 115 fragBuilder->declAppend(dklmdx); in onEmitCode() 116 fragBuilder->declAppend(dklmdy); in onEmitCode() 117 fragBuilder->declAppend(dfdx); in onEmitCode() 118 fragBuilder->declAppend(dfdy); in onEmitCode() 119 fragBuilder->declAppend(gF); in onEmitCode() 120 fragBuilder->declAppend(gFM); in onEmitCode() [all …]
|
D | GrRRectEffect.cpp | 193 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local 211 fragBuilder->codeAppendf("float2 dxy0 = %s.LT - sk_FragCoord.xy;", rectName); in emitCode() 212 fragBuilder->codeAppendf("float2 dxy1 = sk_FragCoord.xy - %s.RB;", rectName); in emitCode() 213 fragBuilder->codeAppend("float2 dxy = max(max(dxy0, dxy1), 0.0);"); in emitCode() 214 fragBuilder->codeAppendf("half alpha = half(%s);", clampedCircleDistance.c_str()); in emitCode() 217 fragBuilder->codeAppendf("float2 dxy = max(%s.LT - sk_FragCoord.xy, 0.0);", in emitCode() 219 fragBuilder->codeAppendf("half rightAlpha = half(saturate(%s.R - sk_FragCoord.x));", in emitCode() 221 fragBuilder->codeAppendf("half bottomAlpha = half(saturate(%s.B - sk_FragCoord.y));", in emitCode() 223 fragBuilder->codeAppendf("half alpha = bottomAlpha * rightAlpha * half(%s);", in emitCode() 227 fragBuilder->codeAppendf("float2 dxy = max(float2(sk_FragCoord.x - %s.R, " in emitCode() [all …]
|
D | GrShadowGeoProc.cpp | 25 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in onEmitCode() local 29 fragBuilder->codeAppend("half3 shadowParams;"); in onEmitCode() 33 fragBuilder->codeAppendf("half4 %s;", args.fOutputColor); in onEmitCode() 40 fragBuilder->codeAppend("half d = length(shadowParams.xy);"); in onEmitCode() 41 fragBuilder->codeAppend("float2 uv = float2(shadowParams.z * (1.0 - d), 0.5);"); in onEmitCode() 42 fragBuilder->codeAppend("half factor = "); in onEmitCode() 43 fragBuilder->appendTextureLookup(args.fTexSamplers[0], "uv"); in onEmitCode() 44 fragBuilder->codeAppend(".a;"); in onEmitCode() 45 fragBuilder->codeAppendf("half4 %s = half4(factor);", args.fOutputCoverage); in onEmitCode()
|
D | GrMatrixConvolutionEffect.cpp | 165 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitKernelBlock() local 172 fragBuilder->codeAppendf("for (int i = 0; i < %d; ++i)", (int)kernelArea); in emitKernelBlock() 175 GrGLSLShaderBuilder::ShaderBlock block(fragBuilder); in emitKernelBlock() 177 fragBuilder->codeAppend("half k;"); in emitKernelBlock() 178 fragBuilder->codeAppend("half2 sourceOffset;"); in emitKernelBlock() 182 fragBuilder->codeAppendf("k = %s.w + %s;", kernelSample.c_str(), kernelBias); in emitKernelBlock() 183 fragBuilder->codeAppendf("sourceOffset.y = floor(half(i) / %d);", kernelWidth); in emitKernelBlock() 184 fragBuilder->codeAppendf("sourceOffset.x = half(i) - sourceOffset.y * %d;", kernelWidth); in emitKernelBlock() 186 fragBuilder->codeAppendf("sourceOffset = half2(%d, %d);", loc.x(), loc.y()); in emitKernelBlock() 189 fragBuilder->codeAppendf("k = %s[%d][%d];", kernel, offset / 4, offset & 0x3); in emitKernelBlock() [all …]
|
D | GrBicubicEffect.cpp | 36 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local 47 fragBuilder->codeAppendf("float2 coord = %s - float2(0.5);", args.fSampleCoord); in emitCode() 48 fragBuilder->codeAppend("half2 f = half2(fract(coord));"); in emitCode() 49 fragBuilder->codeAppend("coord += 0.5 - f;"); in emitCode() 50 fragBuilder->codeAppendf("half4 wx = %s * half4(1.0, f.x, f.x * f.x, f.x * f.x * f.x);", in emitCode() 52 fragBuilder->codeAppendf("half4 wy = %s * half4(1.0, f.y, f.y * f.y, f.y * f.y * f.y);", in emitCode() 54 fragBuilder->codeAppend("half4 rowColors[4];"); in emitCode() 61 fragBuilder->codeAppendf("rowColors[%d] = %s;", x, childStr.c_str()); in emitCode() 63 fragBuilder->codeAppendf( in emitCode() 68 fragBuilder->codeAppend( in emitCode() [all …]
|
/external/skqp/src/gpu/effects/ |
D | GrDistanceFieldGeoProc.cpp | 32 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in onEmitCode() local 86 fragBuilder->codeAppendf("float2 uv = %s;\n", uv.fsIn()); in onEmitCode() 87 fragBuilder->codeAppend("half4 texColor;"); in onEmitCode() 91 fragBuilder->codeAppend("half distance = " in onEmitCode() 95 fragBuilder->codeAppendf("distance -= %s;", distanceAdjustUniName); in onEmitCode() 98 fragBuilder->codeAppend("half afwidth;"); in onEmitCode() 106 fragBuilder->codeAppendf("afwidth = abs(" SK_DistanceFieldAAFactor "*dFdx(%s.x));", in onEmitCode() 110 fragBuilder->codeAppendf("afwidth = abs(" SK_DistanceFieldAAFactor "*dFdy(%s.y));", in onEmitCode() 121 fragBuilder->codeAppendf("half st_grad_len = length(dFdx(%s));", st.fsIn()); in onEmitCode() 124 fragBuilder->codeAppendf("half st_grad_len = length(dFdy(%s));", st.fsIn()); in onEmitCode() [all …]
|
D | GrBezierEffect.cpp | 82 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in onEmitCode() local 84 this->setupUniformColor(fragBuilder, uniformHandler, args.fOutputColor, &fColorUniform); in onEmitCode() 115 fragBuilder->declAppend(edgeAlpha); in onEmitCode() 116 fragBuilder->declAppend(dklmdx); in onEmitCode() 117 fragBuilder->declAppend(dklmdy); in onEmitCode() 118 fragBuilder->declAppend(dfdx); in onEmitCode() 119 fragBuilder->declAppend(dfdy); in onEmitCode() 120 fragBuilder->declAppend(gF); in onEmitCode() 121 fragBuilder->declAppend(gFM); in onEmitCode() 122 fragBuilder->declAppend(func); in onEmitCode() [all …]
|
D | GrRRectEffect.cpp | 175 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local 193 fragBuilder->codeAppendf("float2 dxy0 = %s.xy - sk_FragCoord.xy;", rectName); in emitCode() 194 fragBuilder->codeAppendf("float2 dxy1 = sk_FragCoord.xy - %s.zw;", rectName); in emitCode() 195 fragBuilder->codeAppend("float2 dxy = max(max(dxy0, dxy1), 0.0);"); in emitCode() 196 fragBuilder->codeAppendf("half alpha = %s;", clampedCircleDistance.c_str()); in emitCode() 199 fragBuilder->codeAppendf("float2 dxy = max(%s.xy - sk_FragCoord.xy, 0.0);", in emitCode() 201 fragBuilder->codeAppendf("half rightAlpha = saturate(%s.z - sk_FragCoord.x);", in emitCode() 203 fragBuilder->codeAppendf("half bottomAlpha = saturate(%s.w - sk_FragCoord.y);", in emitCode() 205 fragBuilder->codeAppendf("half alpha = bottomAlpha * rightAlpha * %s;", in emitCode() 209 fragBuilder->codeAppendf("float2 dxy = max(float2(sk_FragCoord.x - %s.z, " in emitCode() [all …]
|
D | GrBicubicEffect.cpp | 46 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local 47 SkString coords2D = fragBuilder->ensureCoords2D(args.fTransformedCoords[0]); in emitCode() 67 fragBuilder->codeAppend("half4x4 kMitchellCoefficients = half4x4(" in emitCode() 72 fragBuilder->codeAppendf("float2 coord = %s - %s * float2(0.5);", coords2D.c_str(), imgInc); in emitCode() 77 fragBuilder->codeAppendf("coord /= %s;", imgInc); in emitCode() 78 fragBuilder->codeAppend("float2 f = fract(coord);"); in emitCode() 79 fragBuilder->codeAppendf("coord = (coord - f + float2(0.5)) * %s;", imgInc); in emitCode() 80 …fragBuilder->codeAppend("half4 wx = kMitchellCoefficients * half4(1.0, f.x, f.x * f.x, f.x * f.x *… in emitCode() 81 …fragBuilder->codeAppend("half4 wy = kMitchellCoefficients * half4(1.0, f.y, f.y * f.y, f.y * f.y *… in emitCode() 82 fragBuilder->codeAppend("half4 rowColors[4];"); in emitCode() [all …]
|
D | GrShadowGeoProc.cpp | 25 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in onEmitCode() local 29 fragBuilder->codeAppend("half3 shadowParams;"); in onEmitCode() 45 fragBuilder->codeAppend("half d = length(shadowParams.xy);"); in onEmitCode() 46 fragBuilder->codeAppend("half distance = shadowParams.z * (1.0 - d);"); in onEmitCode() 48 fragBuilder->codeAppend("half factor = 1.0 - clamp(distance, 0.0, 1.0);"); in onEmitCode() 49 fragBuilder->codeAppend("factor = exp(-factor * factor * 4.0) - 0.018;"); in onEmitCode() 50 fragBuilder->codeAppendf("%s = half4(factor);", in onEmitCode()
|
D | GrSRGBEffect.cpp | 19 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local 27 fragBuilder->emitFunction(kHalf_GrSLType, in emitCode() 36 fragBuilder->emitFunction(kHalf_GrSLType, in emitCode() 48 fragBuilder->codeAppendf("float4 color = %s;", args.fInputColor); in emitCode() 50 fragBuilder->codeAppendf("half nonZeroAlpha = max(color.a, 0.00001);"); in emitCode() 51 fragBuilder->codeAppendf("color = half4(color.rgb / nonZeroAlpha, color.a);"); in emitCode() 53 fragBuilder->codeAppendf("color = half4(%s(color.r), %s(color.g), %s(color.b), color.a);", in emitCode() 58 fragBuilder->codeAppendf("color = half4(color.rgb, 1) * color.a;"); in emitCode() 60 fragBuilder->codeAppendf("%s = color;", args.fOutputColor); in emitCode()
|
D | GrRectBlurEffect.cpp | 22 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local 48 fragBuilder->codeAppendf( in emitCode() 65 fragBuilder->getProgramBuilder()->samplerVariable(args.fTexSamplers[0]).c_str()); in emitCode() 66 fragBuilder->codeAppendf( in emitCode() 74 fragBuilder->getProgramBuilder()->samplerSwizzle(args.fTexSamplers[0]).c_str(), in emitCode() 76 fragBuilder->getProgramBuilder()->samplerVariable(args.fTexSamplers[0]).c_str(), in emitCode() 77 fragBuilder->getProgramBuilder()->samplerSwizzle(args.fTexSamplers[0]).c_str(), in emitCode() 86 fragBuilder->codeAppendf( in emitCode() 95 fragBuilder->getProgramBuilder()->samplerVariable(args.fTexSamplers[0]).c_str(), in emitCode() 96 fragBuilder->getProgramBuilder()->samplerSwizzle(args.fTexSamplers[0]).c_str(), in emitCode() [all …]
|
D | GrGaussianConvolutionFragmentProcessor.cpp | 58 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local 59 SkString coords2D = fragBuilder->ensureCoords2D(args.fTransformedCoords[0]); in emitCode() 61 fragBuilder->codeAppendf("%s = half4(0, 0, 0, 0);", args.fOutputColor); in emitCode() 66 … fragBuilder->codeAppendf("float2 coord = %s - %d.0 * %s;", coords2D.c_str(), ce.radius(), imgInc); in emitCode() 67 fragBuilder->codeAppend("float2 coordSampled = half2(0, 0);"); in emitCode() 78 fragBuilder->codeAppend("coordSampled = coord;"); in emitCode() 88 fragBuilder->codeAppendf("coordSampled.%s = clamp(coord.%s, %s.x, %s.y);\n", in emitCode() 93 fragBuilder->codeAppendf("coordSampled.%s = " in emitCode() 99 fragBuilder->codeAppendf("if (coord.%s >= %s.x && coord.%s <= %s.y) {", in emitCode() 108 fragBuilder->codeAppendf("%s += ", args.fOutputColor); in emitCode() [all …]
|
D | GrMatrixConvolutionEffect.cpp | 65 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local 66 SkString coords2D = fragBuilder->ensureCoords2D(args.fTransformedCoords[0]); in emitCode() 67 fragBuilder->codeAppend("half4 sum = half4(0, 0, 0, 0);"); in emitCode() 68 … fragBuilder->codeAppendf("float2 coord = %s - %s * %s;", coords2D.c_str(), kernelOffset, imgInc); in emitCode() 69 fragBuilder->codeAppend("half4 c;"); in emitCode() 74 GrGLSLShaderBuilder::ShaderBlock block(fragBuilder); in emitCode() 77 fragBuilder->codeAppendf("half k = %s[%d]%s;", kernel, offset / 4, in emitCode() 81 fDomain.sampleTexture(fragBuilder, in emitCode() 89 fragBuilder->codeAppend("c.rgb /= c.a;"); in emitCode() 90 fragBuilder->codeAppend("c.rgb = saturate(c.rgb);"); in emitCode() [all …]
|
D | GrYUVtoRGBEffect.cpp | 93 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local 107 coords[i] = fragBuilder->ensureCoords2D(args.fTransformedCoords[i]); in emitCode() 111 fragBuilder->codeAppendf( in emitCode() 114 fragBuilder->getProgramBuilder()->samplerVariable(args.fTexSamplers[i]).c_str(), in emitCode() 116 fragBuilder->getProgramBuilder()->samplerSwizzle(args.fTexSamplers[i]).c_str()); in emitCode() 121 fragBuilder->codeAppendf( in emitCode() 130 fragBuilder->codeAppendf( in emitCode() 134 fragBuilder->codeAppend("yuvOne *= a;"); in emitCode() 136 fragBuilder->codeAppendf("float a = 1.0;"); in emitCode() 139 fragBuilder->codeAppendf("%s = half4(yuvOne.xyz, a);", args.fOutputColor); in emitCode()
|
/external/skia/src/gpu/glsl/ |
D | GrGLSLXferProcessor.cpp | 20 static void adjust_for_lcd_coverage(GrGLSLXPFragmentBuilder* fragBuilder, in adjust_for_lcd_coverage() argument 24 fragBuilder->codeAppendf("%s.a = max(max(%s.r, %s.g), %s.b);", in adjust_for_lcd_coverage() 35 GrGLSLXPFragmentBuilder* fragBuilder = args.fXPFragBuilder; in emitCode() local 37 const char* dstColor = fragBuilder->dstColor(); in emitCode() 52 fragBuilder->codeAppendf("if (all(lessThanEqual(%s.rgb, half3(0)))) {" in emitCode() 73 fragBuilder->codeAppend("// Read color from copy of the destination.\n"); in emitCode() 74 fragBuilder->codeAppendf("half2 _dstTexCoord = (half2(sk_FragCoord.xy) - %s) * %s;", in emitCode() 78 fragBuilder->codeAppend("_dstTexCoord.y = 1.0 - _dstTexCoord.y;"); in emitCode() 81 fragBuilder->codeAppendf("half4 %s = ", dstColor); in emitCode() 82 fragBuilder->appendTextureLookup(args.fDstTextureSamplerHandle, "_dstTexCoord"); in emitCode() [all …]
|