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

Side by Side Diff: cc/test/fake_picture_layer_impl.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/test/fake_picture_layer_impl.h ('k') | cc/tiles/tile_manager_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/test/fake_picture_layer_impl.h" 5 #include "cc/test/fake_picture_layer_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <vector> 9 #include <vector>
10 #include "cc/tiles/tile.h" 10 #include "cc/tiles/tile.h"
11 #include "cc/trees/layer_tree_impl.h" 11 #include "cc/trees/layer_tree_impl.h"
12 12
13 namespace cc { 13 namespace cc {
14 14
15 FakePictureLayerImpl::FakePictureLayerImpl( 15 FakePictureLayerImpl::FakePictureLayerImpl(
16 LayerTreeImpl* tree_impl, 16 LayerTreeImpl* tree_impl,
17 int id, 17 int id,
18 scoped_refptr<DisplayListRasterSource> raster_source, 18 scoped_refptr<DisplayListRasterSource> raster_source,
19 bool is_mask) 19 bool is_mask)
20 : PictureLayerImpl(tree_impl, 20 : PictureLayerImpl(tree_impl, id, is_mask),
21 id,
22 is_mask,
23 new LayerImpl::SyncedScrollOffset),
24 append_quads_count_(0), 21 append_quads_count_(0),
25 did_become_active_call_count_(0), 22 did_become_active_call_count_(0),
26 has_valid_tile_priorities_(false), 23 has_valid_tile_priorities_(false),
27 use_set_valid_tile_priorities_flag_(false), 24 use_set_valid_tile_priorities_flag_(false),
28 release_resources_count_(0) { 25 release_resources_count_(0) {
29 SetBounds(raster_source->GetSize()); 26 SetBounds(raster_source->GetSize());
30 SetRasterSourceOnPending(raster_source, Region()); 27 SetRasterSourceOnPending(raster_source, Region());
31 } 28 }
32 29
33 FakePictureLayerImpl::FakePictureLayerImpl( 30 FakePictureLayerImpl::FakePictureLayerImpl(
34 LayerTreeImpl* tree_impl, 31 LayerTreeImpl* tree_impl,
35 int id, 32 int id,
36 scoped_refptr<DisplayListRasterSource> raster_source, 33 scoped_refptr<DisplayListRasterSource> raster_source,
37 bool is_mask, 34 bool is_mask,
38 const gfx::Size& layer_bounds) 35 const gfx::Size& layer_bounds)
39 : PictureLayerImpl(tree_impl, 36 : PictureLayerImpl(tree_impl, id, is_mask),
40 id,
41 is_mask,
42 new LayerImpl::SyncedScrollOffset),
43 append_quads_count_(0), 37 append_quads_count_(0),
44 did_become_active_call_count_(0), 38 did_become_active_call_count_(0),
45 has_valid_tile_priorities_(false), 39 has_valid_tile_priorities_(false),
46 use_set_valid_tile_priorities_flag_(false), 40 use_set_valid_tile_priorities_flag_(false),
47 release_resources_count_(0) { 41 release_resources_count_(0) {
48 SetBounds(layer_bounds); 42 SetBounds(layer_bounds);
49 SetRasterSourceOnPending(raster_source, Region()); 43 SetRasterSourceOnPending(raster_source, Region());
50 } 44 }
51 45
52 FakePictureLayerImpl::FakePictureLayerImpl(LayerTreeImpl* tree_impl, 46 FakePictureLayerImpl::FakePictureLayerImpl(LayerTreeImpl* tree_impl,
53 int id, 47 int id,
54 bool is_mask) 48 bool is_mask)
55 : FakePictureLayerImpl(tree_impl, 49 : PictureLayerImpl(tree_impl, id, is_mask),
56 id,
57 is_mask,
58 new LayerImpl::SyncedScrollOffset) {
59 }
60
61 FakePictureLayerImpl::FakePictureLayerImpl(
62 LayerTreeImpl* tree_impl,
63 int id,
64 bool is_mask,
65 scoped_refptr<LayerImpl::SyncedScrollOffset> synced_scroll_offset)
66 : PictureLayerImpl(tree_impl, id, is_mask, synced_scroll_offset),
67 append_quads_count_(0), 50 append_quads_count_(0),
68 did_become_active_call_count_(0), 51 did_become_active_call_count_(0),
69 has_valid_tile_priorities_(false), 52 has_valid_tile_priorities_(false),
70 use_set_valid_tile_priorities_flag_(false), 53 use_set_valid_tile_priorities_flag_(false),
71 release_resources_count_(0) { 54 release_resources_count_(0) {}
72 }
73 55
74 scoped_ptr<LayerImpl> FakePictureLayerImpl::CreateLayerImpl( 56 scoped_ptr<LayerImpl> FakePictureLayerImpl::CreateLayerImpl(
75 LayerTreeImpl* tree_impl) { 57 LayerTreeImpl* tree_impl) {
76 return make_scoped_ptr(new FakePictureLayerImpl(tree_impl, id(), is_mask_, 58 return make_scoped_ptr(new FakePictureLayerImpl(tree_impl, id(), is_mask_));
77 synced_scroll_offset()));
78 } 59 }
79 60
80 void FakePictureLayerImpl::PushPropertiesTo(LayerImpl* layer_impl) { 61 void FakePictureLayerImpl::PushPropertiesTo(LayerImpl* layer_impl) {
81 FakePictureLayerImpl* picture_layer_impl = 62 FakePictureLayerImpl* picture_layer_impl =
82 static_cast<FakePictureLayerImpl*>(layer_impl); 63 static_cast<FakePictureLayerImpl*>(layer_impl);
83 picture_layer_impl->fixed_tile_size_ = fixed_tile_size_; 64 picture_layer_impl->fixed_tile_size_ = fixed_tile_size_;
84 PictureLayerImpl::PushPropertiesTo(layer_impl); 65 PictureLayerImpl::PushPropertiesTo(layer_impl);
85 } 66 }
86 67
87 void FakePictureLayerImpl::AppendQuads( 68 void FakePictureLayerImpl::AppendQuads(
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 218
238 return CountTilesRequired(&PictureLayerTiling::IsTileRequiredForDraw); 219 return CountTilesRequired(&PictureLayerTiling::IsTileRequiredForDraw);
239 } 220 }
240 221
241 void FakePictureLayerImpl::ReleaseResources() { 222 void FakePictureLayerImpl::ReleaseResources() {
242 PictureLayerImpl::ReleaseResources(); 223 PictureLayerImpl::ReleaseResources();
243 ++release_resources_count_; 224 ++release_resources_count_;
244 } 225 }
245 226
246 } // namespace cc 227 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/fake_picture_layer_impl.h ('k') | cc/tiles/tile_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698