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/quad_culler.h" | 5 #include "cc/trees/quad_culler.h" |
6 | 6 |
7 #include "cc/debug/debug_colors.h" | 7 #include "cc/debug/debug_colors.h" |
8 #include "cc/layers/append_quads_data.h" | 8 #include "cc/layers/append_quads_data.h" |
9 #include "cc/layers/layer_impl.h" | 9 #include "cc/layers/layer_impl.h" |
10 #include "cc/quads/debug_border_draw_quad.h" | 10 #include "cc/quads/debug_border_draw_quad.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 return current_shared_quad_state_; | 37 return current_shared_quad_state_; |
38 } | 38 } |
39 | 39 |
40 gfx::Rect QuadCuller::UnoccludedContentRect( | 40 gfx::Rect QuadCuller::UnoccludedContentRect( |
41 const gfx::Rect& content_rect, | 41 const gfx::Rect& content_rect, |
42 const gfx::Transform& draw_transform) { | 42 const gfx::Transform& draw_transform) { |
43 return occlusion_tracker_.UnoccludedContentRect( | 43 return occlusion_tracker_.UnoccludedContentRect( |
44 layer_->render_target(), content_rect, draw_transform); | 44 layer_->render_target(), content_rect, draw_transform); |
45 } | 45 } |
46 | 46 |
| 47 gfx::Rect QuadCuller::UnoccludedContributingSurfaceContentRect( |
| 48 gfx::Rect& content_rect, |
| 49 gfx::Transform& draw_transform) { |
| 50 return occlusion_tracker_.UnoccludedContributingSurfaceContentRect( |
| 51 layer_, content_rect, draw_transform); |
| 52 } |
| 53 |
47 static inline bool AppendQuadInternal( | 54 static inline bool AppendQuadInternal( |
48 scoped_ptr<DrawQuad> draw_quad, | 55 scoped_ptr<DrawQuad> draw_quad, |
49 const gfx::Rect& culled_rect, | 56 const gfx::Rect& culled_rect, |
50 QuadList* quad_list, | 57 QuadList* quad_list, |
51 const OcclusionTracker<LayerImpl>& occlusion_tracker, | 58 const OcclusionTracker<LayerImpl>& occlusion_tracker, |
52 const LayerImpl* layer) { | 59 const LayerImpl* layer) { |
53 bool keep_quad = !culled_rect.IsEmpty(); | 60 bool keep_quad = !culled_rect.IsEmpty(); |
54 if (keep_quad) { | 61 if (keep_quad) { |
55 draw_quad->visible_rect = culled_rect; | 62 draw_quad->visible_rect = culled_rect; |
56 quad_list->push_back(draw_quad.Pass()); | 63 quad_list->push_back(draw_quad.Pass()); |
(...skipping 30 matching lines...) Expand all Loading... |
87 void QuadCuller::Append(scoped_ptr<DrawQuad> draw_quad) { | 94 void QuadCuller::Append(scoped_ptr<DrawQuad> draw_quad) { |
88 DCHECK(draw_quad->shared_quad_state == current_shared_quad_state_); | 95 DCHECK(draw_quad->shared_quad_state == current_shared_quad_state_); |
89 DCHECK(!shared_quad_state_list_->empty()); | 96 DCHECK(!shared_quad_state_list_->empty()); |
90 DCHECK(shared_quad_state_list_->back() == current_shared_quad_state_); | 97 DCHECK(shared_quad_state_list_->back() == current_shared_quad_state_); |
91 DCHECK(!draw_quad->rect.IsEmpty()); | 98 DCHECK(!draw_quad->rect.IsEmpty()); |
92 DCHECK(!draw_quad->visible_rect.IsEmpty()); | 99 DCHECK(!draw_quad->visible_rect.IsEmpty()); |
93 quad_list_->push_back(draw_quad.Pass()); | 100 quad_list_->push_back(draw_quad.Pass()); |
94 } | 101 } |
95 | 102 |
96 } // namespace cc | 103 } // namespace cc |
OLD | NEW |