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/animation/animation_host.h" | 9 #include "cc/animation/animation_host.h" |
10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 // layer. Simple wrapper around GetUnoccludedContentRect. | 70 // layer. Simple wrapper around GetUnoccludedContentRect. |
71 gfx::Rect UnoccludedLayerContentRect(const LayerImpl* layer, | 71 gfx::Rect UnoccludedLayerContentRect(const LayerImpl* layer, |
72 const gfx::Rect& content_rect) const { | 72 const gfx::Rect& content_rect) const { |
73 DCHECK(layer->visible_layer_rect().Contains(content_rect)); | 73 DCHECK(layer->visible_layer_rect().Contains(content_rect)); |
74 return this->GetCurrentOcclusionForLayer(layer->DrawTransform()) | 74 return this->GetCurrentOcclusionForLayer(layer->DrawTransform()) |
75 .GetUnoccludedContentRect(content_rect); | 75 .GetUnoccludedContentRect(content_rect); |
76 } | 76 } |
77 | 77 |
78 gfx::Rect UnoccludedSurfaceContentRect(const LayerImpl* layer, | 78 gfx::Rect UnoccludedSurfaceContentRect(const LayerImpl* layer, |
79 const gfx::Rect& content_rect) const { | 79 const gfx::Rect& content_rect) const { |
80 RenderSurfaceImpl* surface = layer->render_surface(); | 80 RenderSurfaceImpl* surface = layer->GetRenderSurface(); |
81 return this->GetCurrentOcclusionForContributingSurface( | 81 return this->GetCurrentOcclusionForContributingSurface( |
82 surface->draw_transform()) | 82 surface->draw_transform()) |
83 .GetUnoccludedContentRect(content_rect); | 83 .GetUnoccludedContentRect(content_rect); |
84 } | 84 } |
85 }; | 85 }; |
86 | 86 |
87 class OcclusionTrackerTest : public testing::Test { | 87 class OcclusionTrackerTest : public testing::Test { |
88 protected: | 88 protected: |
89 explicit OcclusionTrackerTest(bool opaque_layers) | 89 explicit OcclusionTrackerTest(bool opaque_layers) |
90 : opaque_layers_(opaque_layers), | 90 : opaque_layers_(opaque_layers), |
(...skipping 2334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2425 EXPECT_EQ(gfx::Rect(), | 2425 EXPECT_EQ(gfx::Rect(), |
2426 occlusion.UnoccludedSurfaceContentRect( | 2426 occlusion.UnoccludedSurfaceContentRect( |
2427 surface, gfx::Rect(80, 70, 50, 50))); | 2427 surface, gfx::Rect(80, 70, 50, 50))); |
2428 } | 2428 } |
2429 }; | 2429 }; |
2430 | 2430 |
2431 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery) | 2431 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery) |
2432 | 2432 |
2433 } // namespace | 2433 } // namespace |
2434 } // namespace cc | 2434 } // namespace cc |
OLD | NEW |