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_TILE_H_ | 5 #ifndef CC_TILE_H_ |
6 #define CC_TILE_H_ | 6 #define CC_TILE_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
11 #include "cc/layer_tree_host_impl.h" | 11 #include "cc/layer_tree_host_impl.h" |
12 #include "cc/picture_pile_impl.h" | 12 #include "cc/picture_pile_impl.h" |
13 #include "cc/resource_provider.h" | 13 #include "cc/resource_provider.h" |
14 #include "cc/tile_manager.h" | 14 #include "cc/tile_manager.h" |
15 #include "cc/tile_priority.h" | 15 #include "cc/tile_priority.h" |
16 #include "ui/gfx/rect.h" | 16 #include "ui/gfx/rect.h" |
17 #include "ui/gfx/size.h" | 17 #include "ui/gfx/size.h" |
18 | 18 |
19 namespace cc { | 19 namespace cc { |
20 | 20 |
21 class Tile; | 21 class Tile; |
22 | 22 |
23 class CC_EXPORT Tile : public base::RefCounted<Tile> { | 23 class CC_EXPORT Tile : public base::RefCounted<Tile> { |
24 public: | 24 public: |
25 Tile(TileManager* tile_manager, | 25 Tile(TileManager* tile_manager, |
26 PicturePileImpl* picture_pile, | 26 PicturePileImpl* picture_pile, |
27 gfx::Size tile_size, | 27 gfx::Size tile_size, |
28 GLenum format, | 28 GLenum format, |
29 gfx::Rect rect_inside_picture); | 29 gfx::Rect rect_inside_picture, |
| 30 float contents_scale); |
30 | 31 |
31 const PicturePileImpl* picture_pile() const { | 32 const PicturePileImpl* picture_pile() const { |
32 return picture_pile_.get(); | 33 return picture_pile_.get(); |
33 } | 34 } |
34 | 35 |
35 const TilePriority& priority(WhichTree tree) const { | 36 const TilePriority& priority(WhichTree tree) const { |
36 return priority_[tree]; | 37 return priority_[tree]; |
37 } | 38 } |
38 | 39 |
39 TilePriority combined_priority() const { | 40 TilePriority combined_priority() const { |
(...skipping 10 matching lines...) Expand all Loading... |
50 | 51 |
51 bool contents_swizzled() const { return managed_state_.contents_swizzled; } | 52 bool contents_swizzled() const { return managed_state_.contents_swizzled; } |
52 | 53 |
53 private: | 54 private: |
54 // Methods called by by tile manager. | 55 // Methods called by by tile manager. |
55 friend class TileManager; | 56 friend class TileManager; |
56 friend class BinComparator; | 57 friend class BinComparator; |
57 ManagedTileState& managed_state() { return managed_state_; } | 58 ManagedTileState& managed_state() { return managed_state_; } |
58 const ManagedTileState& managed_state() const { return managed_state_; } | 59 const ManagedTileState& managed_state() const { return managed_state_; } |
59 size_t bytes_consumed_if_allocated() const; | 60 size_t bytes_consumed_if_allocated() const; |
| 61 float contents_scale() const { return contents_scale_; } |
60 | 62 |
61 // Normal private methods. | 63 // Normal private methods. |
62 friend class base::RefCounted<Tile>; | 64 friend class base::RefCounted<Tile>; |
63 ~Tile(); | 65 ~Tile(); |
64 | 66 |
65 TileManager* tile_manager_; | 67 TileManager* tile_manager_; |
66 scoped_refptr<PicturePileImpl> picture_pile_; | 68 scoped_refptr<PicturePileImpl> picture_pile_; |
67 gfx::Rect tile_size_; | 69 gfx::Rect tile_size_; |
68 GLenum format_; | 70 GLenum format_; |
69 gfx::Rect rect_inside_picture_; | 71 gfx::Rect rect_inside_picture_; |
| 72 float contents_scale_; |
70 gfx::Rect opaque_rect_; | 73 gfx::Rect opaque_rect_; |
71 | 74 |
72 TilePriority priority_[2]; | 75 TilePriority priority_[2]; |
73 ManagedTileState managed_state_; | 76 ManagedTileState managed_state_; |
74 }; | 77 }; |
75 | 78 |
76 } // namespace cc | 79 } // namespace cc |
77 | 80 |
78 #endif // CC_TILE_H_ | 81 #endif // CC_TILE_H_ |
OLD | NEW |