Skip to content

Instantly share code, notes, and snippets.

@kenchris
Created March 5, 2012 13:33
Show Gist options
  • Save kenchris/1978321 to your computer and use it in GitHub Desktop.
Save kenchris/1978321 to your computer and use it in GitHub Desktop.
commit 5cc50146fb2fa6a772b32ce4148ba16badfff6d3
Author: Kenneth Rohde Christiansen <kenneth@webkit.org>
Date: Mon Mar 5 14:17:36 2012 +0100
Make it more clean when we are disallowing updates to either the actual
backing store (recreating the tiled region) or to the tile buffers, as
this has caused confusions in the past.
diff --git a/Source/WebCore/platform/graphics/TiledBackingStore.cpp b/Source/WebCore/platform/graphics/TiledBackingStore.cpp
index 6922f91..44faa6d 100644
--- a/Source/WebCore/platform/graphics/TiledBackingStore.cpp
+++ b/Source/WebCore/platform/graphics/TiledBackingStore.cpp
@@ -99,9 +99,20 @@ void TiledBackingStore::invalidate(const IntRect& contentsDirtyRect)
startTileBufferUpdateTimer();
}
+bool TiledBackingStore::isBackingStoreUpdatesSuspended()
+{
+ return m_contentsFrozen;
+}
+
+bool TiledBackingStore::isTileBufferUpdatesSuspended()
+{
+ return m_contentsFrozen || !m_client->tiledBackingStoreUpdatesAllowed();
+}
+
void TiledBackingStore::updateTileBuffers()
{
- if (!m_client->tiledBackingStoreUpdatesAllowed() || m_contentsFrozen)
+ // Guard here as as these can change before the timer fires.
+ if (isTileBufferUpdatesSuspended())
return;
m_client->tiledBackingStorePaintBegin();
@@ -230,7 +241,9 @@ bool TiledBackingStore::visibleAreaIsCovered() const
void TiledBackingStore::createTiles()
{
- ASSERT(!m_contentsFrozen);
+ // Guard here as as these can change before the timer fires.
+ if (isBackingStoreUpdatesSuspended())
+ return;
// Update our backing store geometry.
const IntRect previousRect = m_rect;
@@ -472,7 +485,7 @@ Tile::Coordinate TiledBackingStore::tileCoordinateForPoint(const IntPoint& point
void TiledBackingStore::startTileBufferUpdateTimer()
{
- if (m_tileBufferUpdateTimer->isActive() || !m_client->tiledBackingStoreUpdatesAllowed() || m_contentsFrozen)
+ if (m_tileBufferUpdateTimer->isActive() || isTileBufferUpdatesSuspended())
return;
m_tileBufferUpdateTimer->startOneShot(0);
}
@@ -484,7 +497,7 @@ void TiledBackingStore::tileBufferUpdateTimerFired(TileTimer*)
void TiledBackingStore::startTileCreationTimer()
{
- if (m_tileCreationTimer->isActive() || m_contentsFrozen)
+ if (m_backingStoreUpdateTimer->isActive() || isBackingStoreUpdatesSuspended())
return;
m_tileCreationTimer->startOneShot(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment