samsung/adreno quirk: dont use glBufferSubData()

This commit is contained in:
Hannes Janetzek
2014-05-16 12:03:46 +02:00
parent 607b6d6266
commit 9c1ae887ea
3 changed files with 8 additions and 4 deletions

View File

@@ -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);

View File

@@ -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();

View File

@@ -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<BufferObject> {
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;