DescriptionMerge 121076 - [chromium] LayerRendererChromium is not getting visibility messages in single threaded compositing mode.
https://bugs.webkit.org/show_bug.cgi?id=89045
Reviewed by Adrienne Walker.
Based on patch by Michal Mocny <mmocny@google.com>.
Source/WebCore:
Invariants:
1.) We never commit (paint, animate, any of it) when not visible on the main thread -except- for
compositeAndReadback, regardless of threaded vs non-threaded mode
2.) CCLayerTreeHost::m_contentsTextureManager's memory budget is only set by updateLayers() when we are going to
make a frame and is always set to a non-zero value
3.) Zero-sized allocations from the GPU process are always serviced immediately on the impl thread. Non-zero
allocations are met in the next frame, whenever we would produce that frame according to our usual frame
scheduling logic.
4.) The impl thread always knows the set of currently-allocated managed texture IDs and can delete them all
whenever it likes without needing the main thread to be responsive.
Details:
[See original commit...]
* platform/graphics/chromium/LayerRendererChromium.cpp:
(WebCore::LayerRendererGpuMemoryAllocationChangedCallbackAdapter::onGpuMemoryAllocationChangedOnImpl):
(WebCore::LayerRendererChromium::LayerRendererChromium):
(WebCore::LayerRendererChromium::initialize):
(WebCore::LayerRendererChromium::setVisible):
(WebCore::LayerRendererChromium::setGpuMemoryAllocation):
(WebCore):
(WebCore::LayerRendererChromium::swapBuffers):
(WebCore::LayerRendererChromium::getFramebufferPixels):
* platform/graphics/chromium/LayerRendererChromium.h:
(WebCore):
(LayerRendererChromium):
* platform/graphics/chromium/TextureManager.cpp:
(WebCore::TextureManager::evictAndRemoveAllDeletedTextures):
(WebCore):
* platform/graphics/chromium/TextureManager.h:
(TextureAllocator):
(TextureManager):
* platform/graphics/chromium/TrackingTextureAllocator.cpp:
(WebCore::TrackingTextureAllocator::createTexture):
(WebCore::TrackingTextureAllocator::deleteTexture):
(WebCore):
(WebCore::TrackingTextureAllocator::deleteAllTextures):
* platform/graphics/chromium/TrackingTextureAllocator.h:
(TrackingTextureAllocator):
* platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
(WebCore::CCLayerTreeHost::CCLayerTreeHost):
(WebCore::CCLayerTreeHost::initializeLayerRenderer):
(WebCore::CCLayerTreeHost::finishCommitOnImplThread):
(WebCore::CCLayerTreeHost::setVisible):
(WebCore::CCLayerTreeHost::evictAllContentTextures):
(WebCore::CCLayerTreeHost::updateLayers):
* platform/graphics/chromium/cc/CCLayerTreeHost.h:
(CCLayerTreeHost):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::CCLayerTreeHostImpl):
(WebCore::CCLayerTreeHostImpl::commitComplete):
(WebCore::CCLayerTreeHostImpl::canDraw):
(WebCore::CCLayerTreeHostImpl::context):
(WebCore::CCLayerTreeHostImpl::releaseContentsTextures):
(WebCore):
(WebCore::CCLayerTreeHostImpl::setMemoryAllocationLimitBytes):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
(CCLayerTreeHostImplClient):
(WebCore::CCLayerTreeHostImpl::contentsTexturesWerePurgedSinceLastCommit):
(WebCore::CCLayerTreeHostImpl::memoryAllocationLimitBytes):
(CCLayerTreeHostImpl):
* platform/graphics/chromium/cc/CCProxy.h:
(CCProxy):
* platform/graphics/chromium/cc/CCRenderer.h:
(CCRendererClient):
* platform/graphics/chromium/cc/CCScheduler.cpp:
(WebCore::CCScheduler::beginFrameComplete):
(WebCore::CCScheduler::beginFrameAborted):
(WebCore):
(WebCore::CCScheduler::didSwapBuffersComplete):
(WebCore::CCScheduler::didLoseContext):
(WebCore::CCScheduler::didRecreateContext):
(WebCore::CCScheduler::vsyncTick):
* platform/graphics/chromium/cc/CCScheduler.h:
(CCScheduler):
* platform/graphics/chromium/cc/CCSchedulerStateMachine.cpp:
(WebCore::CCSchedulerStateMachine::beginFrameAborted):
(WebCore):
* platform/graphics/chromium/cc/CCSchedulerStateMachine.h:
* platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
(WebCore::CCSingleThreadProxy::setVisible):
(WebCore):
(WebCore::CCSingleThreadProxy::stop):
(WebCore::CCSingleThreadProxy::commitAndComposite):
* platform/graphics/chromium/cc/CCSingleThreadProxy.h:
(CCSingleThreadProxy):
* platform/graphics/chromium/cc/CCThreadProxy.cpp:
(WebCore::CCThreadProxy::CCThreadProxy):
(WebCore::CCThreadProxy::compositeAndReadback):
(WebCore::CCThreadProxy::setVisible):
(WebCore):
(WebCore::CCThreadProxy::setVisibleOnImplThread):
(WebCore::CCThreadProxy::scheduledActionBeginFrame):
(WebCore::CCThreadProxy::beginFrame):
(WebCore::CCThreadProxy::beginFrameAbortedOnImplThread):
(WebCore::CCThreadProxy::scheduledActionDrawAndSwapInternal):
(WebCore::CCThreadProxy::layerTreeHostClosedOnImplThread):
* platform/graphics/chromium/cc/CCThreadProxy.h:
(CCThreadProxy):
(BeginFrameAndCommitState):
* platform/graphics/chromium/cc/CCVideoLayerImpl.cpp:
(WebCore::CCVideoLayerImpl::~CCVideoLayerImpl):
(WebCore::CCVideoLayerImpl::willDraw):
(WebCore::CCVideoLayerImpl::willDrawInternal):
(WebCore::CCVideoLayerImpl::FramePlane::allocateData):
(WebCore::CCVideoLayerImpl::FramePlane::freeData):
(WebCore::CCVideoLayerImpl::allocatePlaneData):
(WebCore::CCVideoLayerImpl::freePlaneData):
(WebCore::CCVideoLayerImpl::freeUnusedPlaneData):
(WebCore::CCVideoLayerImpl::didLoseContext):
* platform/graphics/chromium/cc/CCVideoLayerImpl.h:
(FramePlane):
Source/WebKit/chromium:
Update various test fixtures and tests to cover scheduling, visibility, and resource allocation changes.
* tests/CCLayerTreeHostImplTest.cpp:
* tests/CCLayerTreeHostTest.cpp:
(CCLayerTreeHostTestAbortFrameWhenInvisible):
(WTF::CCLayerTreeHostTestAbortFrameWhenInvisible::CCLayerTreeHostTestAbortFrameWhenInvisible):
(WTF::CCLayerTreeHostTestAbortFrameWhenInvisible::beginTest):
(WTF::CCLayerTreeHostTestAbortFrameWhenInvisible::afterTest):
(WTF):
(WTF::TEST_F):
(WTF::CCLayerTreeHostTestLayerOcclusion::beginTest):
(WTF::CCLayerTreeHostTestLayerOcclusionWithFilters::beginTest):
(WTF::CCLayerTreeHostTestManySurfaces::beginTest):
* tests/CCSchedulerStateMachineTest.cpp:
(WebCore::TEST):
* tests/CCTiledLayerTestCommon.h:
* tests/FakeWebGraphicsContext3D.h:
(WebKit::FakeWebGraphicsContext3D::FakeWebGraphicsContext3D):
(FakeWebGraphicsContext3D):
(WebKit::FakeWebGraphicsContext3D::createTexture):
* tests/LayerRendererChromiumTest.cpp:
(TEST_F):
* tests/TiledLayerChromiumTest.cpp:
TBR=jamesr@google.com
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=122259
Patch Set 1 #Messages
Total messages: 1 (0 generated)
|