| 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" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 | 67 |
| 68 // Remove all tilings. | 68 // Remove all tilings. |
| 69 void RemoveAllTilings(); | 69 void RemoveAllTilings(); |
| 70 | 70 |
| 71 // Remove one tiling. | 71 // Remove one tiling. |
| 72 void Remove(PictureLayerTiling* tiling); | 72 void Remove(PictureLayerTiling* tiling); |
| 73 | 73 |
| 74 // Remove all tiles; keep all tilings. | 74 // Remove all tiles; keep all tilings. |
| 75 void RemoveAllTiles(); | 75 void RemoveAllTiles(); |
| 76 | 76 |
| 77 void DidBecomeActive(); | |
| 78 void DidBecomeRecycled(); | |
| 79 | |
| 80 // For a given rect, iterates through tiles that can fill it. If no | 77 // For a given rect, iterates through tiles that can fill it. If no |
| 81 // set of tiles with resources can fill the rect, then it will iterate | 78 // set of tiles with resources can fill the rect, then it will iterate |
| 82 // through null tiles with valid geometry_rect() until the rect is full. | 79 // through null tiles with valid geometry_rect() until the rect is full. |
| 83 // If all tiles have resources, the union of all geometry_rects will | 80 // If all tiles have resources, the union of all geometry_rects will |
| 84 // exactly fill rect with no overlap. | 81 // exactly fill rect with no overlap. |
| 85 class CC_EXPORT CoverageIterator { | 82 class CC_EXPORT CoverageIterator { |
| 86 public: | 83 public: |
| 87 CoverageIterator(const PictureLayerTilingSet* set, | 84 CoverageIterator(const PictureLayerTilingSet* set, |
| 88 float contents_scale, | 85 float contents_scale, |
| 89 const gfx::Rect& content_rect, | 86 const gfx::Rect& content_rect, |
| 90 float ideal_contents_scale); | 87 float ideal_contents_scale); |
| 91 ~CoverageIterator(); | 88 ~CoverageIterator(); |
| 92 | 89 |
| 93 // Visible rect (no borders), always in the space of rect, | 90 // Visible rect (no borders), always in the space of rect, |
| 94 // regardless of the relative contents scale of the tiling. | 91 // regardless of the relative contents scale of the tiling. |
| 95 gfx::Rect geometry_rect() const; | 92 gfx::Rect geometry_rect() const; |
| 96 // Texture rect (in texels) for geometry_rect | 93 // Texture rect (in texels) for geometry_rect |
| 97 gfx::RectF texture_rect() const; | 94 gfx::RectF texture_rect() const; |
| 98 // Texture size in texels | 95 // Texture size in texels |
| 99 gfx::Size texture_size() const; | 96 gfx::Size texture_size() const; |
| 100 | 97 |
| 101 Tile* operator->() const; | 98 Tile* operator->() const; |
| 102 Tile* operator*() const; | 99 Tile* operator*() const; |
| 103 | 100 |
| 104 CoverageIterator& operator++(); | 101 CoverageIterator& operator++(); |
| 105 operator bool() const; | 102 operator bool() const; |
| 106 | 103 |
| 107 PictureLayerTiling* CurrentTiling(); | 104 TileResolution resolution() const; |
| 105 PictureLayerTiling* CurrentTiling() const; |
| 108 | 106 |
| 109 private: | 107 private: |
| 110 int NextTiling() const; | 108 int NextTiling() const; |
| 111 | 109 |
| 112 const PictureLayerTilingSet* set_; | 110 const PictureLayerTilingSet* set_; |
| 113 float contents_scale_; | 111 float contents_scale_; |
| 114 float ideal_contents_scale_; | 112 float ideal_contents_scale_; |
| 115 PictureLayerTiling::CoverageIterator tiling_iter_; | 113 PictureLayerTiling::CoverageIterator tiling_iter_; |
| 116 int current_tiling_; | 114 int current_tiling_; |
| 117 int ideal_tiling_; | 115 int ideal_tiling_; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 131 gfx::Size layer_bounds_; | 129 gfx::Size layer_bounds_; |
| 132 ScopedPtrVector<PictureLayerTiling> tilings_; | 130 ScopedPtrVector<PictureLayerTiling> tilings_; |
| 133 | 131 |
| 134 friend class Iterator; | 132 friend class Iterator; |
| 135 DISALLOW_COPY_AND_ASSIGN(PictureLayerTilingSet); | 133 DISALLOW_COPY_AND_ASSIGN(PictureLayerTilingSet); |
| 136 }; | 134 }; |
| 137 | 135 |
| 138 } // namespace cc | 136 } // namespace cc |
| 139 | 137 |
| 140 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_ | 138 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_ |
| OLD | NEW |