samsung/adreno quirk: dont use glBufferSubData()
This commit is contained in:
@@ -63,7 +63,7 @@ public class MapView extends RelativeLayout {
|
|||||||
* samsung S4 and Note3 models */
|
* samsung S4 and Note3 models */
|
||||||
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT
|
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT
|
||||||
&& "samsung".equals(Build.MANUFACTURER))
|
&& "samsung".equals(Build.MANUFACTURER))
|
||||||
GLAdapter.VBO_TEXTURE_LAYERS = false;
|
GLAdapter.NO_BUFFER_SUB_DATA = true;
|
||||||
|
|
||||||
DisplayMetrics metrics = getResources().getDisplayMetrics();
|
DisplayMetrics metrics = getResources().getDisplayMetrics();
|
||||||
CanvasAdapter.dpi = (int) Math.max(metrics.xdpi, metrics.ydpi);
|
CanvasAdapter.dpi = (int) Math.max(metrics.xdpi, metrics.ydpi);
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ public class GLAdapter {
|
|||||||
*/
|
*/
|
||||||
public static boolean VBO_TEXTURE_LAYERS = true;
|
public static boolean VBO_TEXTURE_LAYERS = true;
|
||||||
|
|
||||||
|
public static boolean NO_BUFFER_SUB_DATA = false;
|
||||||
|
|
||||||
public static GL20 get() {
|
public static GL20 get() {
|
||||||
if (g == null)
|
if (g == null)
|
||||||
throw new IllegalStateException();
|
throw new IllegalStateException();
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import java.nio.Buffer;
|
|||||||
import javax.annotation.CheckReturnValue;
|
import javax.annotation.CheckReturnValue;
|
||||||
|
|
||||||
import org.oscim.backend.GL20;
|
import org.oscim.backend.GL20;
|
||||||
|
import org.oscim.backend.GLAdapter;
|
||||||
import org.oscim.utils.pool.Inlist;
|
import org.oscim.utils.pool.Inlist;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -57,9 +58,10 @@ public final class BufferObject extends Inlist<BufferObject> {
|
|||||||
|
|
||||||
GL.glBindBuffer(target, id);
|
GL.glBindBuffer(target, id);
|
||||||
|
|
||||||
// reuse memory allocated for vbo when possible and allocated
|
/* reuse memory allocated for vbo when possible and allocated
|
||||||
// memory is less then four times the new data
|
* memory is less then four times the new data */
|
||||||
if (!clear && (size > newSize) && (size < newSize * 4)) {
|
if (!GLAdapter.NO_BUFFER_SUB_DATA && !clear &&
|
||||||
|
(size > newSize) && (size < newSize * 4)) {
|
||||||
GL.glBufferSubData(target, 0, newSize, buf);
|
GL.glBufferSubData(target, 0, newSize, buf);
|
||||||
} else {
|
} else {
|
||||||
mBufferMemoryUsage += newSize - size;
|
mBufferMemoryUsage += newSize - size;
|
||||||
|
|||||||
Reference in New Issue
Block a user