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_PICTURE_LAYER_TILING_H_ | 5 #ifndef CC_PICTURE_LAYER_TILING_H_ |
6 #define CC_PICTURE_LAYER_TILING_H_ | 6 #define CC_PICTURE_LAYER_TILING_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/hash_tables.h" | 9 #include "base/hash_tables.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 float contents_scale() const { return contents_scale_; } | 58 float contents_scale() const { return contents_scale_; } |
59 | 59 |
60 std::vector<Tile*> AllTilesForTesting() const { | 60 std::vector<Tile*> AllTilesForTesting() const { |
61 std::vector<Tile*> all_tiles; | 61 std::vector<Tile*> all_tiles; |
62 for (TileMap::const_iterator it = tiles_.begin(); | 62 for (TileMap::const_iterator it = tiles_.begin(); |
63 it != tiles_.end(); ++it) | 63 it != tiles_.end(); ++it) |
64 all_tiles.push_back(it->second); | 64 all_tiles.push_back(it->second); |
65 return all_tiles; | 65 return all_tiles; |
66 } | 66 } |
67 | 67 |
| 68 enum LayerDeviceAlignment { |
| 69 LayerDeviceAlignmentUnknown, |
| 70 LayerAlignedToDevice, |
| 71 LayerNotAlignedToDevice, |
| 72 }; |
| 73 |
68 // Iterate over all tiles to fill content_rect. Even if tiles are invalid | 74 // Iterate over all tiles to fill content_rect. Even if tiles are invalid |
69 // (i.e. no valid resource) this tiling should still iterate over them. | 75 // (i.e. no valid resource) this tiling should still iterate over them. |
70 // The union of all geometry_rect calls for each element iterated over should | 76 // The union of all geometry_rect calls for each element iterated over should |
71 // exactly equal content_rect and no two geometry_rects should intersect. | 77 // exactly equal content_rect and no two geometry_rects should intersect. |
72 class CC_EXPORT Iterator { | 78 class CC_EXPORT Iterator { |
73 public: | 79 public: |
74 Iterator(); | 80 Iterator(); |
75 Iterator( | 81 Iterator(const PictureLayerTiling* tiling, |
76 const PictureLayerTiling* tiling, | |
77 float dest_scale, | 82 float dest_scale, |
78 gfx::Rect rect); | 83 gfx::Rect rect, |
| 84 LayerDeviceAlignment layerDeviceAlignment); |
79 ~Iterator(); | 85 ~Iterator(); |
80 | 86 |
81 // Visible rect (no borders), always in the space of content_rect, | 87 // Visible rect (no borders), always in the space of content_rect, |
82 // regardless of the contents scale of the tiling. | 88 // regardless of the contents scale of the tiling. |
83 gfx::Rect geometry_rect() const; | 89 gfx::Rect geometry_rect() const; |
84 // Texture rect (in texels) for geometry_rect | 90 // Texture rect (in texels) for geometry_rect |
85 gfx::RectF texture_rect() const; | 91 gfx::RectF texture_rect() const; |
86 gfx::Size texture_size() const; | 92 gfx::Size texture_size() const; |
87 | 93 |
88 // Full rect (including borders) of the current tile, always in the space | 94 // Full rect (including borders) of the current tile, always in the space |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 TileResolution resolution_; | 162 TileResolution resolution_; |
157 int last_source_frame_number_; | 163 int last_source_frame_number_; |
158 double last_impl_frame_time_; | 164 double last_impl_frame_time_; |
159 | 165 |
160 friend class Iterator; | 166 friend class Iterator; |
161 }; | 167 }; |
162 | 168 |
163 } // namespace cc | 169 } // namespace cc |
164 | 170 |
165 #endif // CC_PICTURE_LAYER_TILING_H_ | 171 #endif // CC_PICTURE_LAYER_TILING_H_ |
OLD | NEW |