| 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/test/mock_quad_culler.h" | 5 #include "cc/test/mock_quad_culler.h" |
| 6 | 6 |
| 7 #include "cc/quads/draw_quad.h" | 7 #include "cc/quads/draw_quad.h" |
| 8 | 8 |
| 9 namespace cc { | 9 namespace cc { |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 SharedQuadState* MockQuadCuller::UseSharedQuadState( | 23 SharedQuadState* MockQuadCuller::UseSharedQuadState( |
| 24 scoped_ptr<SharedQuadState> shared_quad_state) { | 24 scoped_ptr<SharedQuadState> shared_quad_state) { |
| 25 SharedQuadState* raw_ptr = shared_quad_state.get(); | 25 SharedQuadState* raw_ptr = shared_quad_state.get(); |
| 26 active_shared_quad_state_list_->push_back(shared_quad_state.Pass()); | 26 active_shared_quad_state_list_->push_back(shared_quad_state.Pass()); |
| 27 return raw_ptr; | 27 return raw_ptr; |
| 28 } | 28 } |
| 29 | 29 |
| 30 gfx::Rect MockQuadCuller::UnoccludedContentRect( | 30 gfx::Rect MockQuadCuller::UnoccludedContentRect( |
| 31 const gfx::Rect& content_rect, | 31 const gfx::Rect& content_rect, |
| 32 const gfx::Transform& draw_transform) { | 32 const gfx::Transform& draw_transform) { |
| 33 DCHECK(draw_transform.IsIdentity() || occluded_content_rect_.IsEmpty()); |
| 33 gfx::Rect result = content_rect; | 34 gfx::Rect result = content_rect; |
| 34 result.Subtract(occluded_content_rect_); | 35 result.Subtract(occluded_content_rect_); |
| 35 return result; | 36 return result; |
| 36 } | 37 } |
| 37 | 38 |
| 39 gfx::Rect MockQuadCuller::UnoccludedContributingSurfaceContentRect( |
| 40 const gfx::Rect& content_rect, |
| 41 const gfx::Transform& draw_transform) { |
| 42 DCHECK(draw_transform.IsIdentity() || |
| 43 occluded_content_rect_for_contributing_surface_.IsEmpty()); |
| 44 gfx::Rect result = content_rect; |
| 45 result.Subtract(occluded_content_rect_for_contributing_surface_); |
| 46 return result; |
| 47 } |
| 48 |
| 38 bool MockQuadCuller::MaybeAppend(scoped_ptr<DrawQuad> draw_quad) { | 49 bool MockQuadCuller::MaybeAppend(scoped_ptr<DrawQuad> draw_quad) { |
| 39 if (!draw_quad->rect.IsEmpty()) { | 50 if (!draw_quad->rect.IsEmpty()) { |
| 40 active_quad_list_->push_back(draw_quad.Pass()); | 51 active_quad_list_->push_back(draw_quad.Pass()); |
| 41 return true; | 52 return true; |
| 42 } | 53 } |
| 43 return false; | 54 return false; |
| 44 } | 55 } |
| 45 | 56 |
| 46 void MockQuadCuller::Append(scoped_ptr<DrawQuad> draw_quad) { | 57 void MockQuadCuller::Append(scoped_ptr<DrawQuad> draw_quad) { |
| 47 DCHECK(!draw_quad->rect.IsEmpty()); | 58 DCHECK(!draw_quad->rect.IsEmpty()); |
| 48 DCHECK(!draw_quad->visible_rect.IsEmpty()); | 59 DCHECK(!draw_quad->visible_rect.IsEmpty()); |
| 49 active_quad_list_->push_back(draw_quad.Pass()); | 60 active_quad_list_->push_back(draw_quad.Pass()); |
| 50 } | 61 } |
| 51 | 62 |
| 52 } // namespace cc | 63 } // namespace cc |
| OLD | NEW |