Title: [92782] trunk/Source/WebCore
Revision
92782
Author
[email protected]
Date
2011-08-10 12:13:07 -0700 (Wed, 10 Aug 2011)

Log Message

[chromium] Notify MemoryCache of decoded data access
https://bugs.webkit.org/show_bug.cgi?id=65859

Reviewed by James Robinson.

This causes us to call CachedImage::didDraw() which calls CachedResource::didAccessDecodedData()
which updates the LRU for decoded image data and potentially prunes the cache. This is already done
by almost all of the other ports.

The decoded bitmaps obviously use quite a bit of memory, so pruning them when necessary is important.
In my tests, this saves several MB on many popular web pages.

No new tests because no observable difference in functionality.

* platform/graphics/skia/ImageSkia.cpp:
(WebCore::BitmapImage::draw):
(WebCore::BitmapImageSingleFrameSkia::draw):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (92781 => 92782)


--- trunk/Source/WebCore/ChangeLog	2011-08-10 18:45:25 UTC (rev 92781)
+++ trunk/Source/WebCore/ChangeLog	2011-08-10 19:13:07 UTC (rev 92782)
@@ -1,3 +1,23 @@
+2011-08-10  Tony Gentilcore  <[email protected]>
+
+        [chromium] Notify MemoryCache of decoded data access
+        https://bugs.webkit.org/show_bug.cgi?id=65859
+
+        Reviewed by James Robinson.
+
+        This causes us to call CachedImage::didDraw() which calls CachedResource::didAccessDecodedData()
+        which updates the LRU for decoded image data and potentially prunes the cache. This is already done
+        by almost all of the other ports.
+
+        The decoded bitmaps obviously use quite a bit of memory, so pruning them when necessary is important.
+        In my tests, this saves several MB on many popular web pages.
+
+        No new tests because no observable difference in functionality.
+
+        * platform/graphics/skia/ImageSkia.cpp:
+        (WebCore::BitmapImage::draw):
+        (WebCore::BitmapImageSingleFrameSkia::draw):
+
 2011-08-10  Vsevolod Vlasov  <[email protected]>
 
         Web Inspector: Remove Network.initialContentSet from protocol, store workers content on backend.

Modified: trunk/Source/WebCore/platform/graphics/skia/ImageSkia.cpp (92781 => 92782)


--- trunk/Source/WebCore/platform/graphics/skia/ImageSkia.cpp	2011-08-10 18:45:25 UTC (rev 92781)
+++ trunk/Source/WebCore/platform/graphics/skia/ImageSkia.cpp	2011-08-10 19:13:07 UTC (rev 92782)
@@ -36,6 +36,7 @@
 #include "FloatConversion.h"
 #include "FloatRect.h"
 #include "GraphicsContext.h"
+#include "ImageObserver.h"
 #include "Logging.h"
 #include "NativeImageSkia.h"
 #include "PlatformContextSkia.h"
@@ -489,6 +490,9 @@
                   enclosingIntRect(normSrcRect),
                   normDstRect,
                   WebCoreCompositeToSkiaComposite(compositeOp));
+
+    if (ImageObserver* observer = imageObserver())
+        observer->didDraw(this);
 }
 
 // FIXME: These should go into BitmapImageSingleFrameSkia.cpp
@@ -512,6 +516,9 @@
                   enclosingIntRect(normSrcRect),
                   normDstRect,
                   WebCoreCompositeToSkiaComposite(compositeOp));
+
+    if (ImageObserver* observer = imageObserver())
+        observer->didDraw(this);
 }
 
 BitmapImageSingleFrameSkia::BitmapImageSingleFrameSkia(const SkBitmap& bitmap)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to