Loading libs/renderengine/gl/ProgramCache.cpp +3 −1 Original line number Original line Diff line number Diff line Loading @@ -575,7 +575,9 @@ String8 ProgramCache::generateFragmentShader(const Key& needs) { float applyCornerRadius(vec2 cropCoords) float applyCornerRadius(vec2 cropCoords) { { vec2 position = cropCoords - cropCenter; vec2 position = cropCoords - cropCenter; vec2 dist = abs(position) + vec2(cornerRadius) - cropCenter; // Increase precision here so that a large corner radius doesn't // cause floating point error highp vec2 dist = abs(position) + vec2(cornerRadius) - cropCenter; float plane = length(max(dist, vec2(0.0))); float plane = length(max(dist, vec2(0.0))); return 1.0 - clamp(plane - cornerRadius, 0.0, 1.0); return 1.0 - clamp(plane - cornerRadius, 0.0, 1.0); } } Loading Loading
libs/renderengine/gl/ProgramCache.cpp +3 −1 Original line number Original line Diff line number Diff line Loading @@ -575,7 +575,9 @@ String8 ProgramCache::generateFragmentShader(const Key& needs) { float applyCornerRadius(vec2 cropCoords) float applyCornerRadius(vec2 cropCoords) { { vec2 position = cropCoords - cropCenter; vec2 position = cropCoords - cropCenter; vec2 dist = abs(position) + vec2(cornerRadius) - cropCenter; // Increase precision here so that a large corner radius doesn't // cause floating point error highp vec2 dist = abs(position) + vec2(cornerRadius) - cropCenter; float plane = length(max(dist, vec2(0.0))); float plane = length(max(dist, vec2(0.0))); return 1.0 - clamp(plane - cornerRadius, 0.0, 1.0); return 1.0 - clamp(plane - cornerRadius, 0.0, 1.0); } } Loading