| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 void DidBecomeActive(); | 65 void DidBecomeActive(); |
| 66 | 66 |
| 67 // For a given rect, iterates through tiles that can fill it. If no | 67 // For a given rect, iterates through tiles that can fill it. If no |
| 68 // set of tiles with resources can fill the rect, then it will iterate | 68 // set of tiles with resources can fill the rect, then it will iterate |
| 69 // through null tiles with valid geometry_rect() until the rect is full. | 69 // through null tiles with valid geometry_rect() until the rect is full. |
| 70 // If all tiles have resources, the union of all geometry_rects will | 70 // If all tiles have resources, the union of all geometry_rects will |
| 71 // exactly fill rect with no overlap. | 71 // exactly fill rect with no overlap. |
| 72 class CC_EXPORT Iterator { | 72 class CC_EXPORT Iterator { |
| 73 public: | 73 public: |
| 74 Iterator( | 74 Iterator(const PictureLayerTilingSet* set, |
| 75 const PictureLayerTilingSet* set, | |
| 76 float contents_scale, | 75 float contents_scale, |
| 77 gfx::Rect content_rect, | 76 gfx::Rect content_rect, |
| 78 float ideal_contents_scale); | 77 float ideal_contents_scale, |
| 78 PictureLayerTiling::LayerDeviceAlignment layerDeviceAlignment); |
| 79 ~Iterator(); | 79 ~Iterator(); |
| 80 | 80 |
| 81 // Visible rect (no borders), always in the space of rect, | 81 // Visible rect (no borders), always in the space of rect, |
| 82 // regardless of the relative contents scale of the tiling. | 82 // regardless of the relative contents scale of the tiling. |
| 83 gfx::Rect geometry_rect() const; | 83 gfx::Rect geometry_rect() const; |
| 84 // Texture rect (in texels) for geometry_rect | 84 // Texture rect (in texels) for geometry_rect |
| 85 gfx::RectF texture_rect() const; | 85 gfx::RectF texture_rect() const; |
| 86 // Texture size in texels | 86 // Texture size in texels |
| 87 gfx::Size texture_size() const; | 87 gfx::Size texture_size() const; |
| 88 | 88 |
| 89 Tile* operator->() const; | 89 Tile* operator->() const; |
| 90 Tile* operator*() const; | 90 Tile* operator*() const; |
| 91 | 91 |
| 92 Iterator& operator++(); | 92 Iterator& operator++(); |
| 93 operator bool() const; | 93 operator bool() const; |
| 94 | 94 |
| 95 PictureLayerTiling* CurrentTiling(); | 95 PictureLayerTiling* CurrentTiling(); |
| 96 | 96 |
| 97 private: | 97 private: |
| 98 int NextTiling() const; | 98 int NextTiling() const; |
| 99 | 99 |
| 100 const PictureLayerTilingSet* set_; | 100 const PictureLayerTilingSet* set_; |
| 101 float contents_scale_; | 101 float contents_scale_; |
| 102 float ideal_contents_scale_; | 102 float ideal_contents_scale_; |
| 103 PictureLayerTiling::LayerDeviceAlignment layer_device_alignment_; |
| 103 PictureLayerTiling::Iterator tiling_iter_; | 104 PictureLayerTiling::Iterator tiling_iter_; |
| 104 int current_tiling_; | 105 int current_tiling_; |
| 105 int ideal_tiling_; | 106 int ideal_tiling_; |
| 106 | 107 |
| 107 Region current_region_; | 108 Region current_region_; |
| 108 Region missing_region_; | 109 Region missing_region_; |
| 109 Region::Iterator region_iter_; | 110 Region::Iterator region_iter_; |
| 110 }; | 111 }; |
| 111 | 112 |
| 112 private: | 113 private: |
| 113 PictureLayerTilingClient* client_; | 114 PictureLayerTilingClient* client_; |
| 114 gfx::Size layer_bounds_; | 115 gfx::Size layer_bounds_; |
| 115 ScopedPtrVector<PictureLayerTiling> tilings_; | 116 ScopedPtrVector<PictureLayerTiling> tilings_; |
| 116 | 117 |
| 117 friend class Iterator; | 118 friend class Iterator; |
| 118 }; | 119 }; |
| 119 | 120 |
| 120 } // namespace cc | 121 } // namespace cc |
| 121 | 122 |
| 122 #endif // CC_PICTURE_LAYER_TILING_SET_H_ | 123 #endif // CC_PICTURE_LAYER_TILING_SET_H_ |
| OLD | NEW |