summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics
diff options
context:
space:
mode:
authorNicolas Roard <nicolas@android.com>2011-02-01 12:38:10 -0800
committerNicolas Roard <nicolas@android.com>2011-02-01 12:38:10 -0800
commit4596782e9c024bb84cdcbf004330d88a401dbce0 (patch)
treea22017f68c941fc6cdda5459e17e9f3adc43f9cf /WebCore/platform/graphics
parentc6280ca9a4e12f9847852c063d5048a3d3d29422 (diff)
downloadexternal_webkit-4596782e9c024bb84cdcbf004330d88a401dbce0.zip
external_webkit-4596782e9c024bb84cdcbf004330d88a401dbce0.tar.gz
external_webkit-4596782e9c024bb84cdcbf004330d88a401dbce0.tar.bz2
Initialize correctly the maximum texture size in
case it was not. fix regression bug:3412928 Change-Id: Ie83dd50163ef4435cd88471127869114e41068cc
Diffstat (limited to 'WebCore/platform/graphics')
-rw-r--r--WebCore/platform/graphics/android/ShaderProgram.cpp4
-rw-r--r--WebCore/platform/graphics/android/TilesManager.cpp8
-rw-r--r--WebCore/platform/graphics/android/TilesManager.h1
3 files changed, 13 insertions, 0 deletions
diff --git a/WebCore/platform/graphics/android/ShaderProgram.cpp b/WebCore/platform/graphics/android/ShaderProgram.cpp
index 8da6855..bb12c3c 100644
--- a/WebCore/platform/graphics/android/ShaderProgram.cpp
+++ b/WebCore/platform/graphics/android/ShaderProgram.cpp
@@ -29,6 +29,7 @@
#if USE(ACCELERATED_COMPOSITING)
#include "GLUtils.h"
+#include "TilesManager.h"
#include <GLES2/gl2.h>
#include <cutils/log.h>
@@ -175,6 +176,9 @@ void ShaderProgram::init()
glGenBuffers(1, m_textureBuffer);
glBindBuffer(GL_ARRAY_BUFFER, m_textureBuffer[0]);
glBufferData(GL_ARRAY_BUFFER, 2 * 4 * sizeof(GLfloat), coord, GL_STATIC_DRAW);
+
+ if (m_program != -1)
+ TilesManager::instance()->checkMaxTextureSize();
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/WebCore/platform/graphics/android/TilesManager.cpp b/WebCore/platform/graphics/android/TilesManager.cpp
index d64a0b1..5f15fd6 100644
--- a/WebCore/platform/graphics/android/TilesManager.cpp
+++ b/WebCore/platform/graphics/android/TilesManager.cpp
@@ -72,6 +72,7 @@ namespace WebCore {
TilesManager::TilesManager()
: m_layersMemoryUsage(0)
+ , m_maxTextureSize(0)
, m_maxTextureCount(0)
, m_expandedTileBounds(false)
, m_generatorReady(false)
@@ -84,7 +85,13 @@ TilesManager::TilesManager()
m_tilesBitmap->eraseColor(0);
m_pixmapsGenerationThread = new TexturesGenerator();
m_pixmapsGenerationThread->run("TexturesGenerator");
+ checkMaxTextureSize();
+}
+void TilesManager::checkMaxTextureSize()
+{
+ if (m_maxTextureSize > 0)
+ return;
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &m_maxTextureSize);
m_totalMaxTextureSize = m_maxTextureSize * m_maxTextureSize * BYTES_PER_PIXEL;
XLOG("Max texture size %d", m_maxTextureSize);
@@ -106,6 +113,7 @@ void TilesManager::allocateTiles()
m_textures.append(loadedTexture);
nbTexturesAllocated++;
}
+ checkMaxTextureSize();
XLOG("allocated %d textures", nbTexturesAllocated);
}
diff --git a/WebCore/platform/graphics/android/TilesManager.h b/WebCore/platform/graphics/android/TilesManager.h
index 113cc62..ed32eeb 100644
--- a/WebCore/platform/graphics/android/TilesManager.h
+++ b/WebCore/platform/graphics/android/TilesManager.h
@@ -96,6 +96,7 @@ public:
int expandedTileBoundsY();
void allocateTiles();
+ void checkMaxTextureSize();
void setExpandedTileBounds(bool enabled) {
m_expandedTileBounds = enabled;