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/layers/picture_layer_impl_unittest.cc

Issue 1213193003: Remove DCHECK_IMPLIES and CHECK_IMPLIES (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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/video_layer_impl.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 <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 void SetupPendingTreeInternal(scoped_refptr<RasterSource> raster_source, 200 void SetupPendingTreeInternal(scoped_refptr<RasterSource> raster_source,
201 const gfx::Size& tile_size, 201 const gfx::Size& tile_size,
202 const Region& invalidation) { 202 const Region& invalidation) {
203 host_impl_.CreatePendingTree(); 203 host_impl_.CreatePendingTree();
204 host_impl_.pending_tree()->PushPageScaleFromMainThread(1.f, 0.25f, 100.f); 204 host_impl_.pending_tree()->PushPageScaleFromMainThread(1.f, 0.25f, 100.f);
205 LayerTreeImpl* pending_tree = host_impl_.pending_tree(); 205 LayerTreeImpl* pending_tree = host_impl_.pending_tree();
206 206
207 // Steal from the recycled tree if possible. 207 // Steal from the recycled tree if possible.
208 scoped_ptr<LayerImpl> pending_root = pending_tree->DetachLayerTree(); 208 scoped_ptr<LayerImpl> pending_root = pending_tree->DetachLayerTree();
209 scoped_ptr<FakePictureLayerImpl> pending_layer; 209 scoped_ptr<FakePictureLayerImpl> pending_layer;
210 DCHECK_IMPLIES(pending_root, pending_root->id() == root_id_); 210 DCHECK(!pending_root || pending_root->id() == root_id_);
211 if (!pending_root) { 211 if (!pending_root) {
212 pending_root = LayerImpl::Create(pending_tree, root_id_); 212 pending_root = LayerImpl::Create(pending_tree, root_id_);
213 pending_layer = FakePictureLayerImpl::Create(pending_tree, id_); 213 pending_layer = FakePictureLayerImpl::Create(pending_tree, id_);
214 if (!tile_size.IsEmpty()) 214 if (!tile_size.IsEmpty())
215 pending_layer->set_fixed_tile_size(tile_size); 215 pending_layer->set_fixed_tile_size(tile_size);
216 pending_layer->SetDrawsContent(true); 216 pending_layer->SetDrawsContent(true);
217 } else { 217 } else {
218 pending_layer.reset(static_cast<FakePictureLayerImpl*>( 218 pending_layer.reset(static_cast<FakePictureLayerImpl*>(
219 pending_root->RemoveChild(pending_root->children()[0]).release())); 219 pending_root->RemoveChild(pending_root->children()[0]).release()));
220 if (!tile_size.IsEmpty()) 220 if (!tile_size.IsEmpty())
(...skipping 4730 matching lines...) Expand 10 before | Expand all | Expand 10 after
4951 result = layer->CalculateTileSize(gfx::Size(447, 400)); 4951 result = layer->CalculateTileSize(gfx::Size(447, 400));
4952 EXPECT_EQ(result.width(), 448); 4952 EXPECT_EQ(result.width(), 448);
4953 EXPECT_EQ(result.height(), 448); 4953 EXPECT_EQ(result.height(), 448);
4954 result = layer->CalculateTileSize(gfx::Size(500, 499)); 4954 result = layer->CalculateTileSize(gfx::Size(500, 499));
4955 EXPECT_EQ(result.width(), 512); 4955 EXPECT_EQ(result.width(), 512);
4956 EXPECT_EQ(result.height(), 500 + 2); 4956 EXPECT_EQ(result.height(), 500 + 2);
4957 } 4957 }
4958 4958
4959 } // namespace 4959 } // namespace
4960 } // namespace cc 4960 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl.cc ('k') | cc/layers/video_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698