Title: [183302] trunk/Source
Revision
183302
Author
[email protected]
Date
2015-04-24 18:03:03 -0700 (Fri, 24 Apr 2015)

Log Message

Have the web inspector report accurate memory use for layers with detached backing store
https://bugs.webkit.org/show_bug.cgi?id=144179

Reviewed by Dean Jackson.
Source/WebCore:

Only report memory use for layers whose backing store is attached.

* platform/graphics/ca/GraphicsLayerCA.cpp:
* platform/graphics/ca/PlatformCALayer.h: Add backingContributesToMemoryEstimate()
which platforms can override if they allow backing store detaching.

Source/WebKit2:

Remote layers can make their backing store volatile, so the backing only contributes
to reported memory use when attached.

* WebProcess/WebPage/mac/PlatformCALayerRemote.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (183301 => 183302)


--- trunk/Source/WebCore/ChangeLog	2015-04-25 01:02:59 UTC (rev 183301)
+++ trunk/Source/WebCore/ChangeLog	2015-04-25 01:03:03 UTC (rev 183302)
@@ -1,5 +1,18 @@
 2015-04-24  Simon Fraser  <[email protected]>
 
+        Have the web inspector report accurate memory use for layers with detached backing store
+        https://bugs.webkit.org/show_bug.cgi?id=144179
+
+        Reviewed by Dean Jackson.
+
+        Only report memory use for layers whose backing store is attached.
+
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        * platform/graphics/ca/PlatformCALayer.h: Add backingContributesToMemoryEstimate()
+        which platforms can override if they allow backing store detaching.
+
+2015-04-24  Simon Fraser  <[email protected]>
+
         Track a coverage rect through GraphicsLayerCA flushes, use it to mark backing store attached
         https://bugs.webkit.org/show_bug.cgi?id=144165
 

Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (183301 => 183302)


--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2015-04-25 01:02:59 UTC (rev 183301)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2015-04-25 01:03:03 UTC (rev 183302)
@@ -3677,6 +3677,9 @@
     if (TiledBacking* tiledBacking = this->tiledBacking())
         return tiledBacking->retainedTileBackingStoreMemory();
 
+    if (!m_layer->backingContributesToMemoryEstimate())
+        return 0;
+
     return 4.0 * size().width() * m_layer->contentsScale() * size().height() * m_layer->contentsScale();
 }
 

Modified: trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h (183301 => 183302)


--- trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h	2015-04-25 01:02:59 UTC (rev 183301)
+++ trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h	2015-04-25 01:03:03 UTC (rev 183302)
@@ -178,6 +178,7 @@
 
     virtual void setBackingStoreAttached(bool) = 0;
     virtual bool backingStoreAttached() const = 0;
+    virtual bool backingContributesToMemoryEstimate() const { return true; }
 
     virtual void setMinificationFilter(FilterType) = 0;
     virtual void setMagnificationFilter(FilterType) = 0;

Modified: trunk/Source/WebKit2/ChangeLog (183301 => 183302)


--- trunk/Source/WebKit2/ChangeLog	2015-04-25 01:02:59 UTC (rev 183301)
+++ trunk/Source/WebKit2/ChangeLog	2015-04-25 01:03:03 UTC (rev 183302)
@@ -1,3 +1,15 @@
+2015-04-24  Simon Fraser  <[email protected]>
+
+        Have the web inspector report accurate memory use for layers with detached backing store
+        https://bugs.webkit.org/show_bug.cgi?id=144179
+
+        Reviewed by Dean Jackson.
+        
+        Remote layers can make their backing store volatile, so the backing only contributes
+        to reported memory use when attached.
+
+        * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
+
 2015-04-24  Andreas Kling  <[email protected]>
 
         theverge.com burning 100% CPU on iPad (due to window.screenX/Y)

Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h (183301 => 183302)


--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h	2015-04-25 01:02:59 UTC (rev 183301)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h	2015-04-25 01:03:03 UTC (rev 183302)
@@ -96,6 +96,7 @@
 
     virtual void setBackingStoreAttached(bool) override;
     virtual bool backingStoreAttached() const override;
+    virtual bool backingContributesToMemoryEstimate() const override { return backingStoreAttached(); }
 
     virtual void setGeometryFlipped(bool) override;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to