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

Side by Side Diff: cc/trees/quad_culler_unittest.cc

Issue 191123002: Implement hidpi and pinch-zoom scaling of filter params in cc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes 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
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/trees/quad_culler.h" 5 #include "cc/trees/quad_culler.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "cc/base/math_util.h" 9 #include "cc/base/math_util.h"
10 #include "cc/debug/overdraw_metrics.h" 10 #include "cc/debug/overdraw_metrics.h"
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 scoped_ptr<RenderPassDrawQuad> pass_quad = RenderPassDrawQuad::Create(); 808 scoped_ptr<RenderPassDrawQuad> pass_quad = RenderPassDrawQuad::Create();
809 pass_quad->SetNew(sqs, 809 pass_quad->SetNew(sqs,
810 gfx::Rect(100, 100), 810 gfx::Rect(100, 100),
811 gfx::Rect(100, 100), 811 gfx::Rect(100, 100),
812 RenderPass::Id(10, 10), 812 RenderPass::Id(10, 10),
813 false, 813 false,
814 0, 814 0,
815 gfx::Rect(), 815 gfx::Rect(),
816 gfx::RectF(), 816 gfx::RectF(),
817 FilterOperations(), 817 FilterOperations(),
818 gfx::Vector2dF(),
818 FilterOperations()); 819 FilterOperations());
819 820
820 scoped_ptr<RenderPassDrawQuad> replica_quad = RenderPassDrawQuad::Create(); 821 scoped_ptr<RenderPassDrawQuad> replica_quad = RenderPassDrawQuad::Create();
821 replica_quad->SetNew(sqs, 822 replica_quad->SetNew(sqs,
822 gfx::Rect(100, 100), 823 gfx::Rect(100, 100),
823 gfx::Rect(100, 100), 824 gfx::Rect(100, 100),
824 RenderPass::Id(10, 10), 825 RenderPass::Id(10, 10),
825 true, 826 true,
826 0, 827 0,
827 gfx::Rect(), 828 gfx::Rect(),
828 gfx::RectF(), 829 gfx::RectF(),
829 FilterOperations(), 830 FilterOperations(),
831 gfx::Vector2dF(),
830 FilterOperations()); 832 FilterOperations());
831 833
832 // Set a visible rect on the quads. 834 // Set a visible rect on the quads.
833 color_quad->visible_rect = gfx::Rect(20, 30, 10, 11); 835 color_quad->visible_rect = gfx::Rect(20, 30, 10, 11);
834 pass_quad->visible_rect = gfx::Rect(50, 60, 13, 14); 836 pass_quad->visible_rect = gfx::Rect(50, 60, 13, 14);
835 replica_quad->visible_rect = gfx::Rect(30, 40, 15, 16); 837 replica_quad->visible_rect = gfx::Rect(30, 40, 15, 16);
836 838
837 // Nothing is occluding. 839 // Nothing is occluding.
838 occlusion_tracker.EnterLayer(it); 840 occlusion_tracker.EnterLayer(it);
839 841
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 scoped_ptr<RenderPassDrawQuad> pass_quad = RenderPassDrawQuad::Create(); 889 scoped_ptr<RenderPassDrawQuad> pass_quad = RenderPassDrawQuad::Create();
888 pass_quad->SetNew(sqs, 890 pass_quad->SetNew(sqs,
889 gfx::Rect(100, 100), 891 gfx::Rect(100, 100),
890 gfx::Rect(100, 100), 892 gfx::Rect(100, 100),
891 RenderPass::Id(10, 10), 893 RenderPass::Id(10, 10),
892 false, 894 false,
893 0, 895 0,
894 gfx::Rect(), 896 gfx::Rect(),
895 gfx::RectF(), 897 gfx::RectF(),
896 FilterOperations(), 898 FilterOperations(),
899 gfx::Vector2dF(),
897 FilterOperations()); 900 FilterOperations());
898 901
899 scoped_ptr<RenderPassDrawQuad> replica_quad = RenderPassDrawQuad::Create(); 902 scoped_ptr<RenderPassDrawQuad> replica_quad = RenderPassDrawQuad::Create();
900 replica_quad->SetNew(sqs, 903 replica_quad->SetNew(sqs,
901 gfx::Rect(100, 100), 904 gfx::Rect(100, 100),
902 gfx::Rect(100, 100), 905 gfx::Rect(100, 100),
903 RenderPass::Id(10, 10), 906 RenderPass::Id(10, 10),
904 true, 907 true,
905 0, 908 0,
906 gfx::Rect(), 909 gfx::Rect(),
907 gfx::RectF(), 910 gfx::RectF(),
908 FilterOperations(), 911 FilterOperations(),
912 gfx::Vector2dF(),
909 FilterOperations()); 913 FilterOperations());
910 914
911 // Set a visible rect on the quads. 915 // Set a visible rect on the quads.
912 color_quad->visible_rect = gfx::Rect(10, 10, 10, 11); 916 color_quad->visible_rect = gfx::Rect(10, 10, 10, 11);
913 pass_quad->visible_rect = gfx::Rect(10, 20, 13, 14); 917 pass_quad->visible_rect = gfx::Rect(10, 20, 13, 14);
914 replica_quad->visible_rect = gfx::Rect(10, 30, 15, 16); 918 replica_quad->visible_rect = gfx::Rect(10, 30, 15, 16);
915 919
916 // Occlude the left part of the visible rects. 920 // Occlude the left part of the visible rects.
917 occlusion_tracker.EnterLayer(it); 921 occlusion_tracker.EnterLayer(it);
918 occlusion_tracker.set_occlusion_from_outside_target(gfx::Rect(0, 0, 15, 100)); 922 occlusion_tracker.set_occlusion_from_outside_target(gfx::Rect(0, 0, 15, 100));
(...skipping 12 matching lines...) Expand all
931 EXPECT_EQ(gfx::Rect(15, 10, 5, 11).ToString(), 935 EXPECT_EQ(gfx::Rect(15, 10, 5, 11).ToString(),
932 quad_list[0]->visible_rect.ToString()); 936 quad_list[0]->visible_rect.ToString());
933 EXPECT_EQ(gfx::Rect(15, 20, 8, 14).ToString(), 937 EXPECT_EQ(gfx::Rect(15, 20, 8, 14).ToString(),
934 quad_list[1]->visible_rect.ToString()); 938 quad_list[1]->visible_rect.ToString());
935 EXPECT_EQ(gfx::Rect(15, 30, 10, 16).ToString(), 939 EXPECT_EQ(gfx::Rect(15, 30, 10, 16).ToString(),
936 quad_list[2]->visible_rect.ToString()); 940 quad_list[2]->visible_rect.ToString());
937 } 941 }
938 942
939 } // namespace 943 } // namespace
940 } // namespace cc 944 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698