@@ -16,33 +16,6 @@ import net.mullvad.mullvadvpn.model.LatLong
16
16
17
17
internal class LocationMarker (val colors : LocationMarkerColors ) {
18
18
19
- private val vertexShaderCode =
20
- """
21
- attribute vec3 aVertexPosition;
22
- attribute vec4 aVertexColor;
23
-
24
- uniform mat4 uModelViewMatrix;
25
- uniform mat4 uProjectionMatrix;
26
-
27
- varying lowp vec4 vColor;
28
-
29
- void main(void) {
30
- gl_Position = uProjectionMatrix * uModelViewMatrix * vec4(aVertexPosition, 1.0);
31
- vColor = aVertexColor;
32
- }
33
- """
34
- .trimIndent()
35
-
36
- private val fragmentShaderCode =
37
- """
38
- varying lowp vec4 vColor;
39
-
40
- void main(void) {
41
- gl_FragColor = vColor;
42
- }
43
- """
44
- .trimIndent()
45
-
46
19
private val rings =
47
20
listOf (
48
21
circleFanVertices(
@@ -79,9 +52,9 @@ internal class LocationMarker(val colors: LocationMarkerColors) {
79
52
private val attribLocations: AttribLocations
80
53
private val uniformLocation: UniformLocation
81
54
82
- data class AttribLocations (val vertexPosition : Int , val vertexColor : Int )
55
+ private data class AttribLocations (val vertexPosition : Int , val vertexColor : Int )
83
56
84
- data class UniformLocation (val projectionMatrix : Int , val modelViewMatrix : Int )
57
+ private data class UniformLocation (val projectionMatrix : Int , val modelViewMatrix : Int )
85
58
86
59
private val positionBuffer: Int
87
60
private val colorBuffer: Int
@@ -213,6 +186,34 @@ internal class LocationMarker(val colors: LocationMarkerColors) {
213
186
214
187
companion object {
215
188
private const val MARKER_TRANSLATE_Z_FACTOR = 1.0001f
189
+
190
+ // Vertex, and fragment shader code is taken from Mullvad Desktop 3dmap.ts
191
+ private val vertexShaderCode =
192
+ """
193
+ attribute vec3 aVertexPosition;
194
+ attribute vec4 aVertexColor;
195
+
196
+ uniform mat4 uModelViewMatrix;
197
+ uniform mat4 uProjectionMatrix;
198
+
199
+ varying lowp vec4 vColor;
200
+
201
+ void main(void) {
202
+ gl_Position = uProjectionMatrix * uModelViewMatrix * vec4(aVertexPosition, 1.0);
203
+ vColor = aVertexColor;
204
+ }
205
+ """
206
+ .trimIndent()
207
+
208
+ private val fragmentShaderCode =
209
+ """
210
+ varying lowp vec4 vColor;
211
+
212
+ void main(void) {
213
+ gl_FragColor = vColor;
214
+ }
215
+ """
216
+ .trimIndent()
216
217
}
217
218
}
218
219
0 commit comments