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

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

Issue 603683006: cc: Remove low quality mode and cleanup tile versions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update 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/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 1519 matching lines...) Expand 10 before | Expand all | Expand 10 after
1530 for (PictureLayerTiling::CoverageIterator iter( 1530 for (PictureLayerTiling::CoverageIterator iter(
1531 tiling, pending_layer_->contents_scale_x(), gfx::Rect(layer_bounds)); 1531 tiling, pending_layer_->contents_scale_x(), gfx::Rect(layer_bounds));
1532 iter; 1532 iter;
1533 ++iter) { 1533 ++iter) {
1534 if (!*iter) 1534 if (!*iter)
1535 continue; 1535 continue;
1536 Tile* tile = *iter; 1536 Tile* tile = *iter;
1537 if (viewport_for_tile_priority.Intersects(iter.geometry_rect())) { 1537 if (viewport_for_tile_priority.Intersects(iter.geometry_rect())) {
1538 num_inside++; 1538 num_inside++;
1539 // Mark everything in viewport for tile priority as ready to draw. 1539 // Mark everything in viewport for tile priority as ready to draw.
1540 ManagedTileState::TileVersion& tile_version = 1540 ManagedTileState::DrawInfo& draw_info = tile->draw_info();
1541 tile->GetTileVersionForTesting( 1541 draw_info.SetSolidColorForTesting(SK_ColorRED);
1542 tile->DetermineRasterModeForTree(PENDING_TREE));
1543 tile_version.SetSolidColorForTesting(SK_ColorRED);
1544 } else { 1542 } else {
1545 num_outside++; 1543 num_outside++;
1546 EXPECT_FALSE(tile->required_for_activation()); 1544 EXPECT_FALSE(tile->required_for_activation());
1547 } 1545 }
1548 } 1546 }
1549 1547
1550 EXPECT_GT(num_inside, 0); 1548 EXPECT_GT(num_inside, 0);
1551 EXPECT_GT(num_outside, 0); 1549 EXPECT_GT(num_outside, 0);
1552 1550
1553 // Activate and draw active layer. 1551 // Activate and draw active layer.
(...skipping 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after
2611 2609
2612 pending_layer_->draw_properties().visible_content_rect = 2610 pending_layer_->draw_properties().visible_content_rect =
2613 gfx::Rect(0, 0, 500, 500); 2611 gfx::Rect(0, 0, 500, 500);
2614 pending_layer_->UpdateTiles(Occlusion()); 2612 pending_layer_->UpdateTiles(Occlusion());
2615 2613
2616 std::vector<Tile*> high_res_tiles = high_res_tiling->AllTilesForTesting(); 2614 std::vector<Tile*> high_res_tiles = high_res_tiling->AllTilesForTesting();
2617 for (std::vector<Tile*>::iterator tile_it = high_res_tiles.begin(); 2615 for (std::vector<Tile*>::iterator tile_it = high_res_tiles.begin();
2618 tile_it != high_res_tiles.end(); 2616 tile_it != high_res_tiles.end();
2619 ++tile_it) { 2617 ++tile_it) {
2620 Tile* tile = *tile_it; 2618 Tile* tile = *tile_it;
2621 ManagedTileState::TileVersion& tile_version = 2619 ManagedTileState::DrawInfo& draw_info = tile->draw_info();
2622 tile->GetTileVersionForTesting( 2620 draw_info.SetSolidColorForTesting(SK_ColorRED);
2623 tile->DetermineRasterModeForTree(ACTIVE_TREE));
2624 tile_version.SetSolidColorForTesting(SK_ColorRED);
2625 } 2621 }
2626 2622
2627 non_ideal_tile_count = 0; 2623 non_ideal_tile_count = 0;
2628 low_res_tile_count = 0; 2624 low_res_tile_count = 0;
2629 high_res_tile_count = 0; 2625 high_res_tile_count = 0;
2630 for (it = PictureLayerImpl::LayerRasterTileIterator(pending_layer_, false); 2626 for (it = PictureLayerImpl::LayerRasterTileIterator(pending_layer_, false);
2631 it; 2627 it;
2632 ++it) { 2628 ++it) {
2633 Tile* tile = *it; 2629 Tile* tile = *it;
2634 TilePriority priority = tile->priority(PENDING_TREE); 2630 TilePriority priority = tile->priority(PENDING_TREE);
(...skipping 1727 matching lines...) Expand 10 before | Expand all | Expand 10 after
4362 SetupPendingTree(pending_pile2); 4358 SetupPendingTree(pending_pile2);
4363 ActivateTree(); 4359 ActivateTree();
4364 4360
4365 // We've switched to a solid color, so we should end up with no tilings. 4361 // We've switched to a solid color, so we should end up with no tilings.
4366 ASSERT_TRUE(active_layer_->tilings()); 4362 ASSERT_TRUE(active_layer_->tilings());
4367 EXPECT_EQ(0u, active_layer_->tilings()->num_tilings()); 4363 EXPECT_EQ(0u, active_layer_->tilings()->num_tilings());
4368 } 4364 }
4369 4365
4370 } // namespace 4366 } // namespace
4371 } // namespace cc 4367 } // 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