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()); |
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; |
| 37 } |
| 38 |
| 39 gfx::Rect MockQuadCuller::UnoccludedContributingSurfaceContentRect( |
| 40 gfx::Rect& content_rect, |
| 41 gfx::Transform& draw_transform) { |
| 42 DCHECK(draw_transform.IsIdentity()); |
| 43 gfx::Rect result = content_rect; |
| 44 result.Subtract(occluded_content_rect_); |
| 45 return result; |
36 } | 46 } |
37 | 47 |
38 bool MockQuadCuller::MaybeAppend(scoped_ptr<DrawQuad> draw_quad) { | 48 bool MockQuadCuller::MaybeAppend(scoped_ptr<DrawQuad> draw_quad) { |
39 if (!draw_quad->rect.IsEmpty()) { | 49 if (!draw_quad->rect.IsEmpty()) { |
40 active_quad_list_->push_back(draw_quad.Pass()); | 50 active_quad_list_->push_back(draw_quad.Pass()); |
41 return true; | 51 return true; |
42 } | 52 } |
43 return false; | 53 return false; |
44 } | 54 } |
45 | 55 |
46 void MockQuadCuller::Append(scoped_ptr<DrawQuad> draw_quad) { | 56 void MockQuadCuller::Append(scoped_ptr<DrawQuad> draw_quad) { |
47 DCHECK(!draw_quad->rect.IsEmpty()); | 57 DCHECK(!draw_quad->rect.IsEmpty()); |
48 DCHECK(!draw_quad->visible_rect.IsEmpty()); | 58 DCHECK(!draw_quad->visible_rect.IsEmpty()); |
49 active_quad_list_->push_back(draw_quad.Pass()); | 59 active_quad_list_->push_back(draw_quad.Pass()); |
50 } | 60 } |
51 | 61 |
52 } // namespace cc | 62 } // namespace cc |
OLD | NEW |