summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/android/BaseTileTexture.cpp
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2011-09-27 10:17:32 -0700
committerChris Craik <ccraik@google.com>2011-09-29 16:06:42 -0700
commitf6a40880028cf495025747229c627f42e25acc66 (patch)
tree0bb9844b902cea7a2c70d4926972d51175727c1a /Source/WebCore/platform/graphics/android/BaseTileTexture.cpp
parentebcd36bcdbefb452a0be4e9e452a054ffdff4763 (diff)
downloadexternal_webkit-f6a40880028cf495025747229c627f42e25acc66.zip
external_webkit-f6a40880028cf495025747229c627f42e25acc66.tar.gz
external_webkit-f6a40880028cf495025747229c627f42e25acc66.tar.bz2
Use state machine to track tile state
bug:5369978 Manage invalidations, painting, transferring, and swapping with a state machine. notes: * readyFor shouldn't be needed if all of the events that would cause a readyfor fail mark the tile dirty (such as stealing, scale change) * changing the scale of a page should discard all textures * m_dirty should be more gracefully worked into the state machine * a tile may drop dirtiness notifications if it's already painting, since upon completion m_dirty will be cleared - (issues for layers only) Change-Id: I5909fb5d208da2fb276e223c56bf143741a9a24c
Diffstat (limited to 'Source/WebCore/platform/graphics/android/BaseTileTexture.cpp')
-rw-r--r--Source/WebCore/platform/graphics/android/BaseTileTexture.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/Source/WebCore/platform/graphics/android/BaseTileTexture.cpp b/Source/WebCore/platform/graphics/android/BaseTileTexture.cpp
index d60d695..54c96c8 100644
--- a/Source/WebCore/platform/graphics/android/BaseTileTexture.cpp
+++ b/Source/WebCore/platform/graphics/android/BaseTileTexture.cpp
@@ -32,11 +32,14 @@
#include "GLUtils.h"
#include "TilesManager.h"
-#ifdef DEBUG
-
#include <cutils/log.h>
#include <wtf/text/CString.h>
+#undef XLOGC
+#define XLOGC(...) android_printLog(ANDROID_LOG_DEBUG, "BaseTileTexture", __VA_ARGS__)
+
+#ifdef DEBUG
+
#undef XLOG
#define XLOG(...) android_printLog(ANDROID_LOG_DEBUG, "BaseTileTexture", __VA_ARGS__)
@@ -89,7 +92,12 @@ void BaseTileTexture::discardTexture()
{
if (m_ownTextureId)
GLUtils::deleteTexture(&m_ownTextureId);
- release(m_owner);
+
+ if (m_owner) {
+ // clear both Tile->Texture and Texture->Tile links
+ m_owner->removeTexture(this);
+ release(m_owner);
+ }
}
void BaseTileTexture::destroyTextures(SharedTexture** textures)
@@ -227,9 +235,6 @@ bool BaseTileTexture::release(TextureOwner* owner)
if (m_owner != owner)
return false;
- // force readyFor to return false next call (even if texture reaquired by same tile)
- m_ownTextureTileInfo.m_x = -1;
- m_ownTextureTileInfo.m_y = -1;
if (!m_busy) {
m_owner = 0;
} else {
@@ -271,6 +276,11 @@ void BaseTileTexture::setOwnTextureTileInfoFromQueue(const TextureTileInfo* info
m_ownTextureTileInfo.m_painter = info->m_painter;
m_ownTextureTileInfo.m_picture = info->m_picture;
m_ownTextureTileInfo.m_inverted = TilesManager::instance()->invertedScreen();
+ if (m_owner) {
+ BaseTile* owner = static_cast<BaseTile*>(m_owner);
+ owner->backTextureTransfer();
+ }
+
}
bool BaseTileTexture::readyFor(BaseTile* baseTile)