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

Side by Side Diff: cc/resources/tile_manager_unittest.cc

Issue 465853004: Moving RenderSurface creation outside of CalcDrawProps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed formatting 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
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/resources/eviction_tile_priority_queue.h" 5 #include "cc/resources/eviction_tile_priority_queue.h"
6 #include "cc/resources/raster_tile_priority_queue.h" 6 #include "cc/resources/raster_tile_priority_queue.h"
7 #include "cc/resources/tile.h" 7 #include "cc/resources/tile.h"
8 #include "cc/resources/tile_priority.h" 8 #include "cc/resources/tile_priority.h"
9 #include "cc/test/fake_impl_proxy.h" 9 #include "cc/test/fake_impl_proxy.h"
10 #include "cc/test/fake_layer_tree_host_impl.h" 10 #include "cc/test/fake_layer_tree_host_impl.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 107
108 scoped_ptr<FakePictureLayerImpl> pending_layer; 108 scoped_ptr<FakePictureLayerImpl> pending_layer;
109 if (old_pending_root) { 109 if (old_pending_root) {
110 pending_layer.reset( 110 pending_layer.reset(
111 static_cast<FakePictureLayerImpl*>(old_pending_root.release())); 111 static_cast<FakePictureLayerImpl*>(old_pending_root.release()));
112 pending_layer->SetRasterSource(pile); 112 pending_layer->SetRasterSource(pile);
113 } else { 113 } else {
114 pending_layer = 114 pending_layer =
115 FakePictureLayerImpl::CreateWithRasterSource(pending_tree, id_, pile); 115 FakePictureLayerImpl::CreateWithRasterSource(pending_tree, id_, pile);
116 pending_layer->SetDrawsContent(true); 116 pending_layer->SetDrawsContent(true);
117 pending_layer->SetHasRenderSurface(true);
117 } 118 }
118 // The bounds() just mirror the pile size. 119 // The bounds() just mirror the pile size.
119 pending_layer->SetBounds(pending_layer->raster_source()->GetSize()); 120 pending_layer->SetBounds(pending_layer->raster_source()->GetSize());
120 pending_tree->SetRootLayer(pending_layer.Pass()); 121 pending_tree->SetRootLayer(pending_layer.Pass());
121 122
122 pending_layer_ = static_cast<FakePictureLayerImpl*>( 123 pending_layer_ = static_cast<FakePictureLayerImpl*>(
123 host_impl_.pending_tree()->LayerById(id_)); 124 host_impl_.pending_tree()->LayerById(id_));
124 pending_layer_->DoPostCommitInitializationIfNeeded(); 125 pending_layer_->DoPostCommitInitializationIfNeeded();
125 } 126 }
126 127
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after
858 all_tiles.insert(queue.Top()); 859 all_tiles.insert(queue.Top());
859 ++tile_count; 860 ++tile_count;
860 queue.Pop(); 861 queue.Pop();
861 } 862 }
862 EXPECT_EQ(tile_count, all_tiles.size()); 863 EXPECT_EQ(tile_count, all_tiles.size());
863 EXPECT_EQ(16u, tile_count); 864 EXPECT_EQ(16u, tile_count);
864 } 865 }
865 866
866 } // namespace 867 } // namespace
867 } // namespace cc 868 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698