[TexMap] TextureMapperTiledBackingStore should notify the ImageObserver of the data...
authorzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Dec 2015 14:03:34 +0000 (14:03 +0000)
committerzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Dec 2015 14:03:34 +0000 (14:03 +0000)
https://bugs.webkit.org/show_bug.cgi?id=152053

Reviewed by Martin Robinson.

TextureMapperTiledBackingStore should call ImageObserver::didDraw() on the Image's
observer after updating the tile with the Image's data. This way the CachedImage
(i.e. the observer) can mark the data access with the current timestamp, avoiding
removing the decoded data in the very near future during a cache purge.

* platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:
(WebCore::TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@193828 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.cpp

index 47b8102..247f28e 100644 (file)
@@ -1,5 +1,20 @@
 2015-12-09  Zan Dobersek  <zdobersek@igalia.com>
 
+        [TexMap] TextureMapperTiledBackingStore should notify the ImageObserver of the data access
+        https://bugs.webkit.org/show_bug.cgi?id=152053
+
+        Reviewed by Martin Robinson.
+
+        TextureMapperTiledBackingStore should call ImageObserver::didDraw() on the Image's
+        observer after updating the tile with the Image's data. This way the CachedImage
+        (i.e. the observer) can mark the data access with the current timestamp, avoiding
+        removing the decoded data in the very near future during a cache purge.
+
+        * platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:
+        (WebCore::TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded):
+
+2015-12-09  Zan Dobersek  <zdobersek@igalia.com>
+
         Make MainThreadSharedTimerGtk implementation GLib-specific
         https://bugs.webkit.org/show_bug.cgi?id=152044
 
index c2985b3..34e1ee5 100644 (file)
@@ -23,6 +23,7 @@
 #include "TextureMapperTiledBackingStore.h"
 
 #include "ImageBuffer.h"
+#include "ImageObserver.h"
 #include "TextureMapper.h"
 
 namespace WebCore {
@@ -35,6 +36,9 @@ void TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded(TextureMapp
         return;
 
     updateContents(textureMapper, m_image.get(), m_image->size(), enclosingIntRect(m_image->rect()), BitmapTexture::UpdateCannotModifyOriginalImageData);
+
+    if (m_image->imageObserver())
+        m_image->imageObserver()->didDraw(m_image.get());
     m_image = nullptr;
 }