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/gl_renderer.h" | 5 #include "cc/gl_renderer.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "cc/compositor_frame_metadata.h" | 9 #include "cc/compositor_frame_metadata.h" |
10 #include "cc/draw_quad.h" | 10 #include "cc/draw_quad.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 const gfx::Rect output_rect = rect; | 86 const gfx::Rect output_rect = rect; |
87 const gfx::RectF damage_rect = rect; | 87 const gfx::RectF damage_rect = rect; |
88 const gfx::Transform transform_to_root_target; | 88 const gfx::Transform transform_to_root_target; |
89 pass->SetNew(id, output_rect, damage_rect, transform_to_root_target); | 89 pass->SetNew(id, output_rect, damage_rect, transform_to_root_target); |
90 return pass.Pass(); | 90 return pass.Pass(); |
91 } | 91 } |
92 | 92 |
93 scoped_ptr<SharedQuadState> CreateTestSharedQuadState( | 93 scoped_ptr<SharedQuadState> CreateTestSharedQuadState( |
94 gfx::Transform content_to_target_transform, gfx::Rect rect) { | 94 gfx::Transform content_to_target_transform, gfx::Rect rect) { |
95 const gfx::Rect visible_content_rect = rect; | 95 const gfx::Rect visible_content_rect = rect; |
96 const gfx::Rect clipped_rect_in_target = rect; | |
97 const gfx::Rect clip_rect = rect; | 96 const gfx::Rect clip_rect = rect; |
98 const bool is_clipped = false; | 97 const bool is_clipped = false; |
99 const float opacity = 1.0f; | 98 const float opacity = 1.0f; |
100 scoped_ptr<SharedQuadState> shared_state = SharedQuadState::Create(); | 99 scoped_ptr<SharedQuadState> shared_state = SharedQuadState::Create(); |
101 shared_state->SetAll(content_to_target_transform, | 100 shared_state->SetAll(content_to_target_transform, |
102 visible_content_rect, | 101 visible_content_rect, |
103 clipped_rect_in_target, | |
104 clip_rect, | 102 clip_rect, |
105 is_clipped, | 103 is_clipped, |
106 opacity); | 104 opacity); |
107 return shared_state.Pass(); | 105 return shared_state.Pass(); |
108 } | 106 } |
109 | 107 |
110 scoped_ptr<DrawQuad> CreateTestRenderPassDrawQuad( | 108 scoped_ptr<DrawQuad> CreateTestRenderPassDrawQuad( |
111 SharedQuadState* shared_state, gfx::Rect rect, RenderPass::Id pass_id) { | 109 SharedQuadState* shared_state, gfx::Rect rect, RenderPass::Id pass_id) { |
112 scoped_ptr<RenderPassDrawQuad> quad = RenderPassDrawQuad::Create(); | 110 scoped_ptr<RenderPassDrawQuad> quad = RenderPassDrawQuad::Create(); |
113 quad->SetNew(shared_state, | 111 quad->SetNew(shared_state, |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 renderer_->decideRenderPassAllocationsForFrame(pass_list); | 187 renderer_->decideRenderPassAllocationsForFrame(pass_list); |
190 renderer_->drawFrame(pass_list); | 188 renderer_->drawFrame(pass_list); |
191 | 189 |
192 EXPECT_TRUE(PixelsMatchReference( | 190 EXPECT_TRUE(PixelsMatchReference( |
193 FilePath(FILE_PATH_LITERAL("blue_yellow.png")), viewport_rect)); | 191 FilePath(FILE_PATH_LITERAL("blue_yellow.png")), viewport_rect)); |
194 } | 192 } |
195 #endif | 193 #endif |
196 | 194 |
197 } // namespace | 195 } // namespace |
198 } // namespace cc | 196 } // namespace cc |
OLD | NEW |