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

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

Issue 137853021: cc: Add test for TiledLayerImpl mask with no resource (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | « no previous file | no next file » | 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 static_cast<size_t>(3 * 4 * tile_size.width() * tile_size.height())); 297 static_cast<size_t>(3 * 4 * tile_size.width() * tile_size.height()));
298 298
299 ResourceProvider::ResourceId empty_resource(0); 299 ResourceProvider::ResourceId empty_resource(0);
300 layer->PushTileProperties(0, 1, empty_resource, gfx::Rect(0, 0, 1, 1), false); 300 layer->PushTileProperties(0, 1, empty_resource, gfx::Rect(0, 0, 1, 1), false);
301 layer->PushTileProperties(2, 3, empty_resource, gfx::Rect(0, 0, 1, 1), false); 301 layer->PushTileProperties(2, 3, empty_resource, gfx::Rect(0, 0, 1, 1), false);
302 layer->PushTileProperties(2, 0, empty_resource, gfx::Rect(0, 0, 1, 1), false); 302 layer->PushTileProperties(2, 0, empty_resource, gfx::Rect(0, 0, 1, 1), false);
303 303
304 EXPECT_EQ(layer->GPUMemoryUsageInBytes(), 0u); 304 EXPECT_EQ(layer->GPUMemoryUsageInBytes(), 0u);
305 } 305 }
306 306
307 TEST_F(TiledLayerImplTest, EmptyMask) {
308 gfx::Size tile_size(20, 20);
309 gfx::Size layer_size(0, 0);
310 scoped_ptr<TiledLayerImpl> layer =
311 CreateLayer(tile_size, layer_size, LayerTilingData::NO_BORDER_TEXELS);
312
313 EXPECT_EQ(0u, layer->ContentsResourceId());
314 EXPECT_EQ(0, layer->TilingForTesting()->num_tiles_x());
315 EXPECT_EQ(0, layer->TilingForTesting()->num_tiles_y());
316 }
317
307 } // namespace 318 } // namespace
308 } // namespace cc 319 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698