OSDN Git Service

Discard BaseTileTextures entirely when they delete their GL textures
authorChris Craik <ccraik@google.com>
Thu, 22 Sep 2011 23:25:22 +0000 (16:25 -0700)
committerChris Craik <ccraik@google.com>
Thu, 22 Sep 2011 23:25:22 +0000 (16:25 -0700)
bug:5361337
Fixes issue with garbage being drawn in unpainted tiles, and also allocates
tiles very lazily.

Change-Id: I9799b63670a80748a4809b61506da96a739d3a65

Source/WebCore/platform/graphics/android/BaseTileTexture.cpp

index f049b6f..d60d695 100644 (file)
@@ -89,6 +89,7 @@ void BaseTileTexture::discardTexture()
 {
     if (m_ownTextureId)
         GLUtils::deleteTexture(&m_ownTextureId);
+    release(m_owner);
 }
 
 void BaseTileTexture::destroyTextures(SharedTexture** textures)
@@ -274,13 +275,6 @@ void BaseTileTexture::setOwnTextureTileInfoFromQueue(const TextureTileInfo* info
 
 bool BaseTileTexture::readyFor(BaseTile* baseTile)
 {
-    if (!m_ownTextureId) {
-        // If our backing opengl texture doesn't exist, allocate it and return
-        // false since it won't have useful data
-        requireTexture();
-        return false;
-    }
-
     const TextureTileInfo* info = &m_ownTextureTileInfo;
     if (info &&
         (info->m_x == baseTile->x()) &&