Android-x86
Fork
Spenden

  • R/O
  • HTTP
  • SSH
  • HTTPS

frameworks-native: Commit

frameworks/native


Commit MetaInfo

Revision2173449d9dccb15b87c9df5d373dc32e1dcabed6 (tree)
Zeit2019-07-29 07:26:42
Autorandroid-build-team Robot <android-build-team-robot@goog...>
Commiterandroid-build-team Robot

Log Message

Merge cherrypicks of [9007561, 9007562, 9007563, 9007600, 9007801, 9007895, 9007389] into qt-release

Change-Id: I10d7f5b7ccd28effeb39bbbbb7a454d819e1f93d

Ändern Zusammenfassung

Diff

--- a/libs/renderengine/gl/ProgramCache.cpp
+++ b/libs/renderengine/gl/ProgramCache.cpp
@@ -575,10 +575,11 @@ String8 ProgramCache::generateFragmentShader(const Key& needs) {
575575 float applyCornerRadius(vec2 cropCoords)
576576 {
577577 vec2 position = cropCoords - cropCenter;
578- // Increase precision here so that a large corner radius doesn't
579- // cause floating point error
580- highp vec2 dist = abs(position) + vec2(cornerRadius) - cropCenter;
581- float plane = length(max(dist, vec2(0.0)));
578+ // Scale down the dist vector here, as otherwise large corner
579+ // radii can cause floating point issues when computing the norm
580+ vec2 dist = (abs(position) - cropCenter + vec2(cornerRadius)) / 16.0;
581+ // Once we've found the norm, then scale back up.
582+ float plane = length(max(dist, vec2(0.0))) * 16.0;
582583 return 1.0 - clamp(plane - cornerRadius, 0.0, 1.0);
583584 }
584585 )__SHADER__";
Show on old repository browser