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

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

Issue 1697613002: cc :: Move tracking of layer_property_changed to main thread (2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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/layer_unittest.cc ('k') | cc/proto/property_tree.proto » ('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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <limits> 10 #include <limits>
(...skipping 3943 matching lines...) Expand 10 before | Expand all | Expand 10 after
3954 bool tile_is_visible = 3954 bool tile_is_visible =
3955 tile->content_rect().Intersects(pending_layer_->visible_layer_rect()); 3955 tile->content_rect().Intersects(pending_layer_->visible_layer_rect());
3956 if (tile_is_visible) 3956 if (tile_is_visible)
3957 unoccluded_tile_count++; 3957 unoccluded_tile_count++;
3958 queue->Pop(); 3958 queue->Pop();
3959 } 3959 }
3960 EXPECT_EQ(20, unoccluded_tile_count); 3960 EXPECT_EQ(20, unoccluded_tile_count);
3961 3961
3962 // Full occlusion. 3962 // Full occlusion.
3963 layer1->SetPosition(gfx::PointF()); 3963 layer1->SetPosition(gfx::PointF());
3964 layer1->NoteLayerPropertyChanged();
3964 3965
3965 RebuildPropertyTreesOnPendingTree(); 3966 RebuildPropertyTreesOnPendingTree();
3966 host_impl_.AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(200)); 3967 host_impl_.AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(200));
3967 host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text); 3968 host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text);
3968 3969
3969 unoccluded_tile_count = 0; 3970 unoccluded_tile_count = 0;
3970 queue.reset(new TilingSetRasterQueueAll( 3971 queue.reset(new TilingSetRasterQueueAll(
3971 pending_layer_->picture_layer_tiling_set(), false)); 3972 pending_layer_->picture_layer_tiling_set(), false));
3972 while (!queue->IsEmpty()) { 3973 while (!queue->IsEmpty()) {
3973 PrioritizedTile prioritized_tile = queue->Top(); 3974 PrioritizedTile prioritized_tile = queue->Top();
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
4061 case 1: 4062 case 1:
4062 EXPECT_EQ(occluded_tile_count, 2); 4063 EXPECT_EQ(occluded_tile_count, 2);
4063 break; 4064 break;
4064 default: 4065 default:
4065 NOTREACHED(); 4066 NOTREACHED();
4066 } 4067 }
4067 } 4068 }
4068 4069
4069 // Full occlusion. 4070 // Full occlusion.
4070 layer1->SetPosition(gfx::PointF()); 4071 layer1->SetPosition(gfx::PointF());
4072 layer1->NoteLayerPropertyChanged();
4071 4073
4072 RebuildPropertyTreesOnPendingTree(); 4074 RebuildPropertyTreesOnPendingTree();
4073 host_impl_.AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(200)); 4075 host_impl_.AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(200));
4074 host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text); 4076 host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text);
4075 4077
4076 for (size_t i = 0; i < pending_layer_->num_tilings(); ++i) { 4078 for (size_t i = 0; i < pending_layer_->num_tilings(); ++i) {
4077 PictureLayerTiling* tiling = pending_layer_->tilings()->tiling_at(i); 4079 PictureLayerTiling* tiling = pending_layer_->tilings()->tiling_at(i);
4078 auto prioritized_tiles = 4080 auto prioritized_tiles =
4079 tiling->UpdateAndGetAllPrioritizedTilesForTesting(); 4081 tiling->UpdateAndGetAllPrioritizedTilesForTesting();
4080 4082
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after
4989 // New low res tiling. 4991 // New low res tiling.
4990 EXPECT_TRUE(tilings->tiling_at(2)->may_contain_low_resolution_tiles()); 4992 EXPECT_TRUE(tilings->tiling_at(2)->may_contain_low_resolution_tiles());
4991 4993
4992 // This tiling will be high res now, it won't contain low res content since it 4994 // This tiling will be high res now, it won't contain low res content since it
4993 // was all destroyed. 4995 // was all destroyed.
4994 EXPECT_FALSE(tilings->tiling_at(1)->may_contain_low_resolution_tiles()); 4996 EXPECT_FALSE(tilings->tiling_at(1)->may_contain_low_resolution_tiles());
4995 } 4997 }
4996 4998
4997 } // namespace 4999 } // namespace
4998 } // namespace cc 5000 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_unittest.cc ('k') | cc/proto/property_tree.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698