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

Side by Side Diff: cc/test/fake_picture_layer_impl.cc

Issue 235753002: cc: Give TilingData a Rect instead of a Size (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Git cl format Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « cc/test/fake_picture_layer_impl.h ('k') | cc/test/fake_picture_pile_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/test/fake_picture_layer_impl.h" 5 #include "cc/test/fake_picture_layer_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 #include "cc/resources/tile.h" 8 #include "cc/resources/tile.h"
9 #include "cc/trees/layer_tree_impl.h" 9 #include "cc/trees/layer_tree_impl.h"
10 10
11 namespace cc { 11 namespace cc {
12 12
13 FakePictureLayerImpl::FakePictureLayerImpl( 13 FakePictureLayerImpl::FakePictureLayerImpl(
14 LayerTreeImpl* tree_impl, 14 LayerTreeImpl* tree_impl,
15 int id, 15 int id,
16 scoped_refptr<PicturePileImpl> pile) 16 scoped_refptr<PicturePileImpl> pile)
17 : PictureLayerImpl(tree_impl, id), 17 : PictureLayerImpl(tree_impl, id),
18 append_quads_count_(0) { 18 append_quads_count_(0) {
19 pile_ = pile; 19 pile_ = pile;
20 SetBounds(pile_->size()); 20 CHECK(pile->tiling_rect().origin() == gfx::Point());
21 SetBounds(pile_->tiling_rect().size());
22 }
23
24 FakePictureLayerImpl::FakePictureLayerImpl(LayerTreeImpl* tree_impl,
25 int id,
26 scoped_refptr<PicturePileImpl> pile,
27 const gfx::Size& layer_bounds)
28 : PictureLayerImpl(tree_impl, id), append_quads_count_(0) {
29 pile_ = pile;
30 SetBounds(layer_bounds);
21 } 31 }
22 32
23 FakePictureLayerImpl::FakePictureLayerImpl(LayerTreeImpl* tree_impl, int id) 33 FakePictureLayerImpl::FakePictureLayerImpl(LayerTreeImpl* tree_impl, int id)
24 : PictureLayerImpl(tree_impl, id), append_quads_count_(0) {} 34 : PictureLayerImpl(tree_impl, id), append_quads_count_(0) {}
25 35
26 scoped_ptr<LayerImpl> FakePictureLayerImpl::CreateLayerImpl( 36 scoped_ptr<LayerImpl> FakePictureLayerImpl::CreateLayerImpl(
27 LayerTreeImpl* tree_impl) { 37 LayerTreeImpl* tree_impl) {
28 return make_scoped_ptr( 38 return make_scoped_ptr(
29 new FakePictureLayerImpl(tree_impl, id())).PassAs<LayerImpl>(); 39 new FakePictureLayerImpl(tree_impl, id())).PassAs<LayerImpl>();
30 } 40 }
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 DCHECK_EQ(tilings()->tiling_at(0)->resolution(), HIGH_RESOLUTION); 140 DCHECK_EQ(tilings()->tiling_at(0)->resolution(), HIGH_RESOLUTION);
131 DCHECK_EQ(tilings()->tiling_at(1)->resolution(), LOW_RESOLUTION); 141 DCHECK_EQ(tilings()->tiling_at(1)->resolution(), LOW_RESOLUTION);
132 HighResTiling()->CreateAllTilesForTesting(); 142 HighResTiling()->CreateAllTilesForTesting();
133 LowResTiling()->CreateAllTilesForTesting(); 143 LowResTiling()->CreateAllTilesForTesting();
134 } else { 144 } else {
135 DCHECK_EQ(tilings()->num_tilings(), 0u); 145 DCHECK_EQ(tilings()->num_tilings(), 0u);
136 } 146 }
137 } 147 }
138 148
139 } // namespace cc 149 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/fake_picture_layer_impl.h ('k') | cc/test/fake_picture_pile_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698