| 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/debug/overdraw_metrics.h" | 8 #include "cc/debug/overdraw_metrics.h" |
| 9 #include "cc/layers/append_quads_data.h" | 9 #include "cc/layers/append_quads_data.h" |
| 10 #include "cc/layers/layer_impl.h" | 10 #include "cc/layers/layer_impl.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 scoped_ptr<SharedQuadState> shared_quad_state) { | 35 scoped_ptr<SharedQuadState> shared_quad_state) { |
| 36 // TODO(danakj): If all quads are culled for the shared_quad_state, we can | 36 // TODO(danakj): If all quads are culled for the shared_quad_state, we can |
| 37 // drop it from the list. | 37 // drop it from the list. |
| 38 current_shared_quad_state_ = shared_quad_state.get(); | 38 current_shared_quad_state_ = shared_quad_state.get(); |
| 39 shared_quad_state_list_->push_back(shared_quad_state.Pass()); | 39 shared_quad_state_list_->push_back(shared_quad_state.Pass()); |
| 40 return current_shared_quad_state_; | 40 return current_shared_quad_state_; |
| 41 } | 41 } |
| 42 | 42 |
| 43 static inline bool AppendQuadInternal( | 43 static inline bool AppendQuadInternal( |
| 44 scoped_ptr<DrawQuad> draw_quad, | 44 scoped_ptr<DrawQuad> draw_quad, |
| 45 gfx::Rect culled_rect, | 45 const gfx::Rect& culled_rect, |
| 46 QuadList* quad_list, | 46 QuadList* quad_list, |
| 47 const OcclusionTrackerImpl& occlusion_tracker, | 47 const OcclusionTrackerImpl& occlusion_tracker, |
| 48 const LayerImpl* layer, | 48 const LayerImpl* layer, |
| 49 bool create_debug_border_quads) { | 49 bool create_debug_border_quads) { |
| 50 bool keep_quad = !culled_rect.IsEmpty(); | 50 bool keep_quad = !culled_rect.IsEmpty(); |
| 51 if (keep_quad) | 51 if (keep_quad) |
| 52 draw_quad->visible_rect = culled_rect; | 52 draw_quad->visible_rect = culled_rect; |
| 53 | 53 |
| 54 occlusion_tracker.overdraw_metrics()->DidCullForDrawing( | 54 occlusion_tracker.overdraw_metrics()->DidCullForDrawing( |
| 55 draw_quad->quadTransform(), draw_quad->rect, culled_rect); | 55 draw_quad->quadTransform(), draw_quad->rect, culled_rect); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 | 99 |
| 100 return AppendQuadInternal(draw_quad.Pass(), | 100 return AppendQuadInternal(draw_quad.Pass(), |
| 101 culled_rect, | 101 culled_rect, |
| 102 quad_list_, | 102 quad_list_, |
| 103 occlusion_tracker_, | 103 occlusion_tracker_, |
| 104 layer_, | 104 layer_, |
| 105 show_culling_with_debug_border_quads_); | 105 show_culling_with_debug_border_quads_); |
| 106 } | 106 } |
| 107 | 107 |
| 108 } // namespace cc | 108 } // namespace cc |
| OLD | NEW |