Title: [153372] trunk/Source/WebCore
- Revision
- 153372
- Author
- [email protected]
- Date
- 2013-07-26 08:19:57 -0700 (Fri, 26 Jul 2013)
Log Message
[BlackBerry] LayerTiler fails to render layer after waking up
https://bugs.webkit.org/show_bug.cgi?id=119146
Reviewed by George Staikos.
When the application is backgrounded, all tiles are freed up to
release memory back to the system. We also mark the contents as dirty
in LayerTiler::deleteTextures() so tiles will be repopulated when
waking up again.
The problem was caused by an optimization to avoid re-rendering tiles
repeatedly until the UI thread catches up with the fact that we have
indeed rendered those tiles (which will happen when the UI thread next
composites a frame).
When contents are dirty, we're not supposed to perform this
optimization (i.e. we're not supposed to skip rendering) because the
appearance of the layer has changed, so we do need to render those
tiles. Unfortunately, the code that was supposed to forget the list of
tiles rendered was in a conditional, "if (frontVisibility)", which
happened to be false sometimes when the app woke up again. So we ended
up perpetually skipping those render jobs, and the UI thread kept
yelling at us to render them.
Fixed by unconditionally dropping the list of tiles rendered when
contents are dirty.
This can't be detected without pixel tests, which BB DRT currently
doesn't support.
JIRA 452460
* platform/graphics/blackberry/LayerTiler.cpp:
(WebCore::LayerVisibility::clearTilesRendered):
(WebCore::LayerTiler::updateTextureContentsIfNeeded):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (153371 => 153372)
--- trunk/Source/WebCore/ChangeLog 2013-07-26 14:41:55 UTC (rev 153371)
+++ trunk/Source/WebCore/ChangeLog 2013-07-26 15:19:57 UTC (rev 153372)
@@ -1,3 +1,41 @@
+2013-07-26 Arvid Nilsson <[email protected]>
+
+ [BlackBerry] LayerTiler fails to render layer after waking up
+ https://bugs.webkit.org/show_bug.cgi?id=119146
+
+ Reviewed by George Staikos.
+
+ When the application is backgrounded, all tiles are freed up to
+ release memory back to the system. We also mark the contents as dirty
+ in LayerTiler::deleteTextures() so tiles will be repopulated when
+ waking up again.
+
+ The problem was caused by an optimization to avoid re-rendering tiles
+ repeatedly until the UI thread catches up with the fact that we have
+ indeed rendered those tiles (which will happen when the UI thread next
+ composites a frame).
+
+ When contents are dirty, we're not supposed to perform this
+ optimization (i.e. we're not supposed to skip rendering) because the
+ appearance of the layer has changed, so we do need to render those
+ tiles. Unfortunately, the code that was supposed to forget the list of
+ tiles rendered was in a conditional, "if (frontVisibility)", which
+ happened to be false sometimes when the app woke up again. So we ended
+ up perpetually skipping those render jobs, and the UI thread kept
+ yelling at us to render them.
+
+ Fixed by unconditionally dropping the list of tiles rendered when
+ contents are dirty.
+
+ This can't be detected without pixel tests, which BB DRT currently
+ doesn't support.
+
+ JIRA 452460
+
+ * platform/graphics/blackberry/LayerTiler.cpp:
+ (WebCore::LayerVisibility::clearTilesRendered):
+ (WebCore::LayerTiler::updateTextureContentsIfNeeded):
+
2013-07-25 Ryosuke Niwa <[email protected]>
Remove unused HTMLTextFormControlElement::textRendererAfterUpdateLayout
Modified: trunk/Source/WebCore/platform/graphics/blackberry/LayerTiler.cpp (153371 => 153372)
--- trunk/Source/WebCore/platform/graphics/blackberry/LayerTiler.cpp 2013-07-26 14:41:55 UTC (rev 153371)
+++ trunk/Source/WebCore/platform/graphics/blackberry/LayerTiler.cpp 2013-07-26 15:19:57 UTC (rev 153372)
@@ -62,6 +62,7 @@
bool tileNeedsRender(const TileIndex& index) const { return m_tilesNeedingRender.contains(index); }
void markTileAsRendered(const TileIndex& index) { m_tilesNeedingRender.remove(index); m_tilesRendered.add(index); }
void swapTilesNeedingRender(HashSet<TileIndex>& tilesNeedingRender) { m_tilesNeedingRender.swap(tilesNeedingRender); }
+ void clearTilesRendered() { m_tilesRendered.clear(); }
void merge(LayerVisibility* visibility)
{
@@ -152,17 +153,19 @@
{
updateTileSize();
- LayerVisibility* frontVisibility = takeFrontVisibility();
- if (frontVisibility) {
- // If we're dirty, start fresh. Otherwise, keep track of tiles rendered so far, to avoid re-rendering the same content.
- if (!m_contentsDirty)
- frontVisibility->merge(m_backVisibility);
+ // If we're dirty, start fresh. Otherwise, we keep track of tiles rendered so far by merging
+ // them into the new visibility object further down, to avoid re-rendering the same content.
+ if (m_contentsDirty && m_backVisibility)
+ m_backVisibility->clearTilesRendered();
+
+ // Swap in the new visibility object and merge old visibility object into it.
+ if (LayerVisibility* frontVisibility = takeFrontVisibility()) {
+ frontVisibility->merge(m_backVisibility);
delete m_backVisibility;
m_backVisibility = frontVisibility;
}
+
bool needsRender = m_backVisibility && m_backVisibility->needsRender();
-
- // Check if update is needed
if (!m_contentsDirty && !needsRender)
return;
@@ -171,8 +174,7 @@
printf("Layer 0x%p local visible rect %s\n", m_layer, BlackBerry::Platform::FloatRect(m_backVisibility->visibleRect()).toString().c_str());
#endif
- // There's no point in drawing contents at a higher resolution for scale
- // invariant layers.
+ // There's no point in drawing contents at a higher resolution for scale invariant layers.
if (m_layer->sizeIsScaleInvariant())
scale = 1;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes