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

Side by Side Diff: cc/layers/picture_layer_impl.h

Issue 800613009: Convert scroll offsets to use SyncedProperty. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 #ifndef CC_LAYERS_PICTURE_LAYER_IMPL_H_ 5 #ifndef CC_LAYERS_PICTURE_LAYER_IMPL_H_
6 #define CC_LAYERS_PICTURE_LAYER_IMPL_H_ 6 #define CC_LAYERS_PICTURE_LAYER_IMPL_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 21 matching lines...) Expand all
32 public: 32 public:
33 struct CC_EXPORT Pair { 33 struct CC_EXPORT Pair {
34 Pair(); 34 Pair();
35 Pair(PictureLayerImpl* active_layer, PictureLayerImpl* pending_layer); 35 Pair(PictureLayerImpl* active_layer, PictureLayerImpl* pending_layer);
36 ~Pair(); 36 ~Pair();
37 37
38 PictureLayerImpl* active; 38 PictureLayerImpl* active;
39 PictureLayerImpl* pending; 39 PictureLayerImpl* pending;
40 }; 40 };
41 41
42 static scoped_ptr<PictureLayerImpl> Create(LayerTreeImpl* tree_impl, 42 static scoped_ptr<PictureLayerImpl> Create(
43 int id, 43 LayerTreeImpl* tree_impl,
44 bool is_mask) { 44 int id,
45 return make_scoped_ptr(new PictureLayerImpl(tree_impl, id, is_mask)); 45 bool is_mask,
46 scoped_refptr<SyncedScrollOffset> scroll_offset) {
47 return make_scoped_ptr(
48 new PictureLayerImpl(tree_impl, id, is_mask, scroll_offset));
46 } 49 }
47 ~PictureLayerImpl() override; 50 ~PictureLayerImpl() override;
48 51
49 bool is_mask() const { return is_mask_; } 52 bool is_mask() const { return is_mask_; }
50 53
51 scoped_ptr<TilingSetEvictionQueue> CreateEvictionQueue( 54 scoped_ptr<TilingSetEvictionQueue> CreateEvictionQueue(
52 TreePriority tree_priority); 55 TreePriority tree_priority);
53 scoped_ptr<TilingSetRasterQueue> CreateRasterQueue(bool prioritize_low_res); 56 scoped_ptr<TilingSetRasterQueue> CreateRasterQueue(bool prioritize_low_res);
54 57
55 // LayerImpl overrides. 58 // LayerImpl overrides.
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 bool AllTilesRequiredForActivationAreReadyToDraw() const; 106 bool AllTilesRequiredForActivationAreReadyToDraw() const;
104 bool AllTilesRequiredForDrawAreReadyToDraw() const; 107 bool AllTilesRequiredForDrawAreReadyToDraw() const;
105 108
106 // Used for benchmarking 109 // Used for benchmarking
107 RasterSource* GetRasterSource() const { return raster_source_.get(); } 110 RasterSource* GetRasterSource() const { return raster_source_.get(); }
108 111
109 protected: 112 protected:
110 friend class LayerRasterTileIterator; 113 friend class LayerRasterTileIterator;
111 using TileRequirementCheck = bool (PictureLayerTiling::*)(const Tile*) const; 114 using TileRequirementCheck = bool (PictureLayerTiling::*)(const Tile*) const;
112 115
113 PictureLayerImpl(LayerTreeImpl* tree_impl, int id, bool is_mask); 116 PictureLayerImpl(LayerTreeImpl* tree_impl,
117 int id,
118 bool is_mask,
119 scoped_refptr<SyncedScrollOffset> scroll_offset);
114 PictureLayerTiling* AddTiling(float contents_scale); 120 PictureLayerTiling* AddTiling(float contents_scale);
115 void RemoveAllTilings(); 121 void RemoveAllTilings();
116 void AddTilingsForRasterScale(); 122 void AddTilingsForRasterScale();
117 bool UpdateTilePriorities(const Occlusion& occlusion_in_content_space); 123 bool UpdateTilePriorities(const Occlusion& occlusion_in_content_space);
118 virtual bool ShouldAdjustRasterScale() const; 124 virtual bool ShouldAdjustRasterScale() const;
119 virtual void RecalculateRasterScales(); 125 virtual void RecalculateRasterScales();
120 void CleanUpTilingsOnActiveLayer( 126 void CleanUpTilingsOnActiveLayer(
121 std::vector<PictureLayerTiling*> used_tilings); 127 std::vector<PictureLayerTiling*> used_tilings);
122 float MinimumContentsScale() const; 128 float MinimumContentsScale() const;
123 float MaximumContentsScale() const; 129 float MaximumContentsScale() const;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 // from regular draws. Save a copy of the required draw properties of the last 182 // from regular draws. Save a copy of the required draw properties of the last
177 // frame that has a valid viewport for prioritizing tiles. 183 // frame that has a valid viewport for prioritizing tiles.
178 gfx::Rect visible_rect_for_tile_priority_; 184 gfx::Rect visible_rect_for_tile_priority_;
179 185
180 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); 186 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl);
181 }; 187 };
182 188
183 } // namespace cc 189 } // namespace cc
184 190
185 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ 191 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698