[chromium] LayerRendererChromium should use GpuMemoryAllocationChanged callback to...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Mar 2012 22:43:19 +0000 (22:43 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Mar 2012 22:43:19 +0000 (22:43 +0000)
commita3b2a569c213a139551ead742d474688c8e88652
treef3a594e424b3d49c1b90f8419455e6ce7a6a4449
parent33758b6368c6ac41da9743088bac52ec21d65891
[chromium] LayerRendererChromium should use GpuMemoryAllocationChanged callback to explicitly manage framebuffer.
https://bugs.webkit.org/show_bug.cgi?id=81823

Patch by Michal Mocny <mmocny@google.com> on 2012-03-22
Reviewed by Adrienne Walker.

Source/WebCore:

New UnitTests: LayerRendererChromiumTest

* platform/graphics/chromium/LayerRendererChromium.cpp:
(LayerRendererGpuMemoryAllocationChangedCallbackAdapter):
(WebCore::LayerRendererGpuMemoryAllocationChangedCallbackAdapter::create):
(WebCore::LayerRendererGpuMemoryAllocationChangedCallbackAdapter::~LayerRendererGpuMemoryAllocationChangedCallbackAdapter):
(WebCore::LayerRendererGpuMemoryAllocationChangedCallbackAdapter::onGpuMemoryAllocationChanged):
(WebCore::LayerRendererGpuMemoryAllocationChangedCallbackAdapter::LayerRendererGpuMemoryAllocationChangedCallbackAdapter):
(WebCore):
(WebCore::LayerRendererChromium::LayerRendererChromium):
(WebCore::LayerRendererChromium::initialize):
(WebCore::LayerRendererChromium::~LayerRendererChromium):
(WebCore::LayerRendererChromium::setVisible):
(WebCore::LayerRendererChromium::swapBuffers):
(WebCore::LayerRendererChromium::discardFramebuffer):
(WebCore::LayerRendererChromium::ensureFramebuffer):
* platform/graphics/chromium/LayerRendererChromium.h:
(WebCore):
(LayerRendererChromiumClient):
(LayerRendererChromium):
(WebCore::LayerRendererChromium::isFramebufferDiscarded):
(ScopedEnsureFramebufferAllocation):
(WebCore::ScopedEnsureFramebufferAllocation::ScopedEnsureFramebufferAllocation):
(WebCore::ScopedEnsureFramebufferAllocation::~ScopedEnsureFramebufferAllocation):
* platform/graphics/chromium/cc/CCLayerTreeHost.h:
(WebCore::LayerRendererCapabilities::LayerRendererCapabilities):
(LayerRendererCapabilities):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::setVisible):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
(CCLayerTreeHostImpl):
* platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
(WebCore::CCSingleThreadProxy::compositeAndReadback):
* platform/graphics/chromium/cc/CCThreadProxy.cpp:
(WebCore::CCThreadProxy::compositeAndReadback):

Source/WebKit/chromium:

* WebKit.gypi:
* tests/LayerRendererChromiumTest.cpp: Added.
(FrameCountingMemoryAllocationSettingContext):
(FrameCountingMemoryAllocationSettingContext::FrameCountingMemoryAllocationSettingContext):
(FrameCountingMemoryAllocationSettingContext::prepareTexture):
(FrameCountingMemoryAllocationSettingContext::setMemoryAllocationChangedCallbackCHROMIUM):
(FrameCountingMemoryAllocationSettingContext::getString):
(FrameCountingMemoryAllocationSettingContext::frameCount):
(FrameCountingMemoryAllocationSettingContext::setMemoryAllocation):
(FakeLayerRendererChromiumClient):
(FakeLayerRendererChromiumClient::FakeLayerRendererChromiumClient):
(FakeLayerRendererChromiumClient::viewportSize):
(FakeLayerRendererChromiumClient::settings):
(FakeLayerRendererChromiumClient::rootLayer):
(FakeLayerRendererChromiumClient::didLoseContext):
(FakeLayerRendererChromiumClient::onSwapBuffersComplete):
(FakeLayerRendererChromiumClient::setFullRootLayerDamage):
(FakeLayerRendererChromiumClient::setFullRootLayerDamageCount):
(FakeLayerRendererChromium):
(FakeLayerRendererChromium::FakeLayerRendererChromium):
(LayerRendererChromiumTest):
(LayerRendererChromiumTest::LayerRendererChromiumTest):
(LayerRendererChromiumTest::SetUp):
(LayerRendererChromiumTest::swapBuffers):
(TEST_F):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@111777 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h
Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp
Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/WebKit.gypi
Source/WebKit/chromium/tests/LayerRendererChromiumTest.cpp [new file with mode: 0644]