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

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

Issue 1357423009: gfx: Make conversions from Size to SizeF be explicit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
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/picture_layer_impl.h" 5 #include "cc/layers/picture_layer_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 1544 matching lines...) Expand 10 before | Expand all | Expand 10 after
1555 static_cast<FakePictureLayerImpl*>(active_layer_->mask_layer()); 1555 static_cast<FakePictureLayerImpl*>(active_layer_->mask_layer());
1556 1556
1557 // Mask layers have a tiling with a single tile in it. 1557 // Mask layers have a tiling with a single tile in it.
1558 EXPECT_EQ(1u, active_mask->HighResTiling()->AllTilesForTesting().size()); 1558 EXPECT_EQ(1u, active_mask->HighResTiling()->AllTilesForTesting().size());
1559 // The mask resource exists. 1559 // The mask resource exists.
1560 ResourceId mask_resource_id; 1560 ResourceId mask_resource_id;
1561 gfx::Size mask_texture_size; 1561 gfx::Size mask_texture_size;
1562 active_mask->GetContentsResourceId(&mask_resource_id, &mask_texture_size); 1562 active_mask->GetContentsResourceId(&mask_resource_id, &mask_texture_size);
1563 EXPECT_NE(0u, mask_resource_id); 1563 EXPECT_NE(0u, mask_resource_id);
1564 gfx::Size expected_mask_texture_size = 1564 gfx::Size expected_mask_texture_size =
1565 gfx::ToCeiledSize(gfx::ScaleSize(active_mask->bounds(), 1.3f)); 1565 gfx::ScaleToCeiledSize(active_mask->bounds(), 1.3f);
1566 EXPECT_EQ(mask_texture_size, expected_mask_texture_size); 1566 EXPECT_EQ(mask_texture_size, expected_mask_texture_size);
1567 } 1567 }
1568 1568
1569 TEST_F(PictureLayerImplTest, ReleaseResources) { 1569 TEST_F(PictureLayerImplTest, ReleaseResources) {
1570 gfx::Size tile_size(400, 400); 1570 gfx::Size tile_size(400, 400);
1571 gfx::Size layer_bounds(1300, 1900); 1571 gfx::Size layer_bounds(1300, 1900);
1572 1572
1573 scoped_refptr<FakePicturePileImpl> pending_pile = 1573 scoped_refptr<FakePicturePileImpl> pending_pile =
1574 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds); 1574 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds);
1575 scoped_refptr<FakePicturePileImpl> active_pile = 1575 scoped_refptr<FakePicturePileImpl> active_pile =
(...skipping 3587 matching lines...) Expand 10 before | Expand all | Expand 10 after
5163 // New low res tiling. 5163 // New low res tiling.
5164 EXPECT_TRUE(tilings->tiling_at(2)->may_contain_low_resolution_tiles()); 5164 EXPECT_TRUE(tilings->tiling_at(2)->may_contain_low_resolution_tiles());
5165 5165
5166 // This tiling will be high res now, it won't contain low res content since it 5166 // This tiling will be high res now, it won't contain low res content since it
5167 // was all destroyed. 5167 // was all destroyed.
5168 EXPECT_FALSE(tilings->tiling_at(1)->may_contain_low_resolution_tiles()); 5168 EXPECT_FALSE(tilings->tiling_at(1)->may_contain_low_resolution_tiles());
5169 } 5169 }
5170 5170
5171 } // namespace 5171 } // namespace
5172 } // namespace cc 5172 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698