From 5af9ea399d5e0344cc4b7da4e97b5dc5b3c74f64 Mon Sep 17 00:00:00 2001 From: Ethan Nicholas Date: Fri, 28 Jul 2017 15:19:46 -0400 Subject: renamed SkSL types in preparation for killing precision modifiers Bug: skia: Change-Id: Iff0289e25355a89cdc289a0892ed755dd1b1c900 Reviewed-on: https://skia-review.googlesource.com/27703 Commit-Queue: Ethan Nicholas Reviewed-by: Brian Salomon --- src/gpu/ccpr/GrCCPRPathProcessor.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/gpu/ccpr/GrCCPRPathProcessor.cpp') diff --git a/src/gpu/ccpr/GrCCPRPathProcessor.cpp b/src/gpu/ccpr/GrCCPRPathProcessor.cpp index 6efaecf9f9..1292553824 100644 --- a/src/gpu/ccpr/GrCCPRPathProcessor.cpp +++ b/src/gpu/ccpr/GrCCPRPathProcessor.cpp @@ -136,41 +136,41 @@ void GLSLPathProcessor::onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) { // Find the intersections of (bloated) devBounds and devBounds45 in order to come up with an // octagon that circumscribes the (bloated) path. A vertex is the intersection of two lines: // one edge from the path's bounding box and one edge from its 45-degree bounding box. - v->codeAppendf("highp mat2 N = mat2(%s);", proc.getEdgeNormsAttrib().fName); + v->codeAppendf("highp float2x2 N = float2x2(%s);", proc.getEdgeNormsAttrib().fName); // N[0] is the normal for the edge we are intersecting from the regular bounding box, pointing // out of the octagon. - v->codeAppendf("highp vec2 refpt = (min(N[0].x, N[0].y) < 0) ? %s.xy : %s.zw;", + v->codeAppendf("highp float2 refpt = (min(N[0].x, N[0].y) < 0) ? %s.xy : %s.zw;", proc.getInstanceAttrib(InstanceAttribs::kDevBounds).fName, proc.getInstanceAttrib(InstanceAttribs::kDevBounds).fName); v->codeAppendf("refpt += N[0] * %f;", kAABloatRadius); // bloat for AA. // N[1] is the normal for the edge we are intersecting from the 45-degree bounding box, pointing // out of the octagon. - v->codeAppendf("highp vec2 refpt45 = (N[1].x < 0) ? %s.xy : %s.zw;", + v->codeAppendf("highp float2 refpt45 = (N[1].x < 0) ? %s.xy : %s.zw;", proc.getInstanceAttrib(InstanceAttribs::kDevBounds45).fName, proc.getInstanceAttrib(InstanceAttribs::kDevBounds45).fName); - v->codeAppendf("refpt45 *= mat2(.5,.5,-.5,.5);"); // transform back to device space. + v->codeAppendf("refpt45 *= float2x2(.5,.5,-.5,.5);"); // transform back to device space. v->codeAppendf("refpt45 += N[1] * %f;", kAABloatRadius); // bloat for AA. - v->codeAppend ("highp vec2 K = vec2(dot(N[0], refpt), dot(N[1], refpt45));"); - v->codeAppendf("highp vec2 octocoord = K * inverse(N);"); + v->codeAppend ("highp float2 K = float2(dot(N[0], refpt), dot(N[1], refpt45));"); + v->codeAppendf("highp float2 octocoord = K * inverse(N);"); gpArgs->fPositionVar.set(kVec2f_GrSLType, "octocoord"); // Convert to atlas coordinates in order to do our texture lookup. - v->codeAppendf("highp vec2 atlascoord = octocoord + vec2(%s);", + v->codeAppendf("highp float2 atlascoord = octocoord + float2(%s);", proc.getInstanceAttrib(InstanceAttribs::kAtlasOffset).fName); if (kTopLeft_GrSurfaceOrigin == proc.atlasProxy()->origin()) { v->codeAppendf("%s = atlascoord * %s;", texcoord.vsOut(), atlasAdjust); } else { SkASSERT(kBottomLeft_GrSurfaceOrigin == proc.atlasProxy()->origin()); - v->codeAppendf("%s = vec2(atlascoord.x * %s.x, 1 - atlascoord.y * %s.y);", + v->codeAppendf("%s = float2(atlascoord.x * %s.x, 1 - atlascoord.y * %s.y);", texcoord.vsOut(), atlasAdjust, atlasAdjust); } // Convert to (local) path cordinates. - v->codeAppendf("highp vec2 pathcoord = inverse(mat2(%s)) * (octocoord - %s);", + v->codeAppendf("highp float2 pathcoord = inverse(float2x2(%s)) * (octocoord - %s);", proc.getInstanceAttrib(InstanceAttribs::kViewMatrix).fName, proc.getInstanceAttrib(InstanceAttribs::kViewTranslate).fName); @@ -185,11 +185,11 @@ void GLSLPathProcessor::onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) { f->codeAppend (".a;"); if (SkPath::kWinding_FillType == proc.fillType()) { - f->codeAppendf("%s = vec4(min(abs(coverage_count), 1));", args.fOutputCoverage); + f->codeAppendf("%s = float4(min(abs(coverage_count), 1));", args.fOutputCoverage); } else { SkASSERT(SkPath::kEvenOdd_FillType == proc.fillType()); f->codeAppend ("mediump float t = mod(abs(coverage_count), 2);"); - f->codeAppendf("%s = vec4(1 - abs(t - 1));", args.fOutputCoverage); + f->codeAppendf("%s = float4(1 - abs(t - 1));", args.fOutputCoverage); } } -- cgit v1.2.3