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

Side by Side Diff: cc/quads/draw_quad_unittest.cc

Issue 2379653006: Replaced cc::SurfaceId::nonce_ with base::UnguessableToken (Closed)
Patch Set: Changed SurfaceManager::kRootSurfaceId to a private field to avoid static initialization Created 4 years, 1 month 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 | « cc/layers/surface_layer_unittest.cc ('k') | cc/surfaces/display_scheduler_unittest.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 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/quads/draw_quad.h" 5 #include "cc/quads/draw_quad.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 CREATE_QUAD_3_ALL(StreamVideoDrawQuad, resource_id, resource_size_in_pixels, 517 CREATE_QUAD_3_ALL(StreamVideoDrawQuad, resource_id, resource_size_in_pixels,
518 matrix); 518 matrix);
519 EXPECT_EQ(DrawQuad::STREAM_VIDEO_CONTENT, copy_quad->material); 519 EXPECT_EQ(DrawQuad::STREAM_VIDEO_CONTENT, copy_quad->material);
520 EXPECT_EQ(resource_id, copy_quad->resource_id()); 520 EXPECT_EQ(resource_id, copy_quad->resource_id());
521 EXPECT_EQ(resource_size_in_pixels, copy_quad->resource_size_in_pixels()); 521 EXPECT_EQ(resource_size_in_pixels, copy_quad->resource_size_in_pixels());
522 EXPECT_EQ(matrix, copy_quad->matrix); 522 EXPECT_EQ(matrix, copy_quad->matrix);
523 } 523 }
524 524
525 TEST(DrawQuadTest, CopySurfaceDrawQuad) { 525 TEST(DrawQuadTest, CopySurfaceDrawQuad) {
526 gfx::Rect visible_rect(40, 50, 30, 20); 526 gfx::Rect visible_rect(40, 50, 30, 20);
527 SurfaceId surface_id(kArbitraryFrameSinkId, LocalFrameId(1234, 0)); 527 SurfaceId surface_id(kArbitraryFrameSinkId,
528 LocalFrameId(1234, base::UnguessableToken::Create()));
528 CREATE_SHARED_STATE(); 529 CREATE_SHARED_STATE();
529 530
530 CREATE_QUAD_2_NEW(SurfaceDrawQuad, visible_rect, surface_id); 531 CREATE_QUAD_2_NEW(SurfaceDrawQuad, visible_rect, surface_id);
531 EXPECT_EQ(DrawQuad::SURFACE_CONTENT, copy_quad->material); 532 EXPECT_EQ(DrawQuad::SURFACE_CONTENT, copy_quad->material);
532 EXPECT_EQ(visible_rect, copy_quad->visible_rect); 533 EXPECT_EQ(visible_rect, copy_quad->visible_rect);
533 EXPECT_EQ(surface_id, copy_quad->surface_id); 534 EXPECT_EQ(surface_id, copy_quad->surface_id);
534 535
535 CREATE_QUAD_1_ALL(SurfaceDrawQuad, surface_id); 536 CREATE_QUAD_1_ALL(SurfaceDrawQuad, surface_id);
536 EXPECT_EQ(DrawQuad::SURFACE_CONTENT, copy_quad->material); 537 EXPECT_EQ(DrawQuad::SURFACE_CONTENT, copy_quad->material);
537 EXPECT_EQ(surface_id, copy_quad->surface_id); 538 EXPECT_EQ(surface_id, copy_quad->surface_id);
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 CREATE_QUAD_5_NEW(StreamVideoDrawQuad, opaque_rect, visible_rect, resource_id, 807 CREATE_QUAD_5_NEW(StreamVideoDrawQuad, opaque_rect, visible_rect, resource_id,
807 resource_size_in_pixels, matrix); 808 resource_size_in_pixels, matrix);
808 EXPECT_EQ(resource_id, quad_new->resource_id()); 809 EXPECT_EQ(resource_id, quad_new->resource_id());
809 EXPECT_EQ(resource_size_in_pixels, quad_new->resource_size_in_pixels()); 810 EXPECT_EQ(resource_size_in_pixels, quad_new->resource_size_in_pixels());
810 EXPECT_EQ(1, IterateAndCount(quad_new)); 811 EXPECT_EQ(1, IterateAndCount(quad_new));
811 EXPECT_EQ(resource_id + 1, quad_new->resource_id()); 812 EXPECT_EQ(resource_id + 1, quad_new->resource_id());
812 } 813 }
813 814
814 TEST_F(DrawQuadIteratorTest, SurfaceDrawQuad) { 815 TEST_F(DrawQuadIteratorTest, SurfaceDrawQuad) {
815 gfx::Rect visible_rect(40, 50, 30, 20); 816 gfx::Rect visible_rect(40, 50, 30, 20);
816 SurfaceId surface_id(kArbitraryFrameSinkId, LocalFrameId(4321, 0)); 817 SurfaceId surface_id(kArbitraryFrameSinkId,
818 LocalFrameId(4321, base::UnguessableToken::Create()));
817 819
818 CREATE_SHARED_STATE(); 820 CREATE_SHARED_STATE();
819 CREATE_QUAD_2_NEW(SurfaceDrawQuad, visible_rect, surface_id); 821 CREATE_QUAD_2_NEW(SurfaceDrawQuad, visible_rect, surface_id);
820 EXPECT_EQ(0, IterateAndCount(quad_new)); 822 EXPECT_EQ(0, IterateAndCount(quad_new));
821 } 823 }
822 824
823 TEST_F(DrawQuadIteratorTest, TextureDrawQuad) { 825 TEST_F(DrawQuadIteratorTest, TextureDrawQuad) {
824 gfx::Rect opaque_rect(33, 47, 10, 12); 826 gfx::Rect opaque_rect(33, 47, 10, 12);
825 gfx::Rect visible_rect(40, 50, 30, 20); 827 gfx::Rect visible_rect(40, 50, 30, 20);
826 unsigned resource_id = 82; 828 unsigned resource_id = 82;
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
992 LOG(ERROR) << "YUVVideoDrawQuad " << sizeof(YUVVideoDrawQuad); 994 LOG(ERROR) << "YUVVideoDrawQuad " << sizeof(YUVVideoDrawQuad);
993 break; 995 break;
994 case DrawQuad::INVALID: 996 case DrawQuad::INVALID:
995 break; 997 break;
996 } 998 }
997 } 999 }
998 } 1000 }
999 1001
1000 } // namespace 1002 } // namespace
1001 } // namespace cc 1003 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/surface_layer_unittest.cc ('k') | cc/surfaces/display_scheduler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698