/external/skia/src/gpu/glsl/ |
H A D | GrGLSLXferProcessor.cpp | 21 GrGLSLXPFragmentBuilder* fragBuilder = args.fXPFragBuilder; local 23 const char* dstColor = fragBuilder->dstColor(); 31 fragBuilder->codeAppendf("if (all(lessThanEqual(%s, vec4(0)))) {" 49 const char* fragPos = fragBuilder->fragmentPosition(); 51 fragBuilder->codeAppend("// Read color from copy of the destination.\n"); 52 fragBuilder->codeAppendf("vec2 _dstTexCoord = (%s.xy - %s) * %s;", 56 fragBuilder->codeAppend("_dstTexCoord.y = 1.0 - _dstTexCoord.y;"); 59 fragBuilder->codeAppendf("vec4 %s = ", dstColor); 60 fragBuilder->appendTextureLookup(args.fSamplers[0], "_dstTexCoord", kVec2f_GrSLType); 61 fragBuilder 91 DefaultCoverageModulation(GrGLSLXPFragmentBuilder* fragBuilder, const char* srcCoverage, const char* dstColor, const char* outColor, const char* outColorSecondary, const GrXferProcessor& proc) argument [all...] |
H A D | GrGLSLFragmentProcessor.cpp | 31 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; local 32 outputColor->append(fragBuilder->getMangleString()); 33 fragBuilder->codeAppendf("vec4 %s;", outputColor->c_str()); 39 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; local 41 fragBuilder->onBeforeChildProcEmitCode(); // call first so mangleString is updated 93 fragBuilder->codeAppend("{\n"); 94 fragBuilder->codeAppendf("// Child Index %d (mangle: %s): %s\n", childIndex, 95 fragBuilder->getMangleString().c_str(), childProc.name()); 96 EmitArgs childArgs(fragBuilder, 105 fragBuilder [all...] |
H A D | GrGLSLPrimitiveProcessor.cpp | 37 void GrGLSLPrimitiveProcessor::setupUniformColor(GrGLSLPPFragmentBuilder* fragBuilder, argument 48 fragBuilder->codeAppendf("%s = %s;", outputName, stagedLocalVarName);
|
H A D | GrGLSLXferProcessor.h | 27 EmitArgs(GrGLSLXPFragmentBuilder* fragBuilder, argument 37 : fXPFragBuilder(fragBuilder) 75 static void DefaultCoverageModulation(GrGLSLXPFragmentBuilder* fragBuilder,
|
H A D | GrGLSLPrimitiveProcessor.h | 38 GrGLSLPPFragmentBuilder* fragBuilder, 49 , fFragBuilder(fragBuilder) 95 void setupUniformColor(GrGLSLPPFragmentBuilder* fragBuilder, 37 EmitArgs(GrGLSLVertexBuilder* vertBuilder, GrGLSLPPFragmentBuilder* fragBuilder, GrGLSLVaryingHandler* varyingHandler, GrGLSLUniformHandler* uniformHandler, const GrGLSLCaps* caps, const GrPrimitiveProcessor& gp, const char* outputColor, const char* outputCoverage, const TextureSamplerArray& samplers, const TransformsIn& transformsIn, TransformsOut* transformsOut) argument
|
/external/skia/src/effects/ |
H A D | SkPixelXorXfermode.cpp | 55 static void add_pixelxor_code(GrGLSLFragmentBuilder* fragBuilder, argument 72 fragBuilder->emitFunction(kFloat_GrSLType, 82 fragBuilder->codeAppend("float red = 0.0, green = 0.0, blue = 0.0;"); 85 fragBuilder->codeAppendf("vec3 src = 255.99 * %s.rgb;", srcColor); 87 fragBuilder->codeAppendf("vec3 src = vec3(255.99);"); 89 fragBuilder->codeAppendf("vec3 dst = 255.99 * %s.rgb;", dstColor); 90 fragBuilder->codeAppendf("vec3 op = 255.99 * %s;", opColor); 92 fragBuilder->codeAppend("float modValue = 128.0;"); 94 fragBuilder->codeAppend("for (int i = 0; i < 8; i++) {"); 96 fragBuilder 175 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; variable [all...] |
H A D | SkMagnifierImageFilter.cpp | 132 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; local 133 SkString coords2D = fragBuilder->ensureFSCoords2D(args.fCoords, 0); 134 fragBuilder->codeAppendf("\t\tvec2 coord = %s;\n", coords2D.c_str()); 135 fragBuilder->codeAppendf("\t\tvec2 zoom_coord = %s + %s * %s;\n", 140 fragBuilder->codeAppendf("\t\tvec2 delta = (coord - %s.xy) * %s.zw;\n", bounds, bounds); 141 fragBuilder->codeAppendf("\t\tdelta = min(delta, vec2(1.0, 1.0) - delta);\n"); 142 fragBuilder->codeAppendf("\t\tdelta = delta * %s;\n", 145 fragBuilder->codeAppend("\t\tfloat weight = 0.0;\n"); 146 fragBuilder->codeAppend("\t\tif (delta.s < 2.0 && delta.t < 2.0) {\n"); 147 fragBuilder [all...] |
H A D | SkLumaColorFilter.cpp | 72 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; variable 73 fragBuilder->codeAppendf("\tfloat luma = dot(vec3(%f, %f, %f), %s.rgb);\n", 78 fragBuilder->codeAppendf("\t%s = vec4(0, 0, 0, luma);\n",
|
H A D | GrCircleBlurFragmentProcessor.cpp | 49 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; local 50 const char *fragmentPos = fragBuilder->fragmentPosition(); 53 fragBuilder->codeAppendf("vec4 src=%s;", args.fInputColor); 55 fragBuilder->codeAppendf("vec4 src=vec4(1);"); 60 fragBuilder->codeAppendf("vec2 vec = vec2( (%s.x - %s.x) * %s.w , (%s.y - %s.y) * %s.w );", 63 fragBuilder->codeAppendf("float dist = length(vec) + ( 0.5 - %s.z ) * %s.w;", 66 fragBuilder->codeAppendf("float intensity = "); 67 fragBuilder->appendTextureLookup(args.fSamplers[0], "vec2(dist, 0.5)"); 68 fragBuilder->codeAppend(".a;"); 70 fragBuilder [all...] |
H A D | SkAlphaThresholdFilter.cpp | 175 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; local 176 SkString coords2D = fragBuilder->ensureFSCoords2D(args.fCoords, 0); 177 SkString maskCoords2D = fragBuilder->ensureFSCoords2D(args.fCoords, 1); 179 fragBuilder->codeAppendf("\t\tvec2 coord = %s;\n", coords2D.c_str()); 180 fragBuilder->codeAppendf("\t\tvec2 mask_coord = %s;\n", maskCoords2D.c_str()); 181 fragBuilder->codeAppend("\t\tvec4 input_color = "); 182 fragBuilder->appendTextureLookup(args.fSamplers[0], "coord"); 183 fragBuilder->codeAppend(";\n"); 184 fragBuilder->codeAppend("\t\tvec4 mask_color = "); 185 fragBuilder [all...] |
H A D | SkArithmeticMode_gpu.cpp | 22 static void add_arithmetic_code(GrGLSLFragmentBuilder* fragBuilder, argument 30 fragBuilder->codeAppend("const vec4 src = vec4(1);"); 32 fragBuilder->codeAppendf("vec4 src = %s;", srcColor); 35 fragBuilder->codeAppendf("vec4 dst = %s;", dstColor); 36 fragBuilder->codeAppendf("%s = %s.x * src * dst + %s.y * src + %s.z * dst + %s.w;", 38 fragBuilder->codeAppendf("%s = clamp(%s, 0.0, 1.0);\n", outputColor, outputColor); 40 fragBuilder->codeAppendf("%s.rgb = min(%s.rgb, %s.a);", 50 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; variable 59 add_arithmetic_code(fragBuilder, 197 void emitBlendCodeForDstRead(GrGLSLXPFragmentBuilder* fragBuilder, [all...] |
H A D | SkColorCubeFilter.cpp | 259 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; local 262 fragBuilder->codeAppendf("\tfloat %s = max(%s.a, 0.00001);\n", nonZeroAlpha, args.fInputColor); 263 fragBuilder->codeAppendf("\tvec4 %s = vec4(%s.rgb / %s, %s);\n", 267 fragBuilder->codeAppendf( 273 fragBuilder->codeAppendf("vec2 %s = vec2(%s.r, (floor(%s.b) + %s.g) * %s);\n", 275 fragBuilder->codeAppendf("vec2 %s = vec2(%s.r, (ceil(%s.b) + %s.g) * %s);\n", 279 fragBuilder->codeAppendf("%s = vec4(mix(", args.fOutputColor); 280 fragBuilder->appendTextureLookup(args.fSamplers[0], cCoords1); 281 fragBuilder->codeAppend(".bgr, "); 282 fragBuilder [all...] |
/external/skia/src/gpu/effects/ |
H A D | GrDistanceFieldGeoProc.cpp | 37 GrGLSLPPFragmentBuilder* fragBuilder = args.fFragBuilder; variable 38 SkAssertResult(fragBuilder->enableFeature( 98 fragBuilder->codeAppend(GrGLSLShaderVar::PrecisionString(args.fGLSLCaps, 100 fragBuilder->codeAppendf("vec2 uv = %s;\n", uv.fsIn()); 102 fragBuilder->codeAppend("\tfloat texColor = "); 103 fragBuilder->appendTextureLookup(args.fSamplers[0], 106 fragBuilder->codeAppend(".r;\n"); 107 fragBuilder->codeAppend("\tfloat distance = " 111 fragBuilder->codeAppendf("distance -= %s;", distanceAdjustUniName); 114 fragBuilder 279 GrGLSLPPFragmentBuilder* fragBuilder = args.fFragBuilder; variable 496 GrGLSLPPFragmentBuilder* fragBuilder = args.fFragBuilder; variable [all...] |
H A D | GrBezierEffect.cpp | 90 GrGLSLPPFragmentBuilder* fragBuilder = args.fFragBuilder; local 93 this->setupUniformColor(fragBuilder, uniformHandler, args.fOutputColor, &fColorUniform); 135 fragBuilder->declAppend(edgeAlpha); 136 fragBuilder->declAppend(dklmdx); 137 fragBuilder->declAppend(dklmdy); 138 fragBuilder->declAppend(dfdx); 139 fragBuilder->declAppend(dfdy); 140 fragBuilder->declAppend(gF); 141 fragBuilder->declAppend(gFM); 142 fragBuilder 364 GrGLSLPPFragmentBuilder* fragBuilder = args.fFragBuilder; local 567 GrGLSLPPFragmentBuilder* fragBuilder = args.fFragBuilder; local [all...] |
H A D | GrConvexPolyEffect.cpp | 113 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; local 114 const char* fragmentPos = fragBuilder->fragmentPosition(); 118 fragBuilder->codeAppend("\t\tfloat xSub, ySub;\n"); 119 fragBuilder->codeAppendf("\t\txSub = min(%s.x - %s.x, 0.0);\n", fragmentPos, rectName); 120 fragBuilder->codeAppendf("\t\txSub += min(%s.z - %s.x, 0.0);\n", rectName, fragmentPos); 121 fragBuilder->codeAppendf("\t\tySub = min(%s.y - %s.y, 0.0);\n", fragmentPos, rectName); 122 fragBuilder->codeAppendf("\t\tySub += min(%s.w - %s.y, 0.0);\n", rectName, fragmentPos); 125 fragBuilder->codeAppendf("\t\tfloat alpha = (1.0 + max(xSub, -1.0)) * (1.0 + max(ySub, -1.0));\n"); 127 fragBuilder->codeAppendf("\t\tfloat alpha = 1.0;\n"); 128 fragBuilder 197 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; local [all...] |
H A D | GrDitherEffect.cpp | 70 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; local 80 fragBuilder->codeAppendf("\t\tfloat r = " 82 fragBuilder->fragmentPosition()); 83 fragBuilder->codeAppendf("\t\t%s = (1.0/255.0) * vec4(r, r, r, r) + %s;\n",
|
H A D | GrSimpleTextureEffect.cpp | 17 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; variable 18 fragBuilder->codeAppendf("%s = ", args.fOutputColor); 19 fragBuilder->appendTextureLookupAndModulate(args.fInputColor, 23 fragBuilder->codeAppend(";");
|
H A D | GrRRectEffect.cpp | 178 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; local 179 const char* fragmentPos = fragBuilder->fragmentPosition(); 197 fragBuilder->codeAppendf("vec2 dxy0 = %s.xy - %s.xy;", rectName, fragmentPos); 198 fragBuilder->codeAppendf("vec2 dxy1 = %s.xy - %s.zw;", fragmentPos, rectName); 199 fragBuilder->codeAppend("vec2 dxy = max(max(dxy0, dxy1), 0.0);"); 200 fragBuilder->codeAppendf("float alpha = %s;", clampedCircleDistance.c_str()); 203 fragBuilder->codeAppendf("vec2 dxy = max(%s.xy - %s.xy, 0.0);", 205 fragBuilder->codeAppendf("float rightAlpha = clamp(%s.z - %s.x, 0.0, 1.0);", 207 fragBuilder->codeAppendf("float bottomAlpha = clamp(%s.w - %s.y, 0.0, 1.0);", 209 fragBuilder 516 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; local [all...] |
H A D | GrOvalEffect.cpp | 123 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; local 124 const char* fragmentPos = fragBuilder->fragmentPosition(); 132 fragBuilder->codeAppendf("float d = (length((%s.xy - %s.xy) * %s.w) - 1.0) * %s.z;", 135 fragBuilder->codeAppendf("float d = (1.0 - length((%s.xy - %s.xy) * %s.w)) * %s.z;", 139 fragBuilder->codeAppend("d = clamp(d, 0.0, 1.0);"); 141 fragBuilder->codeAppend("d = d > 0.5 ? 1.0 : 0.0;"); 144 fragBuilder->codeAppendf("%s = %s;", args.fOutputColor, 304 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; local 305 const char* fragmentPos = fragBuilder->fragmentPosition(); 308 fragBuilder [all...] |
H A D | GrBicubicEffect.cpp | 71 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; local 72 SkString coords2D = fragBuilder->ensureFSCoords2D(args.fCoords, 0); 73 fragBuilder->emitFunction(kVec4f_GrSLType, 81 fragBuilder->codeAppendf("\tvec2 coord = %s - %s * vec2(0.5);\n", coords2D.c_str(), imgInc); 86 fragBuilder->codeAppendf("\tcoord /= %s;\n", imgInc); 87 fragBuilder->codeAppend("\tvec2 f = fract(coord);\n"); 88 fragBuilder->codeAppendf("\tcoord = (coord - f + vec2(0.5)) * %s;\n", imgInc); 89 fragBuilder->codeAppend("\tvec4 rowColors[4];\n"); 96 fDomain.sampleTexture(fragBuilder, 104 fragBuilder [all...] |
H A D | GrConvolutionEffect.cpp | 53 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; local 54 SkString coords2D = fragBuilder->ensureFSCoords2D(args.fCoords, 0); 56 fragBuilder->codeAppendf("%s = vec4(0, 0, 0, 0);", args.fOutputColor); 61 fragBuilder->codeAppendf("vec2 coord = %s - %d.0 * %s;", coords2D.c_str(), ce.radius(), imgInc); 76 fragBuilder->codeAppendf("if (coord.%s >= %s.x && coord.%s <= %s.y) {", 79 fragBuilder->codeAppendf("\t\t%s += ", args.fOutputColor); 80 fragBuilder->appendTextureLookup(args.fSamplers[0], "coord"); 81 fragBuilder->codeAppendf(" * %s;\n", kernelIndex.c_str()); 83 fragBuilder->codeAppend("}"); 85 fragBuilder [all...] |
H A D | GrMatrixConvolutionEffect.cpp | 64 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; local 65 SkString coords2D = fragBuilder->ensureFSCoords2D(args.fCoords, 0); 66 fragBuilder->codeAppend("vec4 sum = vec4(0, 0, 0, 0);"); 67 fragBuilder->codeAppendf("vec2 coord = %s - %s * %s;", coords2D.c_str(), kernelOffset, imgInc); 68 fragBuilder->codeAppend("vec4 c;"); 72 GrGLSLShaderBuilder::ShaderBlock block(fragBuilder); 73 fragBuilder->codeAppendf("float k = %s[%d * %d + %d];", kernel, y, kWidth, x); 76 fDomain.sampleTexture(fragBuilder, 84 fragBuilder->codeAppend("c.rgb /= c.a;"); 85 fragBuilder [all...] |
H A D | GrBitmapTextGeoProc.cpp | 42 GrGLSLPPFragmentBuilder* fragBuilder = args.fFragBuilder; variable 48 this->setupUniformColor(fragBuilder, uniformHandler, args.fOutputColor, 67 fragBuilder->codeAppendf("%s = ", args.fOutputColor); 68 fragBuilder->appendTextureLookupAndModulate(args.fOutputColor, 72 fragBuilder->codeAppend(";"); 73 fragBuilder->codeAppendf("%s = vec4(1);", args.fOutputCoverage); 75 fragBuilder->codeAppendf("%s = ", args.fOutputCoverage); 76 fragBuilder->appendTextureLookup(args.fSamplers[0], v.fsIn(), kVec2f_GrSLType); 77 fragBuilder->codeAppend(";"); 80 fragBuilder [all...] |
H A D | GrConfigConversionEffect.cpp | 29 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; variable 31 fragBuilder->codeAppendf("%s;", tmpDecl.c_str()); 33 fragBuilder->codeAppendf("%s = ", tmpVar.c_str()); 34 fragBuilder->appendTextureLookup(args.fSamplers[0], args.fCoords[0].c_str(), 36 fragBuilder->codeAppend(";"); 40 fragBuilder->codeAppendf("%s = %s.%s;", args.fOutputColor, tmpVar.c_str(), 45 fragBuilder->codeAppendf( 54 fragBuilder->codeAppendf( 60 fragBuilder->codeAppendf( 66 fragBuilder [all...] |
/external/skia/tools/debugger/ |
H A D | SkOverdrawMode.cpp | 67 static void add_overdraw_code(GrGLSLFragmentBuilder* fragBuilder, argument 80 fragBuilder->emitFunction(kVec4f_GrSLType, 96 fragBuilder->codeAppend("int nextIdx;"); 97 fragBuilder->codeAppendf("vec4 dst = %s;", dstColor); 98 fragBuilder->codeAppend("if (dst.r < 0.25) { nextIdx = 1; }"); 100 fragBuilder->codeAppend("else if (dst.g < 0.0977) { nextIdx = 10; }"); 101 fragBuilder->codeAppend("else if (dst.b > 0.08) { nextIdx = 8 - int(6.0 * dst.b + 0.5); }"); 102 fragBuilder->codeAppend("else { nextIdx = 11 - int(5.7 * dst.g + 0.5); }"); 103 fragBuilder->codeAppendf("%s = %s(float(nextIdx));", outputColor, colorTableFuncName.c_str()); 109 GrGLSLFragmentBuilder* fragBuilder variable [all...] |