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 PictureLayerTilingSet(PictureLayerTilingClient* client, | 17 PictureLayerTilingSet(PictureLayerTilingClient* client, |
18 gfx::Size layer_bounds); | 18 const gfx::Size& layer_bounds); |
19 ~PictureLayerTilingSet(); | 19 ~PictureLayerTilingSet(); |
20 | 20 |
21 void SetClient(PictureLayerTilingClient* client); | 21 void SetClient(PictureLayerTilingClient* client); |
22 const PictureLayerTilingClient* client() const { return client_; } | 22 const PictureLayerTilingClient* client() const { return client_; } |
23 | 23 |
24 // Make this set of tilings match the same set of content scales from |other|. | 24 // Make this set of tilings match the same set of content scales from |other|. |
25 // Delete any tilings that don't meet |minimum_contents_scale|. Recreate | 25 // Delete any tilings that don't meet |minimum_contents_scale|. Recreate |
26 // any tiles that intersect |layer_invalidation|. Update the size of all | 26 // any tiles that intersect |layer_invalidation|. Update the size of all |
27 // tilings to |new_layer_bounds|. | 27 // tilings to |new_layer_bounds|. |
28 void SyncTilings( | 28 void SyncTilings( |
29 const PictureLayerTilingSet& other, | 29 const PictureLayerTilingSet& other, |
30 gfx::Size new_layer_bounds, | 30 const gfx::Size& new_layer_bounds, |
31 const Region& layer_invalidation, | 31 const Region& layer_invalidation, |
32 float minimum_contents_scale); | 32 float minimum_contents_scale); |
33 | 33 |
34 gfx::Size layer_bounds() const { return layer_bounds_; } | 34 gfx::Size layer_bounds() const { return layer_bounds_; } |
35 | 35 |
36 void SetCanUseLCDText(bool can_use_lcd_text); | 36 void SetCanUseLCDText(bool can_use_lcd_text); |
37 | 37 |
38 PictureLayerTiling* AddTiling(float contents_scale); | 38 PictureLayerTiling* AddTiling(float contents_scale); |
39 size_t num_tilings() const { return tilings_.size(); } | 39 size_t num_tilings() const { return tilings_.size(); } |
40 int NumHighResTilings() const; | 40 int NumHighResTilings() const; |
41 PictureLayerTiling* tiling_at(size_t idx) { return tilings_[idx]; } | 41 PictureLayerTiling* tiling_at(size_t idx) { return tilings_[idx]; } |
42 const PictureLayerTiling* tiling_at(size_t idx) const { | 42 const PictureLayerTiling* tiling_at(size_t idx) const { |
43 return tilings_[idx]; | 43 return tilings_[idx]; |
44 } | 44 } |
45 | 45 |
46 PictureLayerTiling* TilingAtScale(float scale) const; | 46 PictureLayerTiling* TilingAtScale(float scale) const; |
47 | 47 |
48 // Remove all tilings. | 48 // Remove all tilings. |
49 void RemoveAllTilings(); | 49 void RemoveAllTilings(); |
50 | 50 |
51 // Remove one tiling. | 51 // Remove one tiling. |
52 void Remove(PictureLayerTiling* tiling); | 52 void Remove(PictureLayerTiling* tiling); |
53 | 53 |
54 // Remove all tiles; keep all tilings. | 54 // Remove all tiles; keep all tilings. |
55 void RemoveAllTiles(); | 55 void RemoveAllTiles(); |
56 | 56 |
57 void UpdateTilePriorities( | 57 void UpdateTilePriorities( |
58 WhichTree tree, | 58 WhichTree tree, |
59 gfx::Size device_viewport, | 59 const gfx::Size& device_viewport, |
60 const gfx::Rect& viewport_in_content_space, | 60 const gfx::Rect& viewport_in_content_space, |
61 const gfx::Rect& visible_content_rect, | 61 const gfx::Rect& visible_content_rect, |
62 gfx::Size last_layer_bounds, | 62 const gfx::Size& last_layer_bounds, |
63 gfx::Size current_layer_bounds, | 63 const gfx::Size& current_layer_bounds, |
64 float last_layer_contents_scale, | 64 float last_layer_contents_scale, |
65 float current_layer_contents_scale, | 65 float current_layer_contents_scale, |
66 const gfx::Transform& last_screen_transform, | 66 const gfx::Transform& last_screen_transform, |
67 const gfx::Transform& current_screen_transform, | 67 const gfx::Transform& current_screen_transform, |
68 double current_frame_time_in_seconds, | 68 double current_frame_time_in_seconds, |
69 size_t max_tiles_for_interest_area); | 69 size_t max_tiles_for_interest_area); |
70 | 70 |
71 void DidBecomeActive(); | 71 void DidBecomeActive(); |
72 void DidBecomeRecycled(); | 72 void DidBecomeRecycled(); |
73 | 73 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 gfx::Size layer_bounds_; | 123 gfx::Size layer_bounds_; |
124 ScopedPtrVector<PictureLayerTiling> tilings_; | 124 ScopedPtrVector<PictureLayerTiling> tilings_; |
125 | 125 |
126 friend class Iterator; | 126 friend class Iterator; |
127 DISALLOW_COPY_AND_ASSIGN(PictureLayerTilingSet); | 127 DISALLOW_COPY_AND_ASSIGN(PictureLayerTilingSet); |
128 }; | 128 }; |
129 | 129 |
130 } // namespace cc | 130 } // namespace cc |
131 | 131 |
132 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_ | 132 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_ |
OLD | NEW |