summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-19 16:25:28 +0000
committerdanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-19 16:25:28 +0000
commite724164534fefc3621f59731223b6098087a31c4 (patch)
treec3565da410d579f599c8dd8fa7ecae402e272eba
parentcfae3da714249cda62028f0bc7899e5d30fe5379 (diff)
downloadchromium_src-e724164534fefc3621f59731223b6098087a31c4.zip
chromium_src-e724164534fefc3621f59731223b6098087a31c4.tar.gz
chromium_src-e724164534fefc3621f59731223b6098087a31c4.tar.bz2
Merge 182136
> 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 TBR=danakj@chromium.org Review URL: https://codereview.chromium.org/12288050 git-svn-id: svn://svn.chromium.org/chrome/branches/1364/src@183231 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--cc/direct_renderer.cc3
-rw-r--r--cc/layer_tree_host_impl_unittest.cc8
-rw-r--r--cc/layer_tree_host_unittest.cc5
-rw-r--r--cc/layer_tree_settings.cc4
-rw-r--r--cc/layer_tree_settings.h1
5 files changed, 21 insertions, 0 deletions
diff --git a/cc/direct_renderer.cc b/cc/direct_renderer.cc
index 14809f2..943fbe1 100644
--- a/cc/direct_renderer.cc
+++ b/cc/direct_renderer.cc
@@ -292,6 +292,9 @@ bool DirectRenderer::useRenderPass(DrawingFrame& frame, const RenderPass* render
bool DirectRenderer::haveCachedResourcesForRenderPassId(RenderPass::Id id) const
{
+ if (!settings().cacheRenderPassContents)
+ return false;
+
CachedResource* texture = m_renderPassTextures.get(id);
return texture && texture->id() && texture->isComplete();
}
diff --git a/cc/layer_tree_host_impl_unittest.cc b/cc/layer_tree_host_impl_unittest.cc
index c08c91e..89b5e3a 100644
--- a/cc/layer_tree_host_impl_unittest.cc
+++ b/cc/layer_tree_host_impl_unittest.cc
@@ -3159,6 +3159,7 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusion)
{
LayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = gfx::Size();
+ settings.cacheRenderPassContents = true;
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
// Layers are structure as follows:
@@ -3273,6 +3274,7 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionEarlyOut)
{
LayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = gfx::Size();
+ settings.cacheRenderPassContents = true;
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
// Layers are structure as follows:
@@ -3387,6 +3389,7 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionExternalOverInternal)
{
LayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = gfx::Size();
+ settings.cacheRenderPassContents = true;
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
// Layers are structured as follows:
@@ -3473,6 +3476,7 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionExternalOverInternal)
TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionExternalNotAligned)
{
LayerTreeSettings settings;
+ settings.cacheRenderPassContents = true;
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
// Layers are structured as follows:
@@ -3547,6 +3551,7 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionPartialSwap)
LayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = gfx::Size();
settings.partialSwapEnabled = true;
+ settings.cacheRenderPassContents = true;
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
// Layers are structure as follows:
@@ -3658,6 +3663,7 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithScissor)
{
LayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = gfx::Size();
+ settings.cacheRenderPassContents = true;
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
/*
@@ -3764,6 +3770,7 @@ TEST_P(LayerTreeHostImplTest, surfaceTextureCaching)
LayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = gfx::Size();
settings.partialSwapEnabled = true;
+ settings.cacheRenderPassContents = true;
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
LayerImpl* rootPtr;
@@ -3923,6 +3930,7 @@ TEST_P(LayerTreeHostImplTest, surfaceTextureCachingNoPartialSwap)
{
LayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = gfx::Size();
+ settings.cacheRenderPassContents = true;
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
LayerImpl* rootPtr;
diff --git a/cc/layer_tree_host_unittest.cc b/cc/layer_tree_host_unittest.cc
index 22ef5c7e..5489382 100644
--- a/cc/layer_tree_host_unittest.cc
+++ b/cc/layer_tree_host_unittest.cc
@@ -2689,6 +2689,11 @@ public:
{
}
+ virtual void initializeSettings(LayerTreeSettings& settings) OVERRIDE
+ {
+ settings.cacheRenderPassContents = true;
+ }
+
virtual void beginTest() OVERRIDE
{
m_layerTreeHost->setViewportSize(gfx::Size(100, 100), gfx::Size(100, 100));
diff --git a/cc/layer_tree_settings.cc b/cc/layer_tree_settings.cc
index 4221167..2600330 100644
--- a/cc/layer_tree_settings.cc
+++ b/cc/layer_tree_settings.cc
@@ -20,6 +20,7 @@ LayerTreeSettings::LayerTreeSettings()
, renderVSyncEnabled(true)
, perTilePaintingEnabled(false)
, partialSwapEnabled(false)
+ , cacheRenderPassContents(true)
, acceleratedAnimationEnabled(true)
, pageScalePinchZoomEnabled(false)
, backgroundColorInsteadOfCheckerboard(false)
@@ -68,6 +69,9 @@ LayerTreeSettings::LayerTreeSettings()
num_raster_threads;
}
}
+
+ // TODO(danakj): Renable surface caching when we can do it more realiably. crbug.com/170713
+ cacheRenderPassContents = false;
}
LayerTreeSettings::~LayerTreeSettings()
diff --git a/cc/layer_tree_settings.h b/cc/layer_tree_settings.h
index 847795f..caef498 100644
--- a/cc/layer_tree_settings.h
+++ b/cc/layer_tree_settings.h
@@ -23,6 +23,7 @@ class CC_EXPORT LayerTreeSettings {
bool renderVSyncEnabled;
bool perTilePaintingEnabled;
bool partialSwapEnabled;
+ bool cacheRenderPassContents;
bool acceleratedAnimationEnabled;
bool pageScalePinchZoomEnabled;
bool backgroundColorInsteadOfCheckerboard;