Title: [130573] trunk/Source/WebCore
- Revision
- 130573
- Author
- [email protected]
- Date
- 2012-10-05 18:28:05 -0700 (Fri, 05 Oct 2012)
Log Message
[mac] REGRESSION (r122215): Animated GIF outside the viewport doesn't play when scrolled into view.
https://bugs.webkit.org/show_bug.cgi?id=94874
Patch by Huang Dongsung <[email protected]> on 2012-10-05
Reviewed by Simon Fraser.
Rollback previous patch because this patch caused two problems.
1. GIF animation is occasionally paused when tiled scrolling is enabled.
2. This change regressed Apple's Membuster benchmark by ~20% (80MB.)
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::shouldPauseAnimation):
* loader/cache/CachedImage.h:
(CachedImage):
* loader/cache/CachedResource.h:
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::pruneLiveResourcesToSize):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::willRenderImage):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (130572 => 130573)
--- trunk/Source/WebCore/ChangeLog 2012-10-06 01:23:58 UTC (rev 130572)
+++ trunk/Source/WebCore/ChangeLog 2012-10-06 01:28:05 UTC (rev 130573)
@@ -1,3 +1,24 @@
+2012-10-05 Huang Dongsung <[email protected]>
+
+ [mac] REGRESSION (r122215): Animated GIF outside the viewport doesn't play when scrolled into view.
+ https://bugs.webkit.org/show_bug.cgi?id=94874
+
+ Reviewed by Simon Fraser.
+
+ Rollback previous patch because this patch caused two problems.
+ 1. GIF animation is occasionally paused when tiled scrolling is enabled.
+ 2. This change regressed Apple's Membuster benchmark by ~20% (80MB.)
+
+ * loader/cache/CachedImage.cpp:
+ (WebCore::CachedImage::shouldPauseAnimation):
+ * loader/cache/CachedImage.h:
+ (CachedImage):
+ * loader/cache/CachedResource.h:
+ * loader/cache/MemoryCache.cpp:
+ (WebCore::MemoryCache::pruneLiveResourcesToSize):
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::willRenderImage):
+
2012-10-05 Xianzhu Wang <[email protected]>
OpenTypeVerticalData issue with DroidSansFallback.ttf on chromium-android and chromium-linux
Modified: trunk/Source/WebCore/loader/cache/CachedImage.cpp (130572 => 130573)
--- trunk/Source/WebCore/loader/cache/CachedImage.cpp 2012-10-06 01:23:58 UTC (rev 130572)
+++ trunk/Source/WebCore/loader/cache/CachedImage.cpp 2012-10-06 01:28:05 UTC (rev 130573)
@@ -422,17 +422,6 @@
setDecodedSize(decodedSize() + delta);
}
-bool CachedImage::likelyToBeUsedSoon()
-{
- CachedResourceClientWalker<CachedImageClient> walker(m_clients);
- while (CachedImageClient* client = walker.next()) {
- if (client->willRenderImage(this))
- return true;
- }
-
- return false;
-}
-
void CachedImage::didDraw(const Image* image)
{
if (!image || image != m_image)
@@ -450,7 +439,13 @@
if (!image || image != m_image)
return false;
- return !likelyToBeUsedSoon();
+ CachedResourceClientWalker<CachedImageClient> w(m_clients);
+ while (CachedImageClient* c = w.next()) {
+ if (c->willRenderImage(this))
+ return false;
+ }
+
+ return true;
}
void CachedImage::animationAdvanced(const Image* image)
Modified: trunk/Source/WebCore/loader/cache/CachedImage.h (130572 => 130573)
--- trunk/Source/WebCore/loader/cache/CachedImage.h 2012-10-06 01:23:58 UTC (rev 130572)
+++ trunk/Source/WebCore/loader/cache/CachedImage.h 2012-10-06 01:28:05 UTC (rev 130573)
@@ -72,8 +72,6 @@
virtual void allClientsRemoved();
virtual void destroyDecodedData();
- virtual bool likelyToBeUsedSoon();
-
virtual void data(PassRefPtr<SharedBuffer> data, bool allDataReceived);
virtual void error(CachedResource::Status);
virtual void setResponse(const ResourceResponse&);
Modified: trunk/Source/WebCore/loader/cache/CachedResource.h (130572 => 130573)
--- trunk/Source/WebCore/loader/cache/CachedResource.h 2012-10-06 01:23:58 UTC (rev 130572)
+++ trunk/Source/WebCore/loader/cache/CachedResource.h 2012-10-06 01:28:05 UTC (rev 130573)
@@ -215,9 +215,6 @@
void setOwningCachedResourceLoader(CachedResourceLoader* cachedResourceLoader) { m_owningCachedResourceLoader = cachedResourceLoader; }
- // MemoryCache does not destroy the decoded data of a CachedResource if the decoded data will be likely used.
- virtual bool likelyToBeUsedSoon() { return false; }
-
bool isPreloaded() const { return m_preloadCount; }
void increasePreloadCount() { ++m_preloadCount; }
void decreasePreloadCount() { ASSERT(m_preloadCount); --m_preloadCount; }
Modified: trunk/Source/WebCore/loader/cache/MemoryCache.cpp (130572 => 130573)
--- trunk/Source/WebCore/loader/cache/MemoryCache.cpp 2012-10-06 01:23:58 UTC (rev 130572)
+++ trunk/Source/WebCore/loader/cache/MemoryCache.cpp 2012-10-06 01:28:05 UTC (rev 130573)
@@ -238,12 +238,6 @@
if (elapsedTime < cMinDelayBeforeLiveDecodedPrune)
return;
- // Check to see if the current resource are likely to be used again soon.
- if (current->likelyToBeUsedSoon()) {
- current = prev;
- continue;
- }
-
// Destroy our decoded data. This will remove us from
// m_liveDecodedResources, and possibly move us to a different LRU
// list in m_allResources.
Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (130572 => 130573)
--- trunk/Source/WebCore/rendering/RenderObject.cpp 2012-10-06 01:23:58 UTC (rev 130572)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp 2012-10-06 01:28:05 UTC (rev 130573)
@@ -2806,16 +2806,7 @@
// If we're not in a window (i.e., we're dormant from being put in the b/f cache or in a background tab)
// then we don't want to render either.
- if (document()->inPageCache() || document()->view()->isOffscreen())
- return false;
-
- // If the document is being destroyed or has not been attached, then this
- // RenderObject will not be rendered.
- if (!view())
- return false;
-
- // If a renderer is outside the viewport, we won't render.
- return viewRect().intersects(absoluteClippedOverflowRect());
+ return !document()->inPageCache() && !document()->view()->isOffscreen();
}
int RenderObject::maximalOutlineSize(PaintPhase p) const
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes