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

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

Issue 783543003: Update from https://crrev.com/306901 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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/layers/texture_layer.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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 active_layer_->AddTiling(0.5f); 127 active_layer_->AddTiling(0.5f);
128 for (size_t i = 0; i < active_layer_->tilings()->num_tilings(); ++i) 128 for (size_t i = 0; i < active_layer_->tilings()->num_tilings(); ++i)
129 active_layer_->tilings()->tiling_at(i)->CreateAllTilesForTesting(); 129 active_layer_->tilings()->tiling_at(i)->CreateAllTilesForTesting();
130 pending_layer_->set_invalidation(invalidation); 130 pending_layer_->set_invalidation(invalidation);
131 for (size_t i = 0; i < pending_layer_->tilings()->num_tilings(); ++i) 131 for (size_t i = 0; i < pending_layer_->tilings()->num_tilings(); ++i)
132 pending_layer_->tilings()->tiling_at(i)->CreateAllTilesForTesting(); 132 pending_layer_->tilings()->tiling_at(i)->CreateAllTilesForTesting();
133 } 133 }
134 134
135 void SetupPendingTree(scoped_refptr<RasterSource> raster_source) { 135 void SetupPendingTree(scoped_refptr<RasterSource> raster_source) {
136 host_impl_.CreatePendingTree(); 136 host_impl_.CreatePendingTree();
137 host_impl_.pending_tree()->SetPageScaleFactorAndLimits(1.f, 0.25f, 100.f); 137 host_impl_.pending_tree()->PushPageScaleFromMainThread(1.f, 0.25f, 100.f);
138 LayerTreeImpl* pending_tree = host_impl_.pending_tree(); 138 LayerTreeImpl* pending_tree = host_impl_.pending_tree();
139 139
140 // Steal from the recycled tree. 140 // Steal from the recycled tree.
141 scoped_ptr<LayerImpl> old_pending_root = pending_tree->DetachLayerTree(); 141 scoped_ptr<LayerImpl> old_pending_root = pending_tree->DetachLayerTree();
142 DCHECK_IMPLIES(old_pending_root, old_pending_root->id() == id_); 142 DCHECK_IMPLIES(old_pending_root, old_pending_root->id() == id_);
143 143
144 scoped_ptr<FakePictureLayerImpl> pending_layer; 144 scoped_ptr<FakePictureLayerImpl> pending_layer;
145 if (old_pending_root) { 145 if (old_pending_root) {
146 pending_layer.reset( 146 pending_layer.reset(
147 static_cast<FakePictureLayerImpl*>(old_pending_root.release())); 147 static_cast<FakePictureLayerImpl*>(old_pending_root.release()));
(...skipping 4612 matching lines...) Expand 10 before | Expand all | Expand 10 after
4760 result = layer->CalculateTileSize(gfx::Size(447, 400)); 4760 result = layer->CalculateTileSize(gfx::Size(447, 400));
4761 EXPECT_EQ(result.width(), 448); 4761 EXPECT_EQ(result.width(), 448);
4762 EXPECT_EQ(result.height(), 448); 4762 EXPECT_EQ(result.height(), 448);
4763 result = layer->CalculateTileSize(gfx::Size(500, 499)); 4763 result = layer->CalculateTileSize(gfx::Size(500, 499));
4764 EXPECT_EQ(result.width(), 512); 4764 EXPECT_EQ(result.width(), 512);
4765 EXPECT_EQ(result.height(), 500 + 2); 4765 EXPECT_EQ(result.height(), 500 + 2);
4766 } 4766 }
4767 4767
4768 } // namespace 4768 } // namespace
4769 } // namespace cc 4769 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl.cc ('k') | cc/layers/texture_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698