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

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

Issue 793573006: Refactoring for merging ManagedTileState into Tile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix a nit Created 6 years 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/picture_layer_impl.cc ('k') | cc/resources/managed_tile_state.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/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 1673 matching lines...) Expand 10 before | Expand all | Expand 10 after
1684 int num_outside = 0; 1684 int num_outside = 0;
1685 for (PictureLayerTiling::CoverageIterator iter( 1685 for (PictureLayerTiling::CoverageIterator iter(
1686 pending_layer_->HighResTiling(), 1.f, gfx::Rect(layer_bounds)); 1686 pending_layer_->HighResTiling(), 1.f, gfx::Rect(layer_bounds));
1687 iter; ++iter) { 1687 iter; ++iter) {
1688 if (!*iter) 1688 if (!*iter)
1689 continue; 1689 continue;
1690 Tile* tile = *iter; 1690 Tile* tile = *iter;
1691 if (viewport_for_tile_priority.Intersects(iter.geometry_rect())) { 1691 if (viewport_for_tile_priority.Intersects(iter.geometry_rect())) {
1692 num_inside++; 1692 num_inside++;
1693 // Mark everything in viewport for tile priority as ready to draw. 1693 // Mark everything in viewport for tile priority as ready to draw.
1694 ManagedTileState::DrawInfo& draw_info = tile->draw_info(); 1694 TileDrawInfo& draw_info = tile->draw_info();
1695 draw_info.SetSolidColorForTesting(SK_ColorRED); 1695 draw_info.SetSolidColorForTesting(SK_ColorRED);
1696 } else { 1696 } else {
1697 num_outside++; 1697 num_outside++;
1698 EXPECT_FALSE(tile->required_for_activation()); 1698 EXPECT_FALSE(tile->required_for_activation());
1699 } 1699 }
1700 } 1700 }
1701 1701
1702 EXPECT_GT(num_inside, 0); 1702 EXPECT_GT(num_inside, 0);
1703 EXPECT_GT(num_outside, 0); 1703 EXPECT_GT(num_outside, 0);
1704 1704
(...skipping 1124 matching lines...) Expand 10 before | Expand all | Expand 10 after
2829 pending_layer_->draw_properties().visible_content_rect = 2829 pending_layer_->draw_properties().visible_content_rect =
2830 gfx::Rect(0, 0, 500, 500); 2830 gfx::Rect(0, 0, 500, 500);
2831 pending_layer_->UpdateTiles(Occlusion(), resourceless_software_draw); 2831 pending_layer_->UpdateTiles(Occlusion(), resourceless_software_draw);
2832 2832
2833 std::vector<Tile*> high_res_tiles = 2833 std::vector<Tile*> high_res_tiles =
2834 pending_layer_->HighResTiling()->AllTilesForTesting(); 2834 pending_layer_->HighResTiling()->AllTilesForTesting();
2835 for (std::vector<Tile*>::iterator tile_it = high_res_tiles.begin(); 2835 for (std::vector<Tile*>::iterator tile_it = high_res_tiles.begin();
2836 tile_it != high_res_tiles.end(); 2836 tile_it != high_res_tiles.end();
2837 ++tile_it) { 2837 ++tile_it) {
2838 Tile* tile = *tile_it; 2838 Tile* tile = *tile_it;
2839 ManagedTileState::DrawInfo& draw_info = tile->draw_info(); 2839 TileDrawInfo& draw_info = tile->draw_info();
2840 draw_info.SetSolidColorForTesting(SK_ColorRED); 2840 draw_info.SetSolidColorForTesting(SK_ColorRED);
2841 } 2841 }
2842 2842
2843 non_ideal_tile_count = 0; 2843 non_ideal_tile_count = 0;
2844 low_res_tile_count = 0; 2844 low_res_tile_count = 0;
2845 high_res_tile_count = 0; 2845 high_res_tile_count = 0;
2846 queue = pending_layer_->CreateRasterQueue(true); 2846 queue = pending_layer_->CreateRasterQueue(true);
2847 while (!queue->IsEmpty()) { 2847 while (!queue->IsEmpty()) {
2848 Tile* tile = queue->Top(); 2848 Tile* tile = queue->Top();
2849 TilePriority priority = tile->priority(PENDING_TREE); 2849 TilePriority priority = tile->priority(PENDING_TREE);
(...skipping 1880 matching lines...) Expand 10 before | Expand all | Expand 10 after
4730 result = layer->CalculateTileSize(gfx::Size(447, 400)); 4730 result = layer->CalculateTileSize(gfx::Size(447, 400));
4731 EXPECT_EQ(result.width(), 448); 4731 EXPECT_EQ(result.width(), 448);
4732 EXPECT_EQ(result.height(), 448); 4732 EXPECT_EQ(result.height(), 448);
4733 result = layer->CalculateTileSize(gfx::Size(500, 499)); 4733 result = layer->CalculateTileSize(gfx::Size(500, 499));
4734 EXPECT_EQ(result.width(), 512); 4734 EXPECT_EQ(result.width(), 512);
4735 EXPECT_EQ(result.height(), 500 + 2); 4735 EXPECT_EQ(result.height(), 500 + 2);
4736 } 4736 }
4737 4737
4738 } // namespace 4738 } // namespace
4739 } // namespace cc 4739 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl.cc ('k') | cc/resources/managed_tile_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698