Title: [122260] branches/chromium/1180/Source/WebCore/platform/graphics/chromium/cc
Revision
122260
Author
[email protected]
Date
2012-07-10 13:57:32 -0700 (Tue, 10 Jul 2012)

Log Message

Merge 121450 - [chromium] Should schedule a commit when dropping contents textures
https://bugs.webkit.org/show_bug.cgi?id=90031

Patch by James Robinson <[email protected]> on 2012-06-28
Reviewed by Adrienne Walker.

Source/WebCore:

If we're dropping contents textures on the impl thread, we need to schedule a commit to pick up new contents at
the next commit opportunity. Also adds some traces to make debugging issues like this easier.

* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::commitComplete):
(WebCore::CCLayerTreeHostImpl::canDraw):
(WebCore::CCLayerTreeHostImpl::releaseContentsTextures):
* platform/graphics/chromium/cc/CCScheduler.cpp:
(WebCore::CCScheduler::processScheduledActions):

Source/WebKit/chromium:

Adds a somewhat vacuous test unit test for committing when releasing textures.

* tests/CCLayerTreeHostImplTest.cpp:

[email protected]
Review URL: https://chromiumcodereview.appspot.com/10694117

Modified Paths

Diff

Modified: branches/chromium/1180/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp (122259 => 122260)


--- branches/chromium/1180/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp	2012-07-10 20:54:25 UTC (rev 122259)
+++ branches/chromium/1180/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp	2012-07-10 20:57:32 UTC (rev 122260)
@@ -156,6 +156,7 @@
 
 void CCLayerTreeHostImpl::commitComplete()
 {
+    TRACE_EVENT0("cc", "CCLayerTreeHostImpl::commitComplete");
     // Recompute max scroll position; must be after layer content bounds are
     // updated.
     updateMaxScrollPosition();
@@ -164,14 +165,22 @@
 
 bool CCLayerTreeHostImpl::canDraw()
 {
-    if (!m_rootLayerImpl)
+    if (!m_rootLayerImpl) {
+        TRACE_EVENT_INSTANT0("cc", "CCLayerTreeHostImpl::canDraw no root layer");
         return false;
-    if (viewportSize().isEmpty())
+    }
+    if (viewportSize().isEmpty()) {
+        TRACE_EVENT_INSTANT0("cc", "CCLayerTreeHostImpl::canDraw empty viewport");
         return false;
-    if (!m_layerRenderer)
+    }
+    if (!m_layerRenderer) {
+        TRACE_EVENT_INSTANT0("cc", "CCLayerTreeHostImpl::canDraw no layerRenderer");
         return false;
-    if (m_contentsTexturesWerePurgedSinceLastCommit)
+    }
+    if (m_contentsTexturesWerePurgedSinceLastCommit) {
+        TRACE_EVENT_INSTANT0("cc", "CCLayerTreeHostImpl::canDraw contents textures purged");
         return false;
+    }
     return true;
 }
 
@@ -409,6 +418,7 @@
 {
     contentsTextureAllocator()->deleteAllTextures();
     m_contentsTexturesWerePurgedSinceLastCommit = true;
+    m_client->setNeedsCommitOnImplThread();
 }
 
 void CCLayerTreeHostImpl::setMemoryAllocationLimitBytes(size_t bytes)

Modified: branches/chromium/1180/Source/WebCore/platform/graphics/chromium/cc/CCScheduler.cpp (122259 => 122260)


--- branches/chromium/1180/Source/WebCore/platform/graphics/chromium/cc/CCScheduler.cpp	2012-07-10 20:54:25 UTC (rev 122259)
+++ branches/chromium/1180/Source/WebCore/platform/graphics/chromium/cc/CCScheduler.cpp	2012-07-10 20:57:32 UTC (rev 122260)
@@ -159,6 +159,7 @@
     do {
         action = ""
         m_stateMachine.updateState(action);
+        TRACE_EVENT1("cc", "CCScheduler::processScheduledActions()", "action", action);
 
         switch (action) {
         case CCSchedulerStateMachine::ACTION_NONE:
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to