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

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

Issue 659683002: Include mask texture size in RenderPassDrawQuad (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@update_mask_draw_quad_test
Patch Set: No ToEnclosedRect Created 6 years, 2 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/tiled_layer_impl.cc ('k') | cc/output/gl_renderer.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/layers/tiled_layer_impl.h" 5 #include "cc/layers/tiled_layer_impl.h"
6 6
7 #include "cc/layers/append_quads_data.h" 7 #include "cc/layers/append_quads_data.h"
8 #include "cc/quads/tile_draw_quad.h" 8 #include "cc/quads/tile_draw_quad.h"
9 #include "cc/resources/layer_tiling_data.h" 9 #include "cc/resources/layer_tiling_data.h"
10 #include "cc/test/fake_impl_proxy.h" 10 #include "cc/test/fake_impl_proxy.h"
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 297
298 EXPECT_EQ(layer->GPUMemoryUsageInBytes(), 0u); 298 EXPECT_EQ(layer->GPUMemoryUsageInBytes(), 0u);
299 } 299 }
300 300
301 TEST_F(TiledLayerImplTest, EmptyMask) { 301 TEST_F(TiledLayerImplTest, EmptyMask) {
302 gfx::Size tile_size(20, 20); 302 gfx::Size tile_size(20, 20);
303 gfx::Size layer_size(0, 0); 303 gfx::Size layer_size(0, 0);
304 scoped_ptr<TiledLayerImpl> layer = 304 scoped_ptr<TiledLayerImpl> layer =
305 CreateLayer(tile_size, layer_size, LayerTilingData::NO_BORDER_TEXELS); 305 CreateLayer(tile_size, layer_size, LayerTilingData::NO_BORDER_TEXELS);
306 306
307 EXPECT_EQ(0u, layer->ContentsResourceId()); 307 ResourceProvider::ResourceId mask_resource_id;
308 gfx::Size mask_texture_size;
309 layer->GetContentsResourceId(&mask_resource_id, &mask_texture_size);
310 EXPECT_EQ(0u, mask_resource_id);
308 EXPECT_EQ(0, layer->TilingForTesting()->num_tiles_x()); 311 EXPECT_EQ(0, layer->TilingForTesting()->num_tiles_x());
309 EXPECT_EQ(0, layer->TilingForTesting()->num_tiles_y()); 312 EXPECT_EQ(0, layer->TilingForTesting()->num_tiles_y());
310 } 313 }
311 314
312 TEST_F(TiledLayerImplTest, Occlusion) { 315 TEST_F(TiledLayerImplTest, Occlusion) {
313 gfx::Size tile_size(100, 100); 316 gfx::Size tile_size(100, 100);
314 gfx::Size layer_bounds(1000, 1000); 317 gfx::Size layer_bounds(1000, 1000);
315 gfx::Size viewport_size(1000, 1000); 318 gfx::Size viewport_size(1000, 1000);
316 319
317 LayerTestCommon::LayerImplTest impl; 320 LayerTestCommon::LayerImplTest impl;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 LayerTestCommon::VerifyQuadsAreOccluded( 366 LayerTestCommon::VerifyQuadsAreOccluded(
364 impl.quad_list(), occluded, &partially_occluded_count); 367 impl.quad_list(), occluded, &partially_occluded_count);
365 // The layer outputs one quad, which is partially occluded. 368 // The layer outputs one quad, which is partially occluded.
366 EXPECT_EQ(100u - 10u, impl.quad_list().size()); 369 EXPECT_EQ(100u - 10u, impl.quad_list().size());
367 EXPECT_EQ(10u + 10u, partially_occluded_count); 370 EXPECT_EQ(10u + 10u, partially_occluded_count);
368 } 371 }
369 } 372 }
370 373
371 } // namespace 374 } // namespace
372 } // namespace cc 375 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/tiled_layer_impl.cc ('k') | cc/output/gl_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698