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

Side by Side Diff: cc/draw_quad_unittest.cc

Issue 11410024: ui: Remove gfx::Size::ClampToNonNegative, prevent negative sizes always. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: negative-width Created 7 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « ash/system/user/tray_user.cc ('k') | chrome/browser/ui/extensions/shell_window.h » ('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 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/draw_quad.h" 5 #include "cc/draw_quad.h"
6 6
7 #include "cc/checkerboard_draw_quad.h" 7 #include "cc/checkerboard_draw_quad.h"
8 #include "cc/debug_border_draw_quad.h" 8 #include "cc/debug_border_draw_quad.h"
9 #include "cc/io_surface_draw_quad.h" 9 #include "cc/io_surface_draw_quad.h"
10 #include "cc/math_util.h" 10 #include "cc/math_util.h"
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 EXPECT_EQ(DrawQuad::STREAM_VIDEO_CONTENT, copyQuad->material); 355 EXPECT_EQ(DrawQuad::STREAM_VIDEO_CONTENT, copyQuad->material);
356 EXPECT_EQ(textureId, copyQuad->texture_id); 356 EXPECT_EQ(textureId, copyQuad->texture_id);
357 EXPECT_EQ(matrix, copyQuad->matrix); 357 EXPECT_EQ(matrix, copyQuad->matrix);
358 } 358 }
359 359
360 TEST(DrawQuadTest, copyTextureDrawQuad) 360 TEST(DrawQuadTest, copyTextureDrawQuad)
361 { 361 {
362 gfx::Rect opaqueRect(3, 7, 10, 12); 362 gfx::Rect opaqueRect(3, 7, 10, 12);
363 unsigned resourceId = 82; 363 unsigned resourceId = 82;
364 bool premultipliedAlpha = true; 364 bool premultipliedAlpha = true;
365 gfx::RectF uvRect(0.5, 224, -51, 36); 365 gfx::RectF uvRect(0.5f, 224.f, 51.f, 36.f);
366 const float vertex_opacity[] = {1.0f, 1.0f, 1.0f, 1.0f}; 366 const float vertex_opacity[] = {1.0f, 1.0f, 1.0f, 1.0f};
367 bool flipped = true; 367 bool flipped = true;
368 CREATE_SHARED_STATE(); 368 CREATE_SHARED_STATE();
369 369
370 CREATE_QUAD_6_NEW(TextureDrawQuad, opaqueRect, resourceId, premultipliedAlph a, uvRect, vertex_opacity, flipped); 370 CREATE_QUAD_6_NEW(TextureDrawQuad, opaqueRect, resourceId, premultipliedAlph a, uvRect, vertex_opacity, flipped);
371 EXPECT_EQ(DrawQuad::TEXTURE_CONTENT, copyQuad->material); 371 EXPECT_EQ(DrawQuad::TEXTURE_CONTENT, copyQuad->material);
372 EXPECT_RECT_EQ(opaqueRect, copyQuad->opaque_rect); 372 EXPECT_RECT_EQ(opaqueRect, copyQuad->opaque_rect);
373 EXPECT_EQ(resourceId, copyQuad->resource_id); 373 EXPECT_EQ(resourceId, copyQuad->resource_id);
374 EXPECT_EQ(premultipliedAlpha, copyQuad->premultiplied_alpha); 374 EXPECT_EQ(premultipliedAlpha, copyQuad->premultiplied_alpha);
375 EXPECT_FLOAT_RECT_EQ(uvRect, copyQuad->uv_rect); 375 EXPECT_FLOAT_RECT_EQ(uvRect, copyQuad->uv_rect);
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 EXPECT_EQ(uPlane.resourceId, copyQuad->u_plane.resourceId); 463 EXPECT_EQ(uPlane.resourceId, copyQuad->u_plane.resourceId);
464 EXPECT_EQ(uPlane.size, copyQuad->u_plane.size); 464 EXPECT_EQ(uPlane.size, copyQuad->u_plane.size);
465 EXPECT_EQ(uPlane.format, copyQuad->u_plane.format); 465 EXPECT_EQ(uPlane.format, copyQuad->u_plane.format);
466 EXPECT_EQ(vPlane.resourceId, copyQuad->v_plane.resourceId); 466 EXPECT_EQ(vPlane.resourceId, copyQuad->v_plane.resourceId);
467 EXPECT_EQ(vPlane.size, copyQuad->v_plane.size); 467 EXPECT_EQ(vPlane.size, copyQuad->v_plane.size);
468 EXPECT_EQ(vPlane.format, copyQuad->v_plane.format); 468 EXPECT_EQ(vPlane.format, copyQuad->v_plane.format);
469 } 469 }
470 470
471 } // namespace 471 } // namespace
472 } // namespace cc 472 } // namespace cc
OLDNEW
« no previous file with comments | « ash/system/user/tray_user.cc ('k') | chrome/browser/ui/extensions/shell_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698