aboutsummaryrefslogtreecommitdiff
path: root/backends/platform
diff options
context:
space:
mode:
Diffstat (limited to 'backends/platform')
-rw-r--r--backends/platform/android/texture.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/backends/platform/android/texture.cpp b/backends/platform/android/texture.cpp
index a20222ec64..c309bd51b4 100644
--- a/backends/platform/android/texture.cpp
+++ b/backends/platform/android/texture.cpp
@@ -218,8 +218,14 @@ GLESTexture::~GLESTexture() {
}
void GLESTexture::allocBuffer(GLuint w, GLuint h) {
+ GLuint oldw = _surface.w;
+ GLuint oldh = _surface.h;
+
GLESBaseTexture::allocBuffer(w, h);
+ if (_surface.w == oldw && _surface.h == oldh)
+ return;
+
delete[] _buf;
delete[] _pixels;
@@ -341,9 +347,13 @@ GLESPaletteTexture::~GLESPaletteTexture() {
}
void GLESPaletteTexture::allocBuffer(GLuint w, GLuint h) {
+ GLuint oldw = _surface.w;
+ GLuint oldh = _surface.h;
+
GLESBaseTexture::allocBuffer(w, h);
- // Texture gets uploaded later (from drawTexture())
+ if (_surface.w == oldw && _surface.h == oldh)
+ return;
byte *new_buffer = new byte[_paletteSize +
_texture_width * _texture_height];
@@ -457,8 +467,14 @@ GLESFakePaletteTexture::~GLESFakePaletteTexture() {
}
void GLESFakePaletteTexture::allocBuffer(GLuint w, GLuint h) {
+ GLuint oldw = _surface.w;
+ GLuint oldh = _surface.h;
+
GLESBaseTexture::allocBuffer(w, h);
+ if (_surface.w == oldw && _surface.h == oldh)
+ return;
+
delete[] _buf;
delete[] _pixels;