diff --git a/vtm-android/src/org/oscim/android/MapView.java b/vtm-android/src/org/oscim/android/MapView.java index f5d04765..9b1402cf 100644 --- a/vtm-android/src/org/oscim/android/MapView.java +++ b/vtm-android/src/org/oscim/android/MapView.java @@ -63,7 +63,7 @@ public class MapView extends RelativeLayout { * samsung S4 and Note3 models */ if (Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT && "samsung".equals(Build.MANUFACTURER)) - GLAdapter.VBO_TEXTURE_LAYERS = false; + GLAdapter.NO_BUFFER_SUB_DATA = true; DisplayMetrics metrics = getResources().getDisplayMetrics(); CanvasAdapter.dpi = (int) Math.max(metrics.xdpi, metrics.ydpi); diff --git a/vtm/src/org/oscim/backend/GLAdapter.java b/vtm/src/org/oscim/backend/GLAdapter.java index e9ddbfe1..63654286 100644 --- a/vtm/src/org/oscim/backend/GLAdapter.java +++ b/vtm/src/org/oscim/backend/GLAdapter.java @@ -33,6 +33,8 @@ public class GLAdapter { */ public static boolean VBO_TEXTURE_LAYERS = true; + public static boolean NO_BUFFER_SUB_DATA = false; + public static GL20 get() { if (g == null) throw new IllegalStateException(); diff --git a/vtm/src/org/oscim/renderer/BufferObject.java b/vtm/src/org/oscim/renderer/BufferObject.java index 9ca9d159..e84d7201 100644 --- a/vtm/src/org/oscim/renderer/BufferObject.java +++ b/vtm/src/org/oscim/renderer/BufferObject.java @@ -22,6 +22,7 @@ import java.nio.Buffer; import javax.annotation.CheckReturnValue; import org.oscim.backend.GL20; +import org.oscim.backend.GLAdapter; import org.oscim.utils.pool.Inlist; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -57,9 +58,10 @@ public final class BufferObject extends Inlist { GL.glBindBuffer(target, id); - // reuse memory allocated for vbo when possible and allocated - // memory is less then four times the new data - if (!clear && (size > newSize) && (size < newSize * 4)) { + /* reuse memory allocated for vbo when possible and allocated + * memory is less then four times the new data */ + if (!GLAdapter.NO_BUFFER_SUB_DATA && !clear && + (size > newSize) && (size < newSize * 4)) { GL.glBufferSubData(target, 0, newSize, buf); } else { mBufferMemoryUsage += newSize - size;