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_SET_H_ | 5 #ifndef CC_PICTURE_LAYER_TILING_SET_H_ |
6 #define CC_PICTURE_LAYER_TILING_SET_H_ | 6 #define CC_PICTURE_LAYER_TILING_SET_H_ |
7 | 7 |
8 #include "cc/picture_layer_tiling.h" | 8 #include "cc/picture_layer_tiling.h" |
9 #include "cc/region.h" | 9 #include "cc/region.h" |
10 #include "cc/scoped_ptr_vector.h" | 10 #include "cc/scoped_ptr_vector.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 const gfx::Transform& current_screen_transform, | 45 const gfx::Transform& current_screen_transform, |
46 double time_delta); | 46 double time_delta); |
47 | 47 |
48 // For a given rect, iterates through tiles that can fill it. If no | 48 // For a given rect, iterates through tiles that can fill it. If no |
49 // set of tiles with resources can fill the rect, then it will iterate | 49 // set of tiles with resources can fill the rect, then it will iterate |
50 // through null tiles with valid geometry_rect() until the rect is full. | 50 // through null tiles with valid geometry_rect() until the rect is full. |
51 // If all tiles have resources, the union of all geometry_rects will | 51 // If all tiles have resources, the union of all geometry_rects will |
52 // exactly fill rect with no overlap. | 52 // exactly fill rect with no overlap. |
53 class CC_EXPORT Iterator { | 53 class CC_EXPORT Iterator { |
54 public: | 54 public: |
55 Iterator(PictureLayerTilingSet* set, float contents_scale, gfx::Rect rect); | 55 Iterator( |
| 56 const PictureLayerTilingSet* set, |
| 57 float contents_scale, |
| 58 gfx::Rect rect); |
56 ~Iterator(); | 59 ~Iterator(); |
57 | 60 |
58 // Visible rect (no borders), always in the space of rect, | 61 // Visible rect (no borders), always in the space of rect, |
59 // regardless of the relative contents scale of the tiling. | 62 // regardless of the relative contents scale of the tiling. |
60 gfx::Rect geometry_rect() const; | 63 gfx::Rect geometry_rect() const; |
61 // Texture rect (in texels) for geometry_rect | 64 // Texture rect (in texels) for geometry_rect |
62 gfx::RectF texture_rect() const; | 65 gfx::RectF texture_rect() const; |
63 // Texture size in texels | 66 // Texture size in texels |
64 gfx::Size texture_size() const; | 67 gfx::Size texture_size() const; |
65 | 68 |
66 Tile* operator->() const; | 69 Tile* operator->() const; |
67 Tile* operator*() const; | 70 Tile* operator*() const; |
68 | 71 |
69 Iterator& operator++(); | 72 Iterator& operator++(); |
70 operator bool() const; | 73 operator bool() const; |
71 | 74 |
72 private: | 75 private: |
73 PictureLayerTilingSet* set_; | 76 const PictureLayerTilingSet* set_; |
74 float contents_scale_; | 77 float contents_scale_; |
75 PictureLayerTiling::Iterator tiling_iter_; | 78 PictureLayerTiling::Iterator tiling_iter_; |
76 int current_tiling_; | 79 int current_tiling_; |
77 | 80 |
78 Region current_region_; | 81 Region current_region_; |
79 Region missing_region_; | 82 Region missing_region_; |
80 Region::Iterator region_iter_; | 83 Region::Iterator region_iter_; |
81 }; | 84 }; |
82 | 85 |
83 private: | 86 private: |
84 PictureLayerTilingClient* client_; | 87 PictureLayerTilingClient* client_; |
85 gfx::Size layer_bounds_; | 88 gfx::Size layer_bounds_; |
86 ScopedPtrVector<PictureLayerTiling> tilings_; | 89 ScopedPtrVector<PictureLayerTiling> tilings_; |
87 Region invalidation_; | 90 Region invalidation_; |
88 | 91 |
89 friend class Iterator; | 92 friend class Iterator; |
90 }; | 93 }; |
91 | 94 |
92 } // namespace cc | 95 } // namespace cc |
93 | 96 |
94 #endif // CC_PICTURE_LAYER_TILING_SET_H_ | 97 #endif // CC_PICTURE_LAYER_TILING_SET_H_ |
OLD | NEW |