Commit 09dc0d4b authored by danakj@chromium.org's avatar danakj@chromium.org

cc: Disable RenderSurface caching.

Surface caching is currently broken if any layers in the surface do not
draw themselves fully within the bounds of the surface for any reason
other than being occluded. This includes:
1) Being at non-ideal scale.
2) Being checkerboarded.
3) Missing a texture resource.
4) Having visibleContentRect clipped by something outside the surface.

This disables the feature entirely.

R=jamesr,vangelis
BUG=170713
NOTRY=true

Review URL: https://chromiumcodereview.appspot.com/12210077

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182136 0039d316-1c4b-4281-b951-d872f2087c98
parent 32298953
...@@ -291,6 +291,9 @@ bool DirectRenderer::useRenderPass(DrawingFrame& frame, const RenderPass* render ...@@ -291,6 +291,9 @@ bool DirectRenderer::useRenderPass(DrawingFrame& frame, const RenderPass* render
bool DirectRenderer::haveCachedResourcesForRenderPassId(RenderPass::Id id) const bool DirectRenderer::haveCachedResourcesForRenderPassId(RenderPass::Id id) const
{ {
if (!settings().cacheRenderPassContents)
return false;
CachedResource* texture = m_renderPassTextures.get(id); CachedResource* texture = m_renderPassTextures.get(id);
return texture && texture->id() && texture->isComplete(); return texture && texture->id() && texture->isComplete();
} }
......
...@@ -2752,6 +2752,7 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusion) ...@@ -2752,6 +2752,7 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusion)
{ {
LayerTreeSettings settings; LayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = gfx::Size(); settings.minimumOcclusionTrackingSize = gfx::Size();
settings.cacheRenderPassContents = true;
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy); scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
// Layers are structure as follows: // Layers are structure as follows:
...@@ -2866,6 +2867,7 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionEarlyOut) ...@@ -2866,6 +2867,7 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionEarlyOut)
{ {
LayerTreeSettings settings; LayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = gfx::Size(); settings.minimumOcclusionTrackingSize = gfx::Size();
settings.cacheRenderPassContents = true;
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy); scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
// Layers are structure as follows: // Layers are structure as follows:
...@@ -2980,6 +2982,7 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionExternalOverInternal) ...@@ -2980,6 +2982,7 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionExternalOverInternal)
{ {
LayerTreeSettings settings; LayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = gfx::Size(); settings.minimumOcclusionTrackingSize = gfx::Size();
settings.cacheRenderPassContents = true;
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy); scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
// Layers are structured as follows: // Layers are structured as follows:
...@@ -3066,6 +3069,7 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionExternalOverInternal) ...@@ -3066,6 +3069,7 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionExternalOverInternal)
TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionExternalNotAligned) TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionExternalNotAligned)
{ {
LayerTreeSettings settings; LayerTreeSettings settings;
settings.cacheRenderPassContents = true;
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy); scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
// Layers are structured as follows: // Layers are structured as follows:
...@@ -3140,6 +3144,7 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionPartialSwap) ...@@ -3140,6 +3144,7 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionPartialSwap)
LayerTreeSettings settings; LayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = gfx::Size(); settings.minimumOcclusionTrackingSize = gfx::Size();
settings.partialSwapEnabled = true; settings.partialSwapEnabled = true;
settings.cacheRenderPassContents = true;
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy); scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
// Layers are structure as follows: // Layers are structure as follows:
...@@ -3251,6 +3256,7 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithScissor) ...@@ -3251,6 +3256,7 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithScissor)
{ {
LayerTreeSettings settings; LayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = gfx::Size(); settings.minimumOcclusionTrackingSize = gfx::Size();
settings.cacheRenderPassContents = true;
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy); scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
/* /*
...@@ -3357,6 +3363,7 @@ TEST_P(LayerTreeHostImplTest, surfaceTextureCaching) ...@@ -3357,6 +3363,7 @@ TEST_P(LayerTreeHostImplTest, surfaceTextureCaching)
LayerTreeSettings settings; LayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = gfx::Size(); settings.minimumOcclusionTrackingSize = gfx::Size();
settings.partialSwapEnabled = true; settings.partialSwapEnabled = true;
settings.cacheRenderPassContents = true;
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy); scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
LayerImpl* rootPtr; LayerImpl* rootPtr;
...@@ -3515,6 +3522,7 @@ TEST_P(LayerTreeHostImplTest, surfaceTextureCachingNoPartialSwap) ...@@ -3515,6 +3522,7 @@ TEST_P(LayerTreeHostImplTest, surfaceTextureCachingNoPartialSwap)
{ {
LayerTreeSettings settings; LayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = gfx::Size(); settings.minimumOcclusionTrackingSize = gfx::Size();
settings.cacheRenderPassContents = true;
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy); scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
LayerImpl* rootPtr; LayerImpl* rootPtr;
......
...@@ -1405,6 +1405,11 @@ public: ...@@ -1405,6 +1405,11 @@ public:
{ {
} }
virtual void initializeSettings(LayerTreeSettings& settings) OVERRIDE
{
settings.cacheRenderPassContents = true;
}
virtual void beginTest() OVERRIDE virtual void beginTest() OVERRIDE
{ {
m_layerTreeHost->setViewportSize(gfx::Size(100, 100), gfx::Size(100, 100)); m_layerTreeHost->setViewportSize(gfx::Size(100, 100), gfx::Size(100, 100));
......
...@@ -20,6 +20,7 @@ LayerTreeSettings::LayerTreeSettings() ...@@ -20,6 +20,7 @@ LayerTreeSettings::LayerTreeSettings()
, renderVSyncEnabled(true) , renderVSyncEnabled(true)
, perTilePaintingEnabled(false) , perTilePaintingEnabled(false)
, partialSwapEnabled(false) , partialSwapEnabled(false)
, cacheRenderPassContents(true)
, rightAlignedSchedulingEnabled(false) , rightAlignedSchedulingEnabled(false)
, acceleratedAnimationEnabled(true) , acceleratedAnimationEnabled(true)
, pageScalePinchZoomEnabled(false) , pageScalePinchZoomEnabled(false)
...@@ -41,6 +42,8 @@ LayerTreeSettings::LayerTreeSettings() ...@@ -41,6 +42,8 @@ LayerTreeSettings::LayerTreeSettings()
, maxUntiledLayerSize(gfx::Size(512, 512)) , maxUntiledLayerSize(gfx::Size(512, 512))
, minimumOcclusionTrackingSize(gfx::Size(160, 160)) , minimumOcclusionTrackingSize(gfx::Size(160, 160))
{ {
// TODO(danakj): Renable surface caching when we can do it more realiably. crbug.com/170713
cacheRenderPassContents = false;
} }
LayerTreeSettings::~LayerTreeSettings() LayerTreeSettings::~LayerTreeSettings()
......
...@@ -23,6 +23,7 @@ class CC_EXPORT LayerTreeSettings { ...@@ -23,6 +23,7 @@ class CC_EXPORT LayerTreeSettings {
bool renderVSyncEnabled; bool renderVSyncEnabled;
bool perTilePaintingEnabled; bool perTilePaintingEnabled;
bool partialSwapEnabled; bool partialSwapEnabled;
bool cacheRenderPassContents;
bool rightAlignedSchedulingEnabled; bool rightAlignedSchedulingEnabled;
bool acceleratedAnimationEnabled; bool acceleratedAnimationEnabled;
bool pageScalePinchZoomEnabled; bool pageScalePinchZoomEnabled;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment