OLD | NEW |
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_RESOURCES_PICTURE_LAYER_TILING_SET_H_ | 5 #ifndef CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_ |
6 #define CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_ | 6 #define CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_ |
7 | 7 |
8 #include "cc/base/region.h" | 8 #include "cc/base/region.h" |
9 #include "cc/base/scoped_ptr_vector.h" | 9 #include "cc/base/scoped_ptr_vector.h" |
10 #include "cc/resources/picture_layer_tiling.h" | 10 #include "cc/resources/picture_layer_tiling.h" |
11 #include "ui/gfx/size.h" | 11 #include "ui/gfx/size.h" |
12 | 12 |
13 namespace cc { | 13 namespace cc { |
14 | 14 |
15 class CC_EXPORT PictureLayerTilingSet { | 15 class CC_EXPORT PictureLayerTilingSet { |
16 public: | 16 public: |
17 explicit PictureLayerTilingSet(PictureLayerTilingClient* client); | 17 PictureLayerTilingSet(PictureLayerTilingClient* client, |
| 18 gfx::Size layer_bounds); |
18 ~PictureLayerTilingSet(); | 19 ~PictureLayerTilingSet(); |
19 | 20 |
20 void SetClient(PictureLayerTilingClient* client); | 21 void SetClient(PictureLayerTilingClient* client); |
21 | 22 |
22 // Shallow copies all data (except client and bounds from other). | 23 // Shallow copies all data (except client and bounds from other). |
23 void CloneAll( | 24 void CloneAll( |
24 const PictureLayerTilingSet& other, | 25 const PictureLayerTilingSet& other, |
25 const Region& invalidation, | |
26 float minimum_contents_scale); | 26 float minimum_contents_scale); |
27 void Clone(const PictureLayerTiling* tiling, const Region& invalidation); | 27 void Clone(const PictureLayerTiling* tiling); |
28 | 28 |
29 void SetLayerBounds(gfx::Size layer_bounds); | 29 gfx::Size layer_bounds() const { return layer_bounds_; } |
30 gfx::Size LayerBounds() const; | |
31 | 30 |
32 void Invalidate(const Region& layer_invalidation); | |
33 void InvalidateTilesWithText(); | 31 void InvalidateTilesWithText(); |
34 | 32 |
35 PictureLayerTiling* AddTiling(float contents_scale); | 33 PictureLayerTiling* AddTiling(float contents_scale); |
36 size_t num_tilings() const { return tilings_.size(); } | 34 size_t num_tilings() const { return tilings_.size(); } |
37 PictureLayerTiling* tiling_at(size_t idx) { return tilings_[idx]; } | 35 PictureLayerTiling* tiling_at(size_t idx) { return tilings_[idx]; } |
38 const PictureLayerTiling* tiling_at(size_t idx) const { | 36 const PictureLayerTiling* tiling_at(size_t idx) const { |
39 return tilings_[idx]; | 37 return tilings_[idx]; |
40 } | 38 } |
41 | 39 |
42 // Remove all tilings. | 40 // Remove all tilings. |
43 void RemoveAllTilings(); | 41 void RemoveAllTilings(); |
44 | 42 |
45 // Remove one tiling. | 43 // Remove one tiling. |
46 void Remove(PictureLayerTiling* tiling); | 44 void Remove(PictureLayerTiling* tiling); |
47 | 45 |
48 // Remove all tiles; keep all tilings. | 46 // Remove all tiles; keep all tilings. |
49 void RemoveAllTiles(); | 47 void RemoveAllTiles(); |
50 | 48 |
51 // For all tilings, create any tile that intersects |layer_rect|. | |
52 void CreateTilesFromLayerRect(gfx::Rect layer_rect); | |
53 | |
54 void UpdateTilePriorities( | 49 void UpdateTilePriorities( |
55 WhichTree tree, | 50 WhichTree tree, |
56 gfx::Size device_viewport, | 51 gfx::Size device_viewport, |
57 gfx::Rect viewport_in_content_space, | 52 gfx::Rect viewport_in_content_space, |
58 gfx::Size last_layer_bounds, | 53 gfx::Size last_layer_bounds, |
59 gfx::Size current_layer_bounds, | 54 gfx::Size current_layer_bounds, |
60 float last_layer_contents_scale, | 55 float last_layer_contents_scale, |
61 float current_layer_contents_scale, | 56 float current_layer_contents_scale, |
62 const gfx::Transform& last_screen_transform, | 57 const gfx::Transform& last_screen_transform, |
63 const gfx::Transform& current_screen_transform, | 58 const gfx::Transform& current_screen_transform, |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 gfx::Size layer_bounds_; | 114 gfx::Size layer_bounds_; |
120 ScopedPtrVector<PictureLayerTiling> tilings_; | 115 ScopedPtrVector<PictureLayerTiling> tilings_; |
121 | 116 |
122 friend class Iterator; | 117 friend class Iterator; |
123 DISALLOW_COPY_AND_ASSIGN(PictureLayerTilingSet); | 118 DISALLOW_COPY_AND_ASSIGN(PictureLayerTilingSet); |
124 }; | 119 }; |
125 | 120 |
126 } // namespace cc | 121 } // namespace cc |
127 | 122 |
128 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_ | 123 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_ |
OLD | NEW |