Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(324)

Side by Side Diff: content/common/cc_messages_unittest.cc

Issue 659683002: Include mask texture size in RenderPassDrawQuad (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@update_mask_draw_quad_test
Patch Set: No ToEnclosedRect Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/common/cc_messages.h ('k') | mojo/converters/surfaces/surfaces_type_converters.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <algorithm> 9 #include <algorithm>
10 10
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 138
139 void Compare(const IOSurfaceDrawQuad* a, const IOSurfaceDrawQuad* b) { 139 void Compare(const IOSurfaceDrawQuad* a, const IOSurfaceDrawQuad* b) {
140 EXPECT_EQ(a->io_surface_size.ToString(), b->io_surface_size.ToString()); 140 EXPECT_EQ(a->io_surface_size.ToString(), b->io_surface_size.ToString());
141 EXPECT_EQ(a->io_surface_resource_id, b->io_surface_resource_id); 141 EXPECT_EQ(a->io_surface_resource_id, b->io_surface_resource_id);
142 EXPECT_EQ(a->orientation, b->orientation); 142 EXPECT_EQ(a->orientation, b->orientation);
143 } 143 }
144 144
145 void Compare(const RenderPassDrawQuad* a, const RenderPassDrawQuad* b) { 145 void Compare(const RenderPassDrawQuad* a, const RenderPassDrawQuad* b) {
146 EXPECT_EQ(a->render_pass_id, b->render_pass_id); 146 EXPECT_EQ(a->render_pass_id, b->render_pass_id);
147 EXPECT_EQ(a->mask_resource_id, b->mask_resource_id); 147 EXPECT_EQ(a->mask_resource_id, b->mask_resource_id);
148 EXPECT_EQ(a->mask_uv_rect.ToString(), b->mask_uv_rect.ToString()); 148 EXPECT_EQ(a->mask_uv_scale.ToString(), b->mask_uv_scale.ToString());
149 EXPECT_EQ(a->mask_texture_size.ToString(), b->mask_texture_size.ToString());
149 EXPECT_EQ(a->filters.size(), b->filters.size()); 150 EXPECT_EQ(a->filters.size(), b->filters.size());
150 for (size_t i = 0; i < a->filters.size(); ++i) { 151 for (size_t i = 0; i < a->filters.size(); ++i) {
151 if (a->filters.at(i).type() != cc::FilterOperation::REFERENCE) { 152 if (a->filters.at(i).type() != cc::FilterOperation::REFERENCE) {
152 EXPECT_EQ(a->filters.at(i), b->filters.at(i)); 153 EXPECT_EQ(a->filters.at(i), b->filters.at(i));
153 } else { 154 } else {
154 EXPECT_EQ(b->filters.at(i).type(), cc::FilterOperation::REFERENCE); 155 EXPECT_EQ(b->filters.at(i).type(), cc::FilterOperation::REFERENCE);
155 EXPECT_EQ(a->filters.at(i).image_filter()->countInputs(), 156 EXPECT_EQ(a->filters.at(i).image_filter()->countInputs(),
156 b->filters.at(i).image_filter()->countInputs()); 157 b->filters.at(i).image_filter()->countInputs());
157 } 158 }
158 } 159 }
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 gfx::Rect arbitrary_rect1_inside_rect3(10, -40, 6, 3); 236 gfx::Rect arbitrary_rect1_inside_rect3(10, -40, 6, 3);
236 gfx::Rect arbitrary_rect2_inside_rect3(12, -51, 5, 12); 237 gfx::Rect arbitrary_rect2_inside_rect3(12, -51, 5, 12);
237 gfx::Size arbitrary_size1(15, 19); 238 gfx::Size arbitrary_size1(15, 19);
238 gfx::Size arbitrary_size2(3, 99); 239 gfx::Size arbitrary_size2(3, 99);
239 gfx::Size arbitrary_size3(75, 1281); 240 gfx::Size arbitrary_size3(75, 1281);
240 gfx::RectF arbitrary_rectf1(4.2f, -922.1f, 15.6f, 29.5f); 241 gfx::RectF arbitrary_rectf1(4.2f, -922.1f, 15.6f, 29.5f);
241 gfx::SizeF arbitrary_sizef1(15.2f, 104.6f); 242 gfx::SizeF arbitrary_sizef1(15.2f, 104.6f);
242 gfx::PointF arbitrary_pointf1(31.4f, 15.9f); 243 gfx::PointF arbitrary_pointf1(31.4f, 15.9f);
243 gfx::PointF arbitrary_pointf2(26.5f, -35.8f); 244 gfx::PointF arbitrary_pointf2(26.5f, -35.8f);
244 gfx::Vector2dF arbitrary_vector2df1(16.2f, -85.1f); 245 gfx::Vector2dF arbitrary_vector2df1(16.2f, -85.1f);
246 gfx::Vector2dF arbitrary_vector2df2(-8.3f, 0.47f);
245 float arbitrary_float1 = 0.7f; 247 float arbitrary_float1 = 0.7f;
246 float arbitrary_float2 = 0.3f; 248 float arbitrary_float2 = 0.3f;
247 float arbitrary_float3 = 0.9f; 249 float arbitrary_float3 = 0.9f;
248 float arbitrary_float_array[4] = {3.5f, 6.2f, 9.3f, 12.3f}; 250 float arbitrary_float_array[4] = {3.5f, 6.2f, 9.3f, 12.3f};
249 bool arbitrary_bool1 = true; 251 bool arbitrary_bool1 = true;
250 bool arbitrary_bool2 = false; 252 bool arbitrary_bool2 = false;
251 bool arbitrary_bool3 = true; 253 bool arbitrary_bool3 = true;
252 int arbitrary_context_id1 = 12; 254 int arbitrary_context_id1 = 12;
253 int arbitrary_context_id2 = 57; 255 int arbitrary_context_id2 = 57;
254 int arbitrary_context_id3 = -503; 256 int arbitrary_context_id3 = -503;
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 361
360 RenderPassDrawQuad* renderpass_in = 362 RenderPassDrawQuad* renderpass_in =
361 pass_in->CreateAndAppendDrawQuad<RenderPassDrawQuad>(); 363 pass_in->CreateAndAppendDrawQuad<RenderPassDrawQuad>();
362 renderpass_in->SetAll(shared_state2_in, 364 renderpass_in->SetAll(shared_state2_in,
363 arbitrary_rect1, 365 arbitrary_rect1,
364 arbitrary_rect2_inside_rect1, 366 arbitrary_rect2_inside_rect1,
365 arbitrary_rect1_inside_rect1, 367 arbitrary_rect1_inside_rect1,
366 arbitrary_bool1, 368 arbitrary_bool1,
367 arbitrary_id, 369 arbitrary_id,
368 arbitrary_resourceid2, 370 arbitrary_resourceid2,
369 arbitrary_rectf1, 371 arbitrary_vector2df1,
372 arbitrary_size1,
370 arbitrary_filters1, 373 arbitrary_filters1,
371 arbitrary_vector2df1, 374 arbitrary_vector2df2,
372 arbitrary_filters2); 375 arbitrary_filters2);
373 pass_cmp->CopyFromAndAppendRenderPassDrawQuad( 376 pass_cmp->CopyFromAndAppendRenderPassDrawQuad(
374 renderpass_in, 377 renderpass_in,
375 renderpass_in->shared_quad_state, 378 renderpass_in->shared_quad_state,
376 renderpass_in->render_pass_id); 379 renderpass_in->render_pass_id);
377 380
378 SharedQuadState* shared_state3_in = pass_in->CreateAndAppendSharedQuadState(); 381 SharedQuadState* shared_state3_in = pass_in->CreateAndAppendSharedQuadState();
379 shared_state3_in->SetAll(arbitrary_matrix, 382 shared_state3_in->SetAll(arbitrary_matrix,
380 arbitrary_size3, 383 arbitrary_size3,
381 arbitrary_rect3, 384 arbitrary_rect3,
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 SoftwareFrameData frame_out; 767 SoftwareFrameData frame_out;
765 PickleIterator iter(msg); 768 PickleIterator iter(msg);
766 EXPECT_EQ( 769 EXPECT_EQ(
767 expect_read, 770 expect_read,
768 IPC::ParamTraits<SoftwareFrameData>::Read(&msg, &iter, &frame_out)); 771 IPC::ParamTraits<SoftwareFrameData>::Read(&msg, &iter, &frame_out));
769 } 772 }
770 } 773 }
771 774
772 } // namespace 775 } // namespace
773 } // namespace content 776 } // namespace content
OLDNEW
« no previous file with comments | « content/common/cc_messages.h ('k') | mojo/converters/surfaces/surfaces_type_converters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698