| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/trees/layer_tree_host_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/containers/hash_tables.h" | 11 #include "base/containers/hash_tables.h" |
| 12 #include "base/containers/scoped_ptr_hash_map.h" |
| 12 #include "cc/base/math_util.h" | 13 #include "cc/base/math_util.h" |
| 13 #include "cc/debug/test_web_graphics_context_3d.h" | 14 #include "cc/debug/test_web_graphics_context_3d.h" |
| 14 #include "cc/input/top_controls_manager.h" | 15 #include "cc/input/top_controls_manager.h" |
| 15 #include "cc/layers/delegated_renderer_layer_impl.h" | 16 #include "cc/layers/delegated_renderer_layer_impl.h" |
| 16 #include "cc/layers/heads_up_display_layer_impl.h" | 17 #include "cc/layers/heads_up_display_layer_impl.h" |
| 17 #include "cc/layers/io_surface_layer_impl.h" | 18 #include "cc/layers/io_surface_layer_impl.h" |
| 18 #include "cc/layers/layer_impl.h" | 19 #include "cc/layers/layer_impl.h" |
| 19 #include "cc/layers/painted_scrollbar_layer_impl.h" | 20 #include "cc/layers/painted_scrollbar_layer_impl.h" |
| 20 #include "cc/layers/quad_sink.h" | 21 #include "cc/layers/quad_sink.h" |
| 21 #include "cc/layers/render_surface_impl.h" | 22 #include "cc/layers/render_surface_impl.h" |
| (...skipping 4887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4909 | 4910 |
| 4910 // But if we set it to the same value that it was before, we shouldn't | 4911 // But if we set it to the same value that it was before, we shouldn't |
| 4911 // re-commit. | 4912 // re-commit. |
| 4912 host_impl_->SetMemoryPolicy(ManagedMemoryPolicy( | 4913 host_impl_->SetMemoryPolicy(ManagedMemoryPolicy( |
| 4913 host_impl_->memory_allocation_limit_bytes())); | 4914 host_impl_->memory_allocation_limit_bytes())); |
| 4914 host_impl_->SetDiscardBackBufferWhenNotVisible(true); | 4915 host_impl_->SetDiscardBackBufferWhenNotVisible(true); |
| 4915 EXPECT_FALSE(did_request_commit_); | 4916 EXPECT_FALSE(did_request_commit_); |
| 4916 } | 4917 } |
| 4917 | 4918 |
| 4918 struct RenderPassRemovalTestData : public LayerTreeHostImpl::FrameData { | 4919 struct RenderPassRemovalTestData : public LayerTreeHostImpl::FrameData { |
| 4919 ScopedPtrHashMap<RenderPass::Id, TestRenderPass> render_pass_cache; | 4920 base::ScopedPtrHashMap<RenderPass::Id, TestRenderPass> render_pass_cache; |
| 4920 scoped_ptr<SharedQuadState> shared_quad_state; | 4921 scoped_ptr<SharedQuadState> shared_quad_state; |
| 4921 }; | 4922 }; |
| 4922 | 4923 |
| 4923 class TestRenderer : public GLRenderer, public RendererClient { | 4924 class TestRenderer : public GLRenderer, public RendererClient { |
| 4924 public: | 4925 public: |
| 4925 static scoped_ptr<TestRenderer> Create(ResourceProvider* resource_provider, | 4926 static scoped_ptr<TestRenderer> Create(ResourceProvider* resource_provider, |
| 4926 OutputSurface* output_surface, | 4927 OutputSurface* output_surface, |
| 4927 Proxy* proxy) { | 4928 Proxy* proxy) { |
| 4928 scoped_ptr<TestRenderer> renderer(new TestRenderer(resource_provider, | 4929 scoped_ptr<TestRenderer> renderer(new TestRenderer(resource_provider, |
| 4929 output_surface, | 4930 output_surface, |
| (...skipping 1380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6310 EXPECT_EQ(0u, host_impl_->ResourceIdForUIResource(ui_resource_id)); | 6311 EXPECT_EQ(0u, host_impl_->ResourceIdForUIResource(ui_resource_id)); |
| 6311 EXPECT_EQ(0u, context3d->NumTextures()); | 6312 EXPECT_EQ(0u, context3d->NumTextures()); |
| 6312 | 6313 |
| 6313 // Should not change state for multiple deletion on one UIResourceId | 6314 // Should not change state for multiple deletion on one UIResourceId |
| 6314 host_impl_->DeleteUIResource(ui_resource_id); | 6315 host_impl_->DeleteUIResource(ui_resource_id); |
| 6315 EXPECT_EQ(0u, context3d->NumTextures()); | 6316 EXPECT_EQ(0u, context3d->NumTextures()); |
| 6316 } | 6317 } |
| 6317 | 6318 |
| 6318 } // namespace | 6319 } // namespace |
| 6319 } // namespace cc | 6320 } // namespace cc |
| OLD | NEW |