Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(288)

Unified Diff: Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp

Issue 10690121: Merge 121076 - [chromium] LayerRendererChromium is not getting visibility messages in single thread… (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1180/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp
===================================================================
--- Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp (revision 122257)
+++ Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp (working copy)
@@ -29,6 +29,7 @@
#include "Extensions3D.h"
#include "LayerRendererChromium.h"
#include "TraceEvent.h"
+#include "TrackingTextureAllocator.h"
#include "cc/CCActiveGestureAnimation.h"
#include "cc/CCDamageTracker.h"
#include "cc/CCDebugRectHistory.h"
@@ -122,7 +123,8 @@
, m_settings(settings)
, m_deviceScaleFactor(1)
, m_visible(true)
- , m_sourceFrameCanBeDrawn(true)
+ , m_contentsTexturesWerePurgedSinceLastCommit(false)
+ , m_memoryAllocationLimitBytes(TextureManager::highLimitBytes(viewportSize()))
, m_headsUpDisplay(CCHeadsUpDisplay::create())
, m_pageScale(1)
, m_pageScaleDelta(1)
@@ -157,6 +159,7 @@
// Recompute max scroll position; must be after layer content bounds are
// updated.
updateMaxScrollPosition();
+ m_contentsTexturesWerePurgedSinceLastCommit = false;
}
bool CCLayerTreeHostImpl::canDraw()
@@ -167,12 +170,12 @@
return false;
if (!m_layerRenderer)
return false;
- if (!m_sourceFrameCanBeDrawn)
+ if (m_contentsTexturesWerePurgedSinceLastCommit)
return false;
return true;
}
-CCGraphicsContext* CCLayerTreeHostImpl::context()
+CCGraphicsContext* CCLayerTreeHostImpl::context() const
{
return m_context.get();
}
@@ -402,11 +405,22 @@
return true;
}
-void CCLayerTreeHostImpl::setContentsMemoryAllocationLimitBytes(size_t bytes)
+void CCLayerTreeHostImpl::releaseContentsTextures()
{
- m_client->postSetContentsMemoryAllocationLimitBytesToMainThreadOnImplThread(bytes);
+ contentsTextureAllocator()->deleteAllTextures();
+ m_contentsTexturesWerePurgedSinceLastCommit = true;
}
+void CCLayerTreeHostImpl::setMemoryAllocationLimitBytes(size_t bytes)
+{
+ if (m_memoryAllocationLimitBytes == bytes)
+ return;
+ m_memoryAllocationLimitBytes = bytes;
+
+ ASSERT(bytes);
+ m_client->setNeedsCommitOnImplThread();
+}
+
void CCLayerTreeHostImpl::drawLayers(const FrameData& frame)
{
TRACE_EVENT0("cc", "CCLayerTreeHostImpl::drawLayers");

Powered by Google App Engine
This is Rietveld 408576698