diff options
author | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-26 04:11:08 +0000 |
---|---|---|
committer | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-26 04:11:08 +0000 |
commit | 0309ba5e0dd0cd544c53de98e17b0261d280bafc (patch) | |
tree | cfbda1122db1028816fcca2153c0eeb042632ff5 | |
parent | dc000e83ab8ede4242ff2a9df5ec1e195eb3cadc (diff) | |
download | chromium_src-0309ba5e0dd0cd544c53de98e17b0261d280bafc.zip chromium_src-0309ba5e0dd0cd544c53de98e17b0261d280bafc.tar.gz chromium_src-0309ba5e0dd0cd544c53de98e17b0261d280bafc.tar.bz2 |
Remove GpuMemoryAllocationForRenderer::enforce_but_do_not_keep_as_policy
It's always false, and we're not planning on using the feature at this point.
BUG=None
Review URL: https://chromiumcodereview.appspot.com/16972012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208614 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | cc/output/gl_renderer.cc | 10 | ||||
-rw-r--r-- | cc/output/gl_renderer_unittest.cc | 5 | ||||
-rw-r--r-- | cc/output/renderer.h | 3 | ||||
-rw-r--r-- | cc/output/software_renderer_unittest.cc | 2 | ||||
-rw-r--r-- | cc/test/pixel_test.cc | 2 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_impl.cc | 4 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_impl.h | 6 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_impl_unittest.cc | 2 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_unittest.cc | 3 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_unittest_context.cc | 2 | ||||
-rw-r--r-- | content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc | 2 | ||||
-rw-r--r-- | content/common/gpu/gpu_memory_allocation.h | 14 | ||||
-rw-r--r-- | content/common/gpu/gpu_messages.h | 1 |
13 files changed, 16 insertions, 40 deletions
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc index d7a7cea..8a75101 100644 --- a/cc/output/gl_renderer.cc +++ b/cc/output/gl_renderer.cc @@ -2075,19 +2075,11 @@ void GLRenderer::onMemoryAllocationChanged( allocation.bytesLimitWhenNotVisible, PriorityCutoff(allocation.priorityCutoffWhenNotVisible)); - if (allocation.enforceButDoNotKeepAsPolicy) - client_->EnforceManagedMemoryPolicy(policy); - else - client_->SetManagedMemoryPolicy(policy); + client_->SetManagedMemoryPolicy(policy); } - bool old_discard_backbuffer_when_not_visible = - discard_backbuffer_when_not_visible_; discard_backbuffer_when_not_visible_ = !allocation.suggestHaveBackbuffer; EnforceMemoryPolicy(); - if (allocation.enforceButDoNotKeepAsPolicy) - discard_backbuffer_when_not_visible_ = - old_discard_backbuffer_when_not_visible; } ManagedMemoryPolicy::PriorityCutoff GLRenderer::PriorityCutoff( diff --git a/cc/output/gl_renderer_unittest.cc b/cc/output/gl_renderer_unittest.cc index 22180ca..18c21cc 100644 --- a/cc/output/gl_renderer_unittest.cc +++ b/cc/output/gl_renderer_unittest.cc @@ -182,9 +182,6 @@ class FakeRendererClient : public RendererClient { virtual void SetManagedMemoryPolicy(const ManagedMemoryPolicy& policy) OVERRIDE { memory_allocation_limit_bytes_ = policy.bytes_limit_when_visible; - } - virtual void EnforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy) - OVERRIDE { if (last_call_was_set_visibility_) *last_call_was_set_visibility_ = false; } @@ -860,7 +857,7 @@ TEST(GLRendererTest2, VisibilityChangeIsLastCall) { bool last_call_was_set_visiblity = false; // Ensure that the call to setVisibilityCHROMIUM is the last call issue to the // GPU process, after glFlush is called, and after the RendererClient's - // EnforceManagedMemoryPolicy is called. Plumb this tracking between both the + // SetManagedMemoryPolicy is called. Plumb this tracking between both the // RenderClient and the Context by giving them both a pointer to a variable on // the stack. context->set_last_call_was_set_visibility_pointer( diff --git a/cc/output/renderer.h b/cc/output/renderer.h index efb1dfc..3070073 100644 --- a/cc/output/renderer.h +++ b/cc/output/renderer.h @@ -28,8 +28,6 @@ class CC_EXPORT RendererClient { virtual const LayerTreeSettings& Settings() const = 0; virtual void SetFullRootLayerDamage() = 0; virtual void SetManagedMemoryPolicy(const ManagedMemoryPolicy& policy) = 0; - virtual void EnforceManagedMemoryPolicy( - const ManagedMemoryPolicy& policy) = 0; virtual bool HasImplThread() const = 0; virtual bool ShouldClearRootRenderPass() const = 0; virtual CompositorFrameMetadata MakeCompositorFrameMetadata() const = 0; @@ -84,6 +82,7 @@ class CC_EXPORT Renderer { RendererClient* client_; + private: DISALLOW_COPY_AND_ASSIGN(Renderer); }; diff --git a/cc/output/software_renderer_unittest.cc b/cc/output/software_renderer_unittest.cc index b4e91fc..a882c2d 100644 --- a/cc/output/software_renderer_unittest.cc +++ b/cc/output/software_renderer_unittest.cc @@ -64,8 +64,6 @@ class SoftwareRendererTest : public testing::Test, public RendererClient { virtual void SetFullRootLayerDamage() OVERRIDE {} virtual void SetManagedMemoryPolicy(const ManagedMemoryPolicy& policy) OVERRIDE {} - virtual void EnforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy) - OVERRIDE {} virtual bool HasImplThread() const OVERRIDE { return false; } virtual bool ShouldClearRootRenderPass() const OVERRIDE { return should_clear_root_render_pass_; diff --git a/cc/test/pixel_test.cc b/cc/test/pixel_test.cc index 5d02e58..cd007c1 100644 --- a/cc/test/pixel_test.cc +++ b/cc/test/pixel_test.cc @@ -43,8 +43,6 @@ class PixelTest::PixelTestRendererClient virtual void SetFullRootLayerDamage() OVERRIDE {} virtual void SetManagedMemoryPolicy( const ManagedMemoryPolicy& policy) OVERRIDE {} - virtual void EnforceManagedMemoryPolicy( - const ManagedMemoryPolicy& policy) OVERRIDE {} virtual bool HasImplThread() const OVERRIDE { return false; } virtual bool ShouldClearRootRenderPass() const OVERRIDE { return true; } virtual CompositorFrameMetadata MakeCompositorFrameMetadata() const diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index 316aeeb..3905e8e 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc @@ -949,6 +949,10 @@ bool LayerTreeHostImpl::PrepareToDraw(FrameData* frame, return true; } +void LayerTreeHostImpl::EvictTexturesForTesting() { + EnforceManagedMemoryPolicy(ManagedMemoryPolicy(0)); +} + void LayerTreeHostImpl::EnforceManagedMemoryPolicy( const ManagedMemoryPolicy& policy) { diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h index 678d2d0..ef7edd5 100644 --- a/cc/trees/layer_tree_host_impl.h +++ b/cc/trees/layer_tree_host_impl.h @@ -176,6 +176,9 @@ class CC_EXPORT LayerTreeHostImpl // the URL bar and non-overlay scrollbars. gfx::SizeF VisibleViewportSize() const; + // Evict all textures by enforcing a memory policy with an allocation of 0. + void EvictTexturesForTesting(); + // RendererClient implementation virtual gfx::Rect DeviceViewport() const OVERRIDE; private: @@ -185,8 +188,6 @@ class CC_EXPORT LayerTreeHostImpl virtual void SetFullRootLayerDamage() OVERRIDE; virtual void SetManagedMemoryPolicy(const ManagedMemoryPolicy& policy) OVERRIDE; - virtual void EnforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy) - OVERRIDE; virtual bool HasImplThread() const OVERRIDE; virtual bool ShouldClearRootRenderPass() const OVERRIDE; virtual CompositorFrameMetadata MakeCompositorFrameMetadata() const OVERRIDE; @@ -438,6 +439,7 @@ class CC_EXPORT LayerTreeHostImpl void UpdateCurrentFrameTime(base::TimeTicks* ticks, base::Time* now) const; void StartScrollbarAnimationRecursive(LayerImpl* layer, base::TimeTicks time); + void EnforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy); scoped_ptr<OutputSurface> output_surface_; diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc index fdae685..7b1c59e 100644 --- a/cc/trees/layer_tree_host_impl_unittest.cc +++ b/cc/trees/layer_tree_host_impl_unittest.cc @@ -4767,8 +4767,6 @@ class TestRenderer : public GLRenderer, public RendererClient { virtual void SetFullRootLayerDamage() OVERRIDE {} virtual void SetManagedMemoryPolicy(const ManagedMemoryPolicy& policy) OVERRIDE {} - virtual void EnforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy) - OVERRIDE {} virtual bool HasImplThread() const OVERRIDE { return false; } virtual bool ShouldClearRootRenderPass() const OVERRIDE { return true; } virtual CompositorFrameMetadata MakeCompositorFrameMetadata() const diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc index 66deed9..1b10e41 100644 --- a/cc/trees/layer_tree_host_unittest.cc +++ b/cc/trees/layer_tree_host_unittest.cc @@ -1728,8 +1728,7 @@ class LayerTreeHostTestEvictTextures : public LayerTreeHostTest { void EvictTexturesOnImplThread() { DCHECK(impl_for_evict_textures_); - impl_for_evict_textures_->EnforceManagedMemoryPolicy( - ManagedMemoryPolicy(0)); + impl_for_evict_textures_->EvictTexturesForTesting(); } // Commit 1: Just commit and draw normally, then post an eviction at the end diff --git a/cc/trees/layer_tree_host_unittest_context.cc b/cc/trees/layer_tree_host_unittest_context.cc index 3cfaf3f..58272df 100644 --- a/cc/trees/layer_tree_host_unittest_context.cc +++ b/cc/trees/layer_tree_host_unittest_context.cc @@ -842,7 +842,7 @@ class LayerTreeHostContextTestLostContextAndEvictTextures } void EvictTexturesOnImplThread() { - impl_host_->EnforceManagedMemoryPolicy(ManagedMemoryPolicy(0)); + impl_host_->EvictTexturesForTesting(); if (lose_after_evict_) LoseContext(); } diff --git a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc index 51fabae..fcd7f665 100644 --- a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc +++ b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc @@ -1418,8 +1418,6 @@ void WebGraphicsContext3DCommandBufferImpl::OnMemoryAllocationChanged( WebkitPriorityCutoff(allocation.priority_cutoff_when_not_visible); web_allocation.haveBackbufferWhenNotVisible = allocation.have_backbuffer_when_not_visible; - web_allocation.enforceButDoNotKeepAsPolicy = - allocation.enforce_but_do_not_keep_as_policy; // Populate deprecated WebKit fields. These may be removed when references to // them in WebKit are removed. diff --git a/content/common/gpu/gpu_memory_allocation.h b/content/common/gpu/gpu_memory_allocation.h index 7962041..a2a9b9a 100644 --- a/content/common/gpu/gpu_memory_allocation.h +++ b/content/common/gpu/gpu_memory_allocation.h @@ -38,17 +38,12 @@ struct GpuMemoryAllocationForRenderer { PriorityCutoff priority_cutoff_when_not_visible; bool have_backbuffer_when_not_visible; - // If true, enforce this policy just once, but do not keep - // it as a permanent policy. - bool enforce_but_do_not_keep_as_policy; - GpuMemoryAllocationForRenderer() : bytes_limit_when_visible(0), priority_cutoff_when_visible(kPriorityCutoffAllowNothing), bytes_limit_when_not_visible(0), priority_cutoff_when_not_visible(kPriorityCutoffAllowNothing), - have_backbuffer_when_not_visible(false), - enforce_but_do_not_keep_as_policy(false) { + have_backbuffer_when_not_visible(false) { } GpuMemoryAllocationForRenderer(uint64 bytes_limit_when_visible) @@ -56,8 +51,7 @@ struct GpuMemoryAllocationForRenderer { priority_cutoff_when_visible(kPriorityCutoffAllowEverything), bytes_limit_when_not_visible(0), priority_cutoff_when_not_visible(kPriorityCutoffAllowNothing), - have_backbuffer_when_not_visible(false), - enforce_but_do_not_keep_as_policy(false) { + have_backbuffer_when_not_visible(false) { } bool Equals(const GpuMemoryAllocationForRenderer& other) const { @@ -68,9 +62,7 @@ struct GpuMemoryAllocationForRenderer { priority_cutoff_when_not_visible == other.priority_cutoff_when_not_visible && have_backbuffer_when_not_visible == - other.have_backbuffer_when_not_visible && - enforce_but_do_not_keep_as_policy == - other.enforce_but_do_not_keep_as_policy; + other.have_backbuffer_when_not_visible; } }; diff --git a/content/common/gpu/gpu_messages.h b/content/common/gpu/gpu_messages.h index 6a5b6f9..05afcdb 100644 --- a/content/common/gpu/gpu_messages.h +++ b/content/common/gpu/gpu_messages.h @@ -183,7 +183,6 @@ IPC_STRUCT_TRAITS_BEGIN(content::GpuMemoryAllocationForRenderer) IPC_STRUCT_TRAITS_MEMBER(bytes_limit_when_not_visible) IPC_STRUCT_TRAITS_MEMBER(priority_cutoff_when_not_visible) IPC_STRUCT_TRAITS_MEMBER(have_backbuffer_when_not_visible) - IPC_STRUCT_TRAITS_MEMBER(enforce_but_do_not_keep_as_policy) IPC_STRUCT_TRAITS_END() IPC_ENUM_TRAITS(content::GpuMemoryAllocationForRenderer::PriorityCutoff) |