OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "content/common/cc_messages.h" | 5 #include "content/common/cc_messages.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include "cc/compositor_frame.h" | 9 #include "cc/compositor_frame.h" |
10 #include "ipc/ipc_message.h" | 10 #include "ipc/ipc_message.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 EXPECT_EQ(a->io_surface_size.ToString(), b->io_surface_size.ToString()); | 122 EXPECT_EQ(a->io_surface_size.ToString(), b->io_surface_size.ToString()); |
123 EXPECT_EQ(a->io_surface_texture_id, b->io_surface_texture_id); | 123 EXPECT_EQ(a->io_surface_texture_id, b->io_surface_texture_id); |
124 EXPECT_EQ(a->orientation, b->orientation); | 124 EXPECT_EQ(a->orientation, b->orientation); |
125 } | 125 } |
126 | 126 |
127 void Compare(const RenderPassDrawQuad* a, const RenderPassDrawQuad* b) { | 127 void Compare(const RenderPassDrawQuad* a, const RenderPassDrawQuad* b) { |
128 EXPECT_EQ(a->is_replica, b->is_replica); | 128 EXPECT_EQ(a->is_replica, b->is_replica); |
129 EXPECT_EQ(a->mask_resource_id, b->mask_resource_id); | 129 EXPECT_EQ(a->mask_resource_id, b->mask_resource_id); |
130 EXPECT_EQ(a->contents_changed_since_last_frame, | 130 EXPECT_EQ(a->contents_changed_since_last_frame, |
131 b->contents_changed_since_last_frame); | 131 b->contents_changed_since_last_frame); |
132 EXPECT_EQ(a->mask_tex_coord_scale_x, b->mask_tex_coord_scale_x); | 132 EXPECT_EQ(a->mask_uv_rect.ToString(), b->mask_uv_rect.ToString()); |
133 EXPECT_EQ(a->mask_tex_coord_scale_y, b->mask_tex_coord_scale_y); | |
134 EXPECT_EQ(a->mask_tex_coord_offset_x, b->mask_tex_coord_offset_x); | |
135 EXPECT_EQ(a->mask_tex_coord_offset_y, b->mask_tex_coord_offset_y); | |
136 } | 133 } |
137 | 134 |
138 void Compare(const SolidColorDrawQuad* a, const SolidColorDrawQuad* b) { | 135 void Compare(const SolidColorDrawQuad* a, const SolidColorDrawQuad* b) { |
139 EXPECT_EQ(a->color, b->color); | 136 EXPECT_EQ(a->color, b->color); |
140 } | 137 } |
141 | 138 |
142 void Compare(const StreamVideoDrawQuad* a, const StreamVideoDrawQuad* b) { | 139 void Compare(const StreamVideoDrawQuad* a, const StreamVideoDrawQuad* b) { |
143 EXPECT_EQ(a->texture_id, b->texture_id); | 140 EXPECT_EQ(a->texture_id, b->texture_id); |
144 EXPECT_EQ(a->matrix, b->matrix); | 141 EXPECT_EQ(a->matrix, b->matrix); |
145 } | 142 } |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 gfx::Rect arbitrary_rect2(40, 23, 11, 7); | 192 gfx::Rect arbitrary_rect2(40, 23, 11, 7); |
196 gfx::Rect arbitrary_rect3(7, -53, 22, 19); | 193 gfx::Rect arbitrary_rect3(7, -53, 22, 19); |
197 gfx::Size arbitrary_size1(15, 19); | 194 gfx::Size arbitrary_size1(15, 19); |
198 gfx::Size arbitrary_size2(3, 99); | 195 gfx::Size arbitrary_size2(3, 99); |
199 gfx::Size arbitrary_size3(75, 1281); | 196 gfx::Size arbitrary_size3(75, 1281); |
200 gfx::RectF arbitrary_rectf1(4.2f, -922.1f, 15.6f, 29.5f); | 197 gfx::RectF arbitrary_rectf1(4.2f, -922.1f, 15.6f, 29.5f); |
201 gfx::SizeF arbitrary_sizef1(15.2f, 104.6f); | 198 gfx::SizeF arbitrary_sizef1(15.2f, 104.6f); |
202 float arbitrary_float1 = 0.7f; | 199 float arbitrary_float1 = 0.7f; |
203 float arbitrary_float2 = 0.3f; | 200 float arbitrary_float2 = 0.3f; |
204 float arbitrary_float3 = 0.9f; | 201 float arbitrary_float3 = 0.9f; |
205 float arbitrary_float4 = 0.1f; | |
206 bool arbitrary_bool1 = true; | 202 bool arbitrary_bool1 = true; |
207 bool arbitrary_bool2 = false; | 203 bool arbitrary_bool2 = false; |
208 int arbitrary_int = 5; | 204 int arbitrary_int = 5; |
209 SkColor arbitrary_color = SkColorSetARGB(25, 36, 47, 58); | 205 SkColor arbitrary_color = SkColorSetARGB(25, 36, 47, 58); |
210 IOSurfaceDrawQuad::Orientation arbitrary_orientation = | 206 IOSurfaceDrawQuad::Orientation arbitrary_orientation = |
211 IOSurfaceDrawQuad::UNFLIPPED; | 207 IOSurfaceDrawQuad::UNFLIPPED; |
212 RenderPass::Id arbitrary_id(10, 14); | 208 RenderPass::Id arbitrary_id(10, 14); |
213 ResourceProvider::ResourceId arbitrary_resourceid = 55; | 209 ResourceProvider::ResourceId arbitrary_resourceid = 55; |
214 | 210 |
215 VideoLayerImpl::FramePlane arbitrary_plane1; | 211 VideoLayerImpl::FramePlane arbitrary_plane1; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 RenderPassDrawQuad::Create(); | 283 RenderPassDrawQuad::Create(); |
288 renderpass_in->SetAll(shared_state1_in.get(), | 284 renderpass_in->SetAll(shared_state1_in.get(), |
289 arbitrary_rect1, | 285 arbitrary_rect1, |
290 arbitrary_rect2, | 286 arbitrary_rect2, |
291 arbitrary_rect3, | 287 arbitrary_rect3, |
292 arbitrary_bool1, | 288 arbitrary_bool1, |
293 arbitrary_id, | 289 arbitrary_id, |
294 arbitrary_bool2, | 290 arbitrary_bool2, |
295 arbitrary_resourceid, | 291 arbitrary_resourceid, |
296 arbitrary_rect1, | 292 arbitrary_rect1, |
297 arbitrary_float1, | 293 arbitrary_rectf1); |
298 arbitrary_float2, | |
299 arbitrary_float3, | |
300 arbitrary_float4); | |
301 scoped_ptr<RenderPassDrawQuad> renderpass_cmp = renderpass_in->Copy( | 294 scoped_ptr<RenderPassDrawQuad> renderpass_cmp = renderpass_in->Copy( |
302 renderpass_in->shared_quad_state, renderpass_in->render_pass_id); | 295 renderpass_in->shared_quad_state, renderpass_in->render_pass_id); |
303 | 296 |
304 scoped_ptr<SharedQuadState> shared_state2_in = SharedQuadState::Create(); | 297 scoped_ptr<SharedQuadState> shared_state2_in = SharedQuadState::Create(); |
305 shared_state2_in->SetAll(arbitrary_matrix, | 298 shared_state2_in->SetAll(arbitrary_matrix, |
306 arbitrary_rect2, | 299 arbitrary_rect2, |
307 arbitrary_rect3, | 300 arbitrary_rect3, |
308 arbitrary_rect1, | 301 arbitrary_rect1, |
309 arbitrary_bool1, | 302 arbitrary_bool1, |
310 arbitrary_float2); | 303 arbitrary_float2); |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 EXPECT_EQ(arbitrary_size.ToString(), frame_out.size.ToString()); | 494 EXPECT_EQ(arbitrary_size.ToString(), frame_out.size.ToString()); |
502 EXPECT_EQ(arbitrary_uint, frame_out.resource_list.sync_point); | 495 EXPECT_EQ(arbitrary_uint, frame_out.resource_list.sync_point); |
503 | 496 |
504 EXPECT_EQ(2u, frame_out.resource_list.resources.size()); | 497 EXPECT_EQ(2u, frame_out.resource_list.resources.size()); |
505 Compare(arbitrary_resource1, frame_out.resource_list.resources[0]); | 498 Compare(arbitrary_resource1, frame_out.resource_list.resources[0]); |
506 Compare(arbitrary_resource2, frame_out.resource_list.resources[1]); | 499 Compare(arbitrary_resource2, frame_out.resource_list.resources[1]); |
507 } | 500 } |
508 | 501 |
509 } // namespace | 502 } // namespace |
510 } // namespace content | 503 } // namespace content |
OLD | NEW |