| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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.h" | 5 #include "cc/trees/layer_tree_host.h" |
| 6 | 6 |
| 7 #include "cc/layers/layer.h" | 7 #include "cc/layers/layer.h" |
| 8 #include "cc/output/copy_output_request.h" | 8 #include "cc/output/copy_output_request.h" |
| 9 #include "cc/output/copy_output_result.h" | 9 #include "cc/output/copy_output_result.h" |
| 10 #include "cc/test/layer_tree_test.h" | 10 #include "cc/test/layer_tree_test.h" |
| 11 #include "cc/test/occlusion_tracker_test_common.h" | 11 #include "cc/test/test_occlusion_tracker.h" |
| 12 | 12 |
| 13 namespace cc { | 13 namespace cc { |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 class TestLayer : public Layer { | 16 class TestLayer : public Layer { |
| 17 public: | 17 public: |
| 18 static scoped_refptr<TestLayer> Create() { | 18 static scoped_refptr<TestLayer> Create() { |
| 19 return make_scoped_refptr(new TestLayer()); | 19 return make_scoped_refptr(new TestLayer()); |
| 20 } | 20 } |
| 21 | 21 |
| 22 virtual bool Update( | 22 virtual bool Update(ResourceUpdateQueue* update_queue, |
| 23 ResourceUpdateQueue* update_queue, | 23 const OcclusionTracker<Layer>* occlusion) OVERRIDE { |
| 24 const OcclusionTracker* occlusion) OVERRIDE { | |
| 25 if (!occlusion) | 24 if (!occlusion) |
| 26 return false; | 25 return false; |
| 27 | 26 |
| 28 // Gain access to internals of the OcclusionTracker. | 27 // Gain access to internals of the OcclusionTracker. |
| 29 const TestOcclusionTracker* test_occlusion = | 28 const TestOcclusionTracker<Layer>* test_occlusion = |
| 30 static_cast<const TestOcclusionTracker*>(occlusion); | 29 static_cast<const TestOcclusionTracker<Layer>*>(occlusion); |
| 31 occlusion_ = UnionRegions( | 30 occlusion_ = UnionRegions( |
| 32 test_occlusion->occlusion_from_inside_target(), | 31 test_occlusion->occlusion_from_inside_target(), |
| 33 test_occlusion->occlusion_from_outside_target()); | 32 test_occlusion->occlusion_from_outside_target()); |
| 34 return false; | 33 return false; |
| 35 } | 34 } |
| 36 | 35 |
| 37 const Region& occlusion() const { return occlusion_; } | 36 const Region& occlusion() const { return occlusion_; } |
| 38 const Region& expected_occlusion() const { return expected_occlusion_; } | 37 const Region& expected_occlusion() const { return expected_occlusion_; } |
| 39 void set_expected_occlusion(const Region& occlusion) { | 38 void set_expected_occlusion(const Region& occlusion) { |
| 40 expected_occlusion_ = occlusion; | 39 expected_occlusion_ = occlusion; |
| (...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 | 613 |
| 615 layer_tree_host()->SetRootLayer(layers[0]); | 614 layer_tree_host()->SetRootLayer(layers[0]); |
| 616 LayerTreeTest::SetupTree(); | 615 LayerTreeTest::SetupTree(); |
| 617 } | 616 } |
| 618 }; | 617 }; |
| 619 | 618 |
| 620 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostOcclusionTestManySurfaces); | 619 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostOcclusionTestManySurfaces); |
| 621 | 620 |
| 622 } // namespace | 621 } // namespace |
| 623 } // namespace cc | 622 } // namespace cc |
| OLD | NEW |