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

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

Issue 1175113010: cc: Rename visible_content_rect and content stuff on quads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename-visible-content-rect: moreandroid Created 5 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/texture_layer_unittest.cc ('k') | cc/layers/video_layer_impl.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/append_quads_data.h" 5 #include "cc/layers/append_quads_data.h"
6 #include "cc/layers/ui_resource_layer_impl.h" 6 #include "cc/layers/ui_resource_layer_impl.h"
7 #include "cc/quads/draw_quad.h" 7 #include "cc/quads/draw_quad.h"
8 #include "cc/resources/ui_resource_bitmap.h" 8 #include "cc/resources/ui_resource_bitmap.h"
9 #include "cc/resources/ui_resource_client.h" 9 #include "cc/resources/ui_resource_client.h"
10 #include "cc/test/fake_impl_proxy.h" 10 #include "cc/test/fake_impl_proxy.h"
(...skipping 10 matching lines...) Expand all
21 21
22 namespace cc { 22 namespace cc {
23 namespace { 23 namespace {
24 24
25 scoped_ptr<UIResourceLayerImpl> GenerateUIResourceLayer( 25 scoped_ptr<UIResourceLayerImpl> GenerateUIResourceLayer(
26 FakeUIResourceLayerTreeHostImpl* host_impl, 26 FakeUIResourceLayerTreeHostImpl* host_impl,
27 const gfx::Size& bitmap_size, 27 const gfx::Size& bitmap_size,
28 const gfx::Size& layer_size, 28 const gfx::Size& layer_size,
29 bool opaque, 29 bool opaque,
30 UIResourceId uid) { 30 UIResourceId uid) {
31 gfx::Rect visible_content_rect(layer_size); 31 gfx::Rect visible_layer_rect(layer_size);
32 scoped_ptr<UIResourceLayerImpl> layer = 32 scoped_ptr<UIResourceLayerImpl> layer =
33 UIResourceLayerImpl::Create(host_impl->active_tree(), 1); 33 UIResourceLayerImpl::Create(host_impl->active_tree(), 1);
34 layer->draw_properties().visible_content_rect = visible_content_rect; 34 layer->draw_properties().visible_layer_rect = visible_layer_rect;
35 layer->SetBounds(layer_size); 35 layer->SetBounds(layer_size);
36 layer->SetHasRenderSurface(true); 36 layer->SetHasRenderSurface(true);
37 layer->draw_properties().render_target = layer.get(); 37 layer->draw_properties().render_target = layer.get();
38 38
39 UIResourceBitmap bitmap(bitmap_size, opaque); 39 UIResourceBitmap bitmap(bitmap_size, opaque);
40 40
41 host_impl->CreateUIResource(uid, bitmap); 41 host_impl->CreateUIResource(uid, bitmap);
42 layer->SetUIResourceId(uid); 42 layer->SetUIResourceId(uid);
43 43
44 return layer.Pass(); 44 return layer.Pass();
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 gfx::Rect occluded; 183 gfx::Rect occluded;
184 impl.AppendQuadsWithOcclusion(ui_resource_layer_impl, occluded); 184 impl.AppendQuadsWithOcclusion(ui_resource_layer_impl, occluded);
185 185
186 LayerTestCommon::VerifyQuadsExactlyCoverRect(impl.quad_list(), 186 LayerTestCommon::VerifyQuadsExactlyCoverRect(impl.quad_list(),
187 gfx::Rect(layer_size)); 187 gfx::Rect(layer_size));
188 EXPECT_EQ(1u, impl.quad_list().size()); 188 EXPECT_EQ(1u, impl.quad_list().size());
189 } 189 }
190 190
191 { 191 {
192 SCOPED_TRACE("Full occlusion"); 192 SCOPED_TRACE("Full occlusion");
193 gfx::Rect occluded(ui_resource_layer_impl->visible_content_rect()); 193 gfx::Rect occluded(ui_resource_layer_impl->visible_layer_rect());
194 impl.AppendQuadsWithOcclusion(ui_resource_layer_impl, occluded); 194 impl.AppendQuadsWithOcclusion(ui_resource_layer_impl, occluded);
195 195
196 LayerTestCommon::VerifyQuadsExactlyCoverRect(impl.quad_list(), gfx::Rect()); 196 LayerTestCommon::VerifyQuadsExactlyCoverRect(impl.quad_list(), gfx::Rect());
197 EXPECT_EQ(impl.quad_list().size(), 0u); 197 EXPECT_EQ(impl.quad_list().size(), 0u);
198 } 198 }
199 199
200 { 200 {
201 SCOPED_TRACE("Partial occlusion"); 201 SCOPED_TRACE("Partial occlusion");
202 gfx::Rect occluded(200, 0, 800, 1000); 202 gfx::Rect occluded(200, 0, 800, 1000);
203 impl.AppendQuadsWithOcclusion(ui_resource_layer_impl, occluded); 203 impl.AppendQuadsWithOcclusion(ui_resource_layer_impl, occluded);
204 204
205 size_t partially_occluded_count = 0; 205 size_t partially_occluded_count = 0;
206 LayerTestCommon::VerifyQuadsAreOccluded( 206 LayerTestCommon::VerifyQuadsAreOccluded(
207 impl.quad_list(), occluded, &partially_occluded_count); 207 impl.quad_list(), occluded, &partially_occluded_count);
208 // The layer outputs one quad, which is partially occluded. 208 // The layer outputs one quad, which is partially occluded.
209 EXPECT_EQ(1u, impl.quad_list().size()); 209 EXPECT_EQ(1u, impl.quad_list().size());
210 EXPECT_EQ(1u, partially_occluded_count); 210 EXPECT_EQ(1u, partially_occluded_count);
211 } 211 }
212 } 212 }
213 213
214 } // namespace 214 } // namespace
215 } // namespace cc 215 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/texture_layer_unittest.cc ('k') | cc/layers/video_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698