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

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

Issue 2402583005: Split picture layer quads to allow removing more occluded area. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test Created 3 years, 6 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 | « cc/layers/surface_layer_impl_unittest.cc ('k') | cc/layers/ui_resource_layer_impl_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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/layers/texture_layer_impl.h" 5 #include "cc/layers/texture_layer_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "cc/output/compositor_frame_sink.h" 9 #include "cc/output/compositor_frame_sink.h"
10 #include "cc/output/context_provider.h" 10 #include "cc/output/context_provider.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 LayerTestCommon::VerifyQuadsExactlyCoverRect(impl.quad_list(), gfx::Rect()); 93 LayerTestCommon::VerifyQuadsExactlyCoverRect(impl.quad_list(), gfx::Rect());
94 EXPECT_EQ(impl.quad_list().size(), 0u); 94 EXPECT_EQ(impl.quad_list().size(), 0u);
95 } 95 }
96 96
97 { 97 {
98 SCOPED_TRACE("Partial occlusion"); 98 SCOPED_TRACE("Partial occlusion");
99 gfx::Rect occluded(200, 0, 800, 1000); 99 gfx::Rect occluded(200, 0, 800, 1000);
100 impl.AppendQuadsWithOcclusion(texture_layer_impl, occluded); 100 impl.AppendQuadsWithOcclusion(texture_layer_impl, occluded);
101 101
102 size_t partially_occluded_count = 0; 102 size_t partially_occluded_count = 0;
103 LayerTestCommon::VerifyQuadsAreOccluded( 103 LayerTestCommon::VerifyQuadsAreOccluded(impl.quad_list(), occluded, false,
104 impl.quad_list(), occluded, &partially_occluded_count); 104 &partially_occluded_count);
105 // The layer outputs one quad, which is partially occluded. 105 // The layer outputs one quad, which is partially occluded.
106 EXPECT_EQ(1u, impl.quad_list().size()); 106 EXPECT_EQ(1u, impl.quad_list().size());
107 EXPECT_EQ(1u, partially_occluded_count); 107 EXPECT_EQ(1u, partially_occluded_count);
108 } 108 }
109 } 109 }
110 110
111 TEST(TextureLayerImplTest, OutputIsSecure) { 111 TEST(TextureLayerImplTest, OutputIsSecure) {
112 gfx::Size layer_size(1000, 1000); 112 gfx::Size layer_size(1000, 1000);
113 gfx::Size viewport_size(1000, 1000); 113 gfx::Size viewport_size(1000, 1000);
114 114
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 // Toggling the gpu rasterization clears all tilings on both trees. 187 // Toggling the gpu rasterization clears all tilings on both trees.
188 impl.host_impl()->SetHasGpuRasterizationTrigger(true); 188 impl.host_impl()->SetHasGpuRasterizationTrigger(true);
189 impl.host_impl()->SetContentIsSuitableForGpuRasterization(true); 189 impl.host_impl()->SetContentIsSuitableForGpuRasterization(true);
190 impl.host_impl()->CommitComplete(); 190 impl.host_impl()->CommitComplete();
191 EXPECT_TRUE(impl.host_impl()->use_gpu_rasterization()); 191 EXPECT_TRUE(impl.host_impl()->use_gpu_rasterization());
192 EXPECT_FALSE(released); 192 EXPECT_FALSE(released);
193 } 193 }
194 194
195 } // namespace 195 } // namespace
196 } // namespace cc 196 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/surface_layer_impl_unittest.cc ('k') | cc/layers/ui_resource_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698