消除 Google GMSMapView 随机白线

问题描述

在地图上滚动时,偶尔会出现一条白线闪烁。我正在尝试回答以下两个问题:

  1. 为什么会出现白线?
  2. 什么可能的解决方案可以确保地图没有闪烁的线条?

任何帮助或提示将不胜感激!请查看我的日志如下:

下面的屏幕截图显示一个出现白线的框架:

White line on map frame

使用 Xcode 的“Capture GPU Frame”功能,并选择“View Frame by Program”,然后在“Program Program Object #5”中出现白线。

Xcode Gpu trace

这是来自 gpu 跟踪的代码

//************************************************************************
// Edits to captured shaders are not saved to the source shader file.
// copy them back to your shader files when done or retrieve them from
// the GPU Debug Log.
//************************************************************************
precision highp float;
uniform mat4 uMVPMatrix;
uniform float uPixelSize;
uniform float uZoomInterpolation;
uniform float uCameraviewingAngle;
uniform float uCameraZoom;
uniform vec2 uCameraAxis;
uniform float uWidenConstantWidth;
uniform float uWidenIntensity;
attribute vec2 aOrigin;
attribute vec2 aVector;
attribute vec2 aDirection;
attribute mediump vec2 aTombstoneTexCoords;
attribute lowp vec4 aColorStart;
attribute lowp vec4 aColorEnd;
attribute mediump vec2 aWidthRange;
varying lowp vec4 vstrokeColor;
varying mediump vec2 vTombstoneTexCoords;
const float kFixedPointConversionFactor = 0.0000610351562;
const float kFixedPointVectorConversionFactor = 0.0001220703125;
const float kOneEighthsDPConversionFactor = 0.125;
const float kWidenLowViewAngle = 0.685;
const float kWidenHighViewAngle = 0.785;
const float kWidenLowZoomFade = 13.0;
const float kWidenHighZoomFade = 15.0;
const float kWidenLowDepth = 0.5;
const float kWidenHighDepth = 5.0;
const float kWidenLinearDepthWidth = 4.0;
const float kWidenSquaredDepthWidth = 5.333;
float additionalWidth(float z) {
 float depth = smoothstep(kWidenLowDepth,kWidenHighDepth,z);
 float width = (depth * kWidenLinearDepthWidth) + (depth * depth * kWidenSquaredDepthWidth);
 vec2 direction = aDirection * kFixedPointConversionFactor;
 float angleFactor = 1.0 - abs(dot(direction,uCameraAxis));
 width *= angleFactor;
 float viewingAngleFactor =
 smoothstep(kWidenLowViewAngle,kWidenHighViewAngle,uCameraviewingAngle);
 float zoomFactor = smoothstep(kWidenLowZoomFade,kWidenHighZoomFade,uCameraZoom);
 float factor = viewingAngleFactor * zoomFactor * uWidenIntensity;
 width *= factor;
 return width;
}
void main() {
 float strokeWidth = mix(aWidthRange.x,aWidthRange.y,uZoomInterpolation);
 strokeWidth *= kOneEighthsDPConversionFactor;
 vstrokeColor = mix(aColorStart,aColorEnd,min(uZoomInterpolation,1.0));
 vTombstoneTexCoords = aTombstoneTexCoords * kFixedPointConversionFactor;
 vec2 vector = aVector * kFixedPointVectorConversionFactor;
 vec2 extrusion = vector * (strokeWidth * uPixelSize);
 vec2 origin = aOrigin * kFixedPointConversionFactor;
 vec4 position = vec4(origin + extrusion,0.0,1.0);
 position = uMVPMatrix * position;
 strokeWidth += additionalWidth(position.z) + uWidenConstantWidth;
 extrusion = vector * (strokeWidth * uPixelSize);
 position = vec4(origin + extrusion,1.0);
 position = uMVPMatrix * position;
 gl_Position = position;
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...