[chromium] Viewport is not filled when out of texture memory on mac
authordanakj@chromium.org <danakj@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Apr 2012 04:54:50 +0000 (04:54 +0000)
committerdanakj@chromium.org <danakj@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Apr 2012 04:54:50 +0000 (04:54 +0000)
commitbc4b5a62c154d271e6d37c9c59e60cd267119d62
treec893307846b82ffb3f45a536122c67a4e0f5c02e
parent50119ccc87140e6b4ed5682ac411f1ee1139ee0f
[chromium] Viewport is not filled when out of texture memory on mac
https://bugs.webkit.org/show_bug.cgi?id=83351

Reviewed by Adrienne Walker.

Source/Platform:

* chromium/public/WebLayerTreeView.h:
(WebLayerTreeView):

Source/WebCore:

Currently we add gutter quads on the NonCompositedContentHost layer,
which lies above another visible layer - the rubberband layer on mac.
For this reason, on mac, gutter quads were disabled, as well as forcing
the NCCH layer to draw, in order to make the rubberband layer appear.

We move the logic for adding gutter quads into CCRenderPass, and add
gutter quads for all pixels that are visible through the viewport.
This allows us to stop special-casing the NCCH layer, and allows us
to skip drawing the layer equally with other layers. We remove the
backgroundCoversViewport() flag entirely.

In order to do this, we fix a bug in the occlusion tracker, that
allowed opaque() layers with skipsDraw to occlude, by making
the visibleContentOpaqueRegion() method on the layer classes
also return the opaque region for non-tiled layers, always use
its value in the occlusion tracker.

Unit test: CCLayerTreeHostImplTest.viewportCovered

* platform/graphics/chromium/LayerChromium.cpp:
(WebCore::LayerChromium::LayerChromium):
(WebCore::LayerChromium::pushPropertiesTo):
(WebCore::LayerChromium::visibleContentOpaqueRegion):
(WebCore):
* platform/graphics/chromium/LayerChromium.h:
(LayerChromium):
* platform/graphics/chromium/TiledLayerChromium.cpp:
(WebCore::TiledLayerChromium::prepareToUpdateTiles):
(WebCore::TiledLayerChromium::visibleContentOpaqueRegion):
* platform/graphics/chromium/cc/CCLayerImpl.cpp:
(WebCore::CCLayerImpl::CCLayerImpl):
(WebCore::CCLayerImpl::visibleContentOpaqueRegion):
(WebCore):
* platform/graphics/chromium/cc/CCLayerImpl.h:
(WebCore::CCLayerImpl::appendQuads):
(CCLayerImpl):
* platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
(WebCore::CCLayerTreeHost::CCLayerTreeHost):
(WebCore::CCLayerTreeHost::finishCommitOnImplThread):
* platform/graphics/chromium/cc/CCLayerTreeHost.h:
(WebCore::CCLayerTreeHost::setBackgroundColor):
(CCLayerTreeHost):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::calculateRenderPasses):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
(WebCore::CCLayerTreeHostImpl::backgroundColor):
(WebCore::CCLayerTreeHostImpl::setBackgroundColor):
(CCLayerTreeHostImpl):
* platform/graphics/chromium/cc/CCOcclusionTracker.cpp:
(WebCore::computeOcclusionBehindLayer):
(WebCore::::markOccludedBehindLayer):
* platform/graphics/chromium/cc/CCOcclusionTracker.h:
(CCOcclusionTrackerBase):
(WebCore::CCOcclusionTrackerBase::computeVisibleRegionInScreen):
* platform/graphics/chromium/cc/CCRenderPass.cpp:
(WebCore::CCRenderPass::appendQuadsToFillScreen):
(WebCore):
* platform/graphics/chromium/cc/CCRenderPass.h:
(WebCore):
(CCRenderPass):
* platform/graphics/chromium/cc/CCTiledLayerImpl.cpp:
(WebCore::CCTiledLayerImpl::appendQuads):
(WebCore::CCTiledLayerImpl::visibleContentOpaqueRegion):
* platform/graphics/chromium/cc/CCTiledLayerImpl.h:
(WebCore::CCTiledLayerImpl::skipsDraw):
(CCTiledLayerImpl):

Source/WebKit/chromium:

* src/NonCompositedContentHost.cpp:
(WebKit::NonCompositedContentHost::NonCompositedContentHost):
(WebKit::NonCompositedContentHost::setBackgroundColor):
* src/WebLayerTreeView.cpp:
(WebKit::WebLayerTreeView::setBackgroundColor):
(WebKit):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::setBackgroundColor):
(WebKit):
(WebKit::WebViewImplContentPainter::paint):
(WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
* src/WebViewImpl.h:
(WebCore):
(WebViewImpl):
* tests/CCLayerImplTest.cpp:
(WebCore::TEST):
* tests/CCLayerTreeHostImplTest.cpp:
(WebKitTests::BlendStateCheckLayer::appendQuads):
(WebKitTests::TEST_F):
(WebKitTests):
* tests/CCLayerTreeHostTest.cpp:
(WTF):
(CCLayerTreeHostTestCommit):
(WTF::CCLayerTreeHostTestCommit::CCLayerTreeHostTestCommit):
(WTF::CCLayerTreeHostTestCommit::beginTest):
(WTF::CCLayerTreeHostTestCommit::commitCompleteOnCCThread):
(WTF::CCLayerTreeHostTestCommit::afterTest):
(WTF::TEST_F):
(TestLayerChromium):
* tests/CCOcclusionTrackerTest.cpp:
(WebKitTests::TestContentLayerChromium::TestContentLayerChromium):
(WebKitTests::TestContentLayerChromium::visibleContentOpaqueRegion):
(WebKitTests::TestContentLayerChromium::setOpaqueContentsRect):
(TestContentLayerChromium):
(WebKitTests::TestContentLayerImpl::TestContentLayerImpl):
(TestContentLayerImpl):
(WebKitTests::TestContentLayerImpl::visibleContentOpaqueRegion):
(WebKitTests::TestContentLayerImpl::setOpaqueContentsRect):
* tests/CCTiledLayerImplTest.cpp:
* tests/LayerChromiumTest.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113677 268f45cc-cd09-0410-ab3c-d52691b4dbfc
28 files changed:
Source/Platform/ChangeLog
Source/Platform/chromium/public/WebLayerTreeView.h
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/LayerChromium.cpp
Source/WebCore/platform/graphics/chromium/LayerChromium.h
Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp
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/CCOcclusionTracker.cpp
Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.h
Source/WebCore/platform/graphics/chromium/cc/CCRenderPass.cpp
Source/WebCore/platform/graphics/chromium/cc/CCRenderPass.h
Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/NonCompositedContentHost.cpp
Source/WebKit/chromium/src/WebLayerTreeView.cpp
Source/WebKit/chromium/src/WebViewImpl.cpp
Source/WebKit/chromium/src/WebViewImpl.h
Source/WebKit/chromium/tests/CCLayerImplTest.cpp
Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp
Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp
Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp
Source/WebKit/chromium/tests/CCTiledLayerImplTest.cpp
Source/WebKit/chromium/tests/LayerChromiumTest.cpp