| 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/occlusion_tracker.h" | 5 #include "cc/trees/occlusion_tracker.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "cc/base/math_util.h" | 9 #include "cc/base/math_util.h" |
| 10 #include "cc/layers/layer.h" | 10 #include "cc/layers/layer.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 return this->GetCurrentOcclusionForContributingSurface( | 80 return this->GetCurrentOcclusionForContributingSurface( |
| 81 surface->draw_transform()) | 81 surface->draw_transform()) |
| 82 .GetUnoccludedContentRect(content_rect); | 82 .GetUnoccludedContentRect(content_rect); |
| 83 } | 83 } |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 class OcclusionTrackerTest : public testing::Test { | 86 class OcclusionTrackerTest : public testing::Test { |
| 87 protected: | 87 protected: |
| 88 explicit OcclusionTrackerTest(bool opaque_layers) | 88 explicit OcclusionTrackerTest(bool opaque_layers) |
| 89 : opaque_layers_(opaque_layers), | 89 : opaque_layers_(opaque_layers), |
| 90 client_(FakeLayerTreeHostClient::DIRECT_3D), | |
| 91 host_(FakeLayerTreeHost::Create(&client_, &task_graph_runner_)), | 90 host_(FakeLayerTreeHost::Create(&client_, &task_graph_runner_)), |
| 92 next_layer_impl_id_(1) {} | 91 next_layer_impl_id_(1) {} |
| 93 | 92 |
| 94 virtual void RunMyTest() = 0; | 93 virtual void RunMyTest() = 0; |
| 95 | 94 |
| 96 void TearDown() override { DestroyLayers(); } | 95 void TearDown() override { DestroyLayers(); } |
| 97 | 96 |
| 98 TestContentLayerImpl* CreateRoot(const gfx::Transform& transform, | 97 TestContentLayerImpl* CreateRoot(const gfx::Transform& transform, |
| 99 const gfx::PointF& position, | 98 const gfx::PointF& position, |
| 100 const gfx::Size& bounds) { | 99 const gfx::Size& bounds) { |
| (...skipping 2523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2624 EXPECT_EQ(gfx::Rect(), | 2623 EXPECT_EQ(gfx::Rect(), |
| 2625 occlusion.UnoccludedSurfaceContentRect( | 2624 occlusion.UnoccludedSurfaceContentRect( |
| 2626 surface, gfx::Rect(80, 70, 50, 50))); | 2625 surface, gfx::Rect(80, 70, 50, 50))); |
| 2627 } | 2626 } |
| 2628 }; | 2627 }; |
| 2629 | 2628 |
| 2630 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery) | 2629 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery) |
| 2631 | 2630 |
| 2632 } // namespace | 2631 } // namespace |
| 2633 } // namespace cc | 2632 } // namespace cc |
| OLD | NEW |