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

Side by Side Diff: cc/layers/scrollbar_layer_unittest.cc

Issue 195803003: cc: Remove OverdrawMetrics and --trace-overdraw flag. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rm-overdraw: switches Created 6 years, 9 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 | « cc/layers/picture_layer_unittest.cc ('k') | cc/layers/tiled_layer.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 "base/containers/hash_tables.h" 5 #include "base/containers/hash_tables.h"
6 #include "cc/animation/scrollbar_animation_controller.h" 6 #include "cc/animation/scrollbar_animation_controller.h"
7 #include "cc/layers/append_quads_data.h" 7 #include "cc/layers/append_quads_data.h"
8 #include "cc/layers/painted_scrollbar_layer.h" 8 #include "cc/layers/painted_scrollbar_layer.h"
9 #include "cc/layers/painted_scrollbar_layer_impl.h" 9 #include "cc/layers/painted_scrollbar_layer_impl.h"
10 #include "cc/layers/scrollbar_layer_interface.h" 10 #include "cc/layers/scrollbar_layer_interface.h"
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 scrollbar_layer->draw_properties().content_bounds = gfx::Size(100, 200); 645 scrollbar_layer->draw_properties().content_bounds = gfx::Size(100, 200);
646 scrollbar_layer->draw_properties().visible_content_rect = 646 scrollbar_layer->draw_properties().visible_content_rect =
647 gfx::Rect(0, 0, 100, 200); 647 gfx::Rect(0, 0, 100, 200);
648 scrollbar_layer->CreateRenderSurface(); 648 scrollbar_layer->CreateRenderSurface();
649 scrollbar_layer->draw_properties().render_target = scrollbar_layer.get(); 649 scrollbar_layer->draw_properties().render_target = scrollbar_layer.get();
650 650
651 testing::Mock::VerifyAndClearExpectations(layer_tree_host_.get()); 651 testing::Mock::VerifyAndClearExpectations(layer_tree_host_.get());
652 EXPECT_EQ(scrollbar_layer->layer_tree_host(), layer_tree_host_.get()); 652 EXPECT_EQ(scrollbar_layer->layer_tree_host(), layer_tree_host_.get());
653 653
654 ResourceUpdateQueue queue; 654 ResourceUpdateQueue queue;
655 OcclusionTracker<Layer> occlusion_tracker(gfx::Rect(), false); 655 gfx::Rect screen_space_clip_rect;
656 OcclusionTracker<Layer> occlusion_tracker(screen_space_clip_rect);
656 657
657 scrollbar_layer->SavePaintProperties(); 658 scrollbar_layer->SavePaintProperties();
658 for (int update_counter = 0; update_counter < num_updates; update_counter++) 659 for (int update_counter = 0; update_counter < num_updates; update_counter++)
659 scrollbar_layer->Update(&queue, &occlusion_tracker); 660 scrollbar_layer->Update(&queue, &occlusion_tracker);
660 661
661 // A non-solid-color scrollbar should have requested two textures. 662 // A non-solid-color scrollbar should have requested two textures.
662 EXPECT_EQ(expected_resources, layer_tree_host_->UIResourceCount()); 663 EXPECT_EQ(expected_resources, layer_tree_host_->UIResourceCount());
663 EXPECT_EQ(expected_created, layer_tree_host_->TotalUIResourceCreated()); 664 EXPECT_EQ(expected_created, layer_tree_host_->TotalUIResourceCreated());
664 EXPECT_EQ(expected_deleted, layer_tree_host_->TotalUIResourceDeleted()); 665 EXPECT_EQ(expected_deleted, layer_tree_host_->TotalUIResourceDeleted());
665 666
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
731 scaled_location.y(), 732 scaled_location.y(),
732 scaled_size.width(), 733 scaled_size.width(),
733 scaled_size.height()); 734 scaled_size.height());
734 scrollbar_layer->CreateRenderSurface(); 735 scrollbar_layer->CreateRenderSurface();
735 scrollbar_layer->draw_properties().render_target = scrollbar_layer.get(); 736 scrollbar_layer->draw_properties().render_target = scrollbar_layer.get();
736 737
737 testing::Mock::VerifyAndClearExpectations(layer_tree_host_.get()); 738 testing::Mock::VerifyAndClearExpectations(layer_tree_host_.get());
738 EXPECT_EQ(scrollbar_layer->layer_tree_host(), layer_tree_host_.get()); 739 EXPECT_EQ(scrollbar_layer->layer_tree_host(), layer_tree_host_.get());
739 740
740 ResourceUpdateQueue queue; 741 ResourceUpdateQueue queue;
741 OcclusionTracker<Layer> occlusion_tracker(gfx::Rect(), false); 742 gfx::Rect screen_space_clip_rect;
743 OcclusionTracker<Layer> occlusion_tracker(screen_space_clip_rect);
742 scrollbar_layer->SavePaintProperties(); 744 scrollbar_layer->SavePaintProperties();
743 scrollbar_layer->Update(&queue, &occlusion_tracker); 745 scrollbar_layer->Update(&queue, &occlusion_tracker);
744 746
745 // Verify that we have not generated any content uploads that are larger 747 // Verify that we have not generated any content uploads that are larger
746 // than their destination textures. 748 // than their destination textures.
747 749
748 gfx::Size track_size = layer_tree_host_->ui_resource_size( 750 gfx::Size track_size = layer_tree_host_->ui_resource_size(
749 scrollbar_layer->track_resource_id()); 751 scrollbar_layer->track_resource_id());
750 gfx::Size thumb_size = layer_tree_host_->ui_resource_size( 752 gfx::Size thumb_size = layer_tree_host_->ui_resource_size(
751 scrollbar_layer->thumb_resource_id()); 753 scrollbar_layer->thumb_resource_id());
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 gfx::Size(scaled_size.width(), scaled_size.height()); 809 gfx::Size(scaled_size.width(), scaled_size.height());
808 scrollbar_layer->draw_properties().contents_scale_x = test_scale; 810 scrollbar_layer->draw_properties().contents_scale_x = test_scale;
809 scrollbar_layer->draw_properties().contents_scale_y = test_scale; 811 scrollbar_layer->draw_properties().contents_scale_y = test_scale;
810 scrollbar_layer->draw_properties().visible_content_rect = 812 scrollbar_layer->draw_properties().visible_content_rect =
811 gfx::Rect(scaled_location.x(), 813 gfx::Rect(scaled_location.x(),
812 scaled_location.y(), 814 scaled_location.y(),
813 scaled_size.width(), 815 scaled_size.width(),
814 scaled_size.height()); 816 scaled_size.height());
815 817
816 ResourceUpdateQueue queue; 818 ResourceUpdateQueue queue;
817 OcclusionTracker<Layer> occlusion_tracker(gfx::Rect(), false); 819 gfx::Rect screen_space_clip_rect;
820 OcclusionTracker<Layer> occlusion_tracker(screen_space_clip_rect);
818 scrollbar_layer->SavePaintProperties(); 821 scrollbar_layer->SavePaintProperties();
819 822
820 scrollbar_layer->Update(&queue, &occlusion_tracker); 823 scrollbar_layer->Update(&queue, &occlusion_tracker);
821 824
822 UIResourceBitmap* bitmap = layer_tree_host_->ui_resource_bitmap( 825 UIResourceBitmap* bitmap = layer_tree_host_->ui_resource_bitmap(
823 scrollbar_layer->track_resource_id()); 826 scrollbar_layer->track_resource_id());
824 827
825 DCHECK(bitmap); 828 DCHECK(bitmap);
826 829
827 AutoLockUIResourceBitmap locked_bitmap(*bitmap); 830 AutoLockUIResourceBitmap locked_bitmap(*bitmap);
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
868 TestScale(gfx::Rect(1240, 0, 15, 1333), 2.7754839f); 871 TestScale(gfx::Rect(1240, 0, 15, 1333), 2.7754839f);
869 TestScale(gfx::Rect(1240, 0, 15, 677), 2.46677136f); 872 TestScale(gfx::Rect(1240, 0, 15, 677), 2.46677136f);
870 873
871 // Horizontal Scrollbars. 874 // Horizontal Scrollbars.
872 TestScale(gfx::Rect(0, 1240, 1333, 15), 2.7754839f); 875 TestScale(gfx::Rect(0, 1240, 1333, 15), 2.7754839f);
873 TestScale(gfx::Rect(0, 1240, 677, 15), 2.46677136f); 876 TestScale(gfx::Rect(0, 1240, 677, 15), 2.46677136f);
874 } 877 }
875 878
876 } // namespace 879 } // namespace
877 } // namespace cc 880 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_unittest.cc ('k') | cc/layers/tiled_layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698