| 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" |
| (...skipping 4258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4269 OVERRIDE {} | 4269 OVERRIDE {} |
| 4270 virtual bool HasImplThread() const OVERRIDE { return false; } | 4270 virtual bool HasImplThread() const OVERRIDE { return false; } |
| 4271 virtual bool ShouldClearRootRenderPass() const OVERRIDE { return true; } | 4271 virtual bool ShouldClearRootRenderPass() const OVERRIDE { return true; } |
| 4272 virtual CompositorFrameMetadata MakeCompositorFrameMetadata() const | 4272 virtual CompositorFrameMetadata MakeCompositorFrameMetadata() const |
| 4273 OVERRIDE { return CompositorFrameMetadata(); } | 4273 OVERRIDE { return CompositorFrameMetadata(); } |
| 4274 | 4274 |
| 4275 protected: | 4275 protected: |
| 4276 TestRenderer(ResourceProvider* resource_provider, | 4276 TestRenderer(ResourceProvider* resource_provider, |
| 4277 OutputSurface* output_surface, | 4277 OutputSurface* output_surface, |
| 4278 Proxy* proxy) | 4278 Proxy* proxy) |
| 4279 : GLRenderer(this, output_surface, resource_provider) {} | 4279 : GLRenderer(this, output_surface, resource_provider, 0) {} |
| 4280 | 4280 |
| 4281 private: | 4281 private: |
| 4282 LayerTreeSettings settings_; | 4282 LayerTreeSettings settings_; |
| 4283 gfx::Size viewport_size_; | 4283 gfx::Size viewport_size_; |
| 4284 base::hash_set<RenderPass::Id> textures_; | 4284 base::hash_set<RenderPass::Id> textures_; |
| 4285 }; | 4285 }; |
| 4286 | 4286 |
| 4287 static void ConfigureRenderPassTestData(const char* test_script, | 4287 static void ConfigureRenderPassTestData(const char* test_script, |
| 4288 RenderPassRemovalTestData* test_data, | 4288 RenderPassRemovalTestData* test_data, |
| 4289 TestRenderer* renderer) { | 4289 TestRenderer* renderer) { |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4604 char actual_result[1024]; | 4604 char actual_result[1024]; |
| 4605 DumpRenderPassTestData(test_data, actual_result); | 4605 DumpRenderPassTestData(test_data, actual_result); |
| 4606 EXPECT_STREQ(test_case.expected_result, actual_result) << "In test case: " << | 4606 EXPECT_STREQ(test_case.expected_result, actual_result) << "In test case: " << |
| 4607 test_case.name; | 4607 test_case.name; |
| 4608 } | 4608 } |
| 4609 | 4609 |
| 4610 TEST_F(LayerTreeHostImplTest, TestRemoveRenderPasses) { | 4610 TEST_F(LayerTreeHostImplTest, TestRemoveRenderPasses) { |
| 4611 scoped_ptr<OutputSurface> output_surface(CreateOutputSurface()); | 4611 scoped_ptr<OutputSurface> output_surface(CreateOutputSurface()); |
| 4612 ASSERT_TRUE(output_surface->context3d()); | 4612 ASSERT_TRUE(output_surface->context3d()); |
| 4613 scoped_ptr<ResourceProvider> resource_provider = | 4613 scoped_ptr<ResourceProvider> resource_provider = |
| 4614 ResourceProvider::Create(output_surface.get()); | 4614 ResourceProvider::Create(output_surface.get(), 0); |
| 4615 | 4615 |
| 4616 scoped_ptr<TestRenderer> renderer = | 4616 scoped_ptr<TestRenderer> renderer = |
| 4617 TestRenderer::Create(resource_provider.get(), | 4617 TestRenderer::Create(resource_provider.get(), |
| 4618 output_surface.get(), | 4618 output_surface.get(), |
| 4619 &proxy_); | 4619 &proxy_); |
| 4620 | 4620 |
| 4621 int test_case_index = 0; | 4621 int test_case_index = 0; |
| 4622 while (remove_render_passes_cases[test_case_index].name) { | 4622 while (remove_render_passes_cases[test_case_index].name) { |
| 4623 RenderPassRemovalTestData test_data; | 4623 RenderPassRemovalTestData test_data; |
| 4624 ConfigureRenderPassTestData( | 4624 ConfigureRenderPassTestData( |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4978 EXPECT_EQ(gfx::RectF(0.f, 0.f, 1.f, 1.f).ToString(), | 4978 EXPECT_EQ(gfx::RectF(0.f, 0.f, 1.f, 1.f).ToString(), |
| 4979 render_pass_quad->mask_uv_rect.ToString()); | 4979 render_pass_quad->mask_uv_rect.ToString()); |
| 4980 | 4980 |
| 4981 host_impl_->DrawLayers(&frame, base::TimeTicks::Now()); | 4981 host_impl_->DrawLayers(&frame, base::TimeTicks::Now()); |
| 4982 host_impl_->DidDrawAllLayers(frame); | 4982 host_impl_->DidDrawAllLayers(frame); |
| 4983 } | 4983 } |
| 4984 } | 4984 } |
| 4985 | 4985 |
| 4986 } // namespace | 4986 } // namespace |
| 4987 } // namespace cc | 4987 } // namespace cc |
| OLD | NEW |