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

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

Issue 1736073002: cc: Move SyncedScrollOffset to scroll tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and add comment Created 4 years, 9 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/layers/scrollbar_layer_unittest.cc » ('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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 // Steal from the recycled tree if possible. 232 // Steal from the recycled tree if possible.
233 scoped_ptr<LayerImpl> pending_root = pending_tree->DetachLayerTree(); 233 scoped_ptr<LayerImpl> pending_root = pending_tree->DetachLayerTree();
234 scoped_ptr<FakePictureLayerImpl> pending_layer; 234 scoped_ptr<FakePictureLayerImpl> pending_layer;
235 DCHECK(!pending_root || pending_root->id() == root_id_); 235 DCHECK(!pending_root || pending_root->id() == root_id_);
236 if (!pending_root) { 236 if (!pending_root) {
237 pending_root = LayerImpl::Create(pending_tree, root_id_); 237 pending_root = LayerImpl::Create(pending_tree, root_id_);
238 pending_layer = FakePictureLayerImpl::Create(pending_tree, id_); 238 pending_layer = FakePictureLayerImpl::Create(pending_tree, id_);
239 if (!tile_size.IsEmpty()) 239 if (!tile_size.IsEmpty())
240 pending_layer->set_fixed_tile_size(tile_size); 240 pending_layer->set_fixed_tile_size(tile_size);
241 pending_layer->SetDrawsContent(true); 241 pending_layer->SetDrawsContent(true);
242 pending_layer->SetScrollClipLayer(pending_root->id());
242 } else { 243 } else {
243 pending_layer.reset(static_cast<FakePictureLayerImpl*>( 244 pending_layer.reset(static_cast<FakePictureLayerImpl*>(
244 pending_root->RemoveChild(pending_root->children()[0].get()) 245 pending_root->RemoveChild(pending_root->children()[0].get())
245 .release())); 246 .release()));
246 if (!tile_size.IsEmpty()) 247 if (!tile_size.IsEmpty())
247 pending_layer->set_fixed_tile_size(tile_size); 248 pending_layer->set_fixed_tile_size(tile_size);
248 } 249 }
249 pending_root->SetForceRenderSurface(true); 250 pending_root->SetForceRenderSurface(true);
250 // The bounds() just mirror the raster source size. 251 // The bounds() just mirror the raster source size.
251 pending_layer->SetBounds(raster_source->GetSize()); 252 pending_layer->SetBounds(raster_source->GetSize());
(...skipping 4670 matching lines...) Expand 10 before | Expand all | Expand 10 after
4922 // New low res tiling. 4923 // New low res tiling.
4923 EXPECT_TRUE(tilings->tiling_at(2)->may_contain_low_resolution_tiles()); 4924 EXPECT_TRUE(tilings->tiling_at(2)->may_contain_low_resolution_tiles());
4924 4925
4925 // This tiling will be high res now, it won't contain low res content since it 4926 // This tiling will be high res now, it won't contain low res content since it
4926 // was all destroyed. 4927 // was all destroyed.
4927 EXPECT_FALSE(tilings->tiling_at(1)->may_contain_low_resolution_tiles()); 4928 EXPECT_FALSE(tilings->tiling_at(1)->may_contain_low_resolution_tiles());
4928 } 4929 }
4929 4930
4930 } // namespace 4931 } // namespace
4931 } // namespace cc 4932 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl.cc ('k') | cc/layers/scrollbar_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698