Chromium Code Reviews| 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" |
| 11 #include "ui/gfx/size.h" | 11 #include "ui/gfx/size.h" |
| 12 | 12 |
| 13 namespace cc { | 13 namespace cc { |
| 14 | 14 |
| 15 class CC_EXPORT PictureLayerTilingSet { | 15 class CC_EXPORT PictureLayerTilingSet { |
| 16 public: | 16 public: |
| 17 enum TilingRangeType { | 17 enum TilingRangeType { |
| 18 HIGHER_THAN_HIGH_RES, | 18 HIGHER_THAN_HIGH_RES, |
| 19 HIGH_RES, | 19 HIGH_RES, |
| 20 BETWEEN_HIGH_AND_LOW_RES, | 20 BETWEEN_HIGH_AND_LOW_RES, |
| 21 LOW_RES, | 21 LOW_RES, |
| 22 LOWER_THAN_LOW_RES | 22 LOWER_THAN_LOW_RES |
| 23 }; | 23 }; |
| 24 struct TilingRange { | 24 struct TilingRange { |
| 25 TilingRange(size_t start, size_t end) : start(start), end(end) {} | 25 TilingRange(size_t start, size_t end) : start(start), end(end) {} |
| 26 | 26 |
| 27 bool IsIndexWithinRange(size_t index) const { | |
| 28 return index >= start && index < end; | |
| 29 } | |
|
reveman
2014/08/01 17:54:47
I don't think we need this. I can't see a reason w
vmpstr
2014/08/01 19:39:50
We iterate two of the ranges in reverse order, so
| |
| 30 | |
| 27 size_t start; | 31 size_t start; |
| 28 size_t end; | 32 size_t end; |
| 29 }; | 33 }; |
| 30 | 34 |
| 31 PictureLayerTilingSet(PictureLayerTilingClient* client, | 35 PictureLayerTilingSet(PictureLayerTilingClient* client, |
| 32 const gfx::Size& layer_bounds); | 36 const gfx::Size& layer_bounds); |
| 33 ~PictureLayerTilingSet(); | 37 ~PictureLayerTilingSet(); |
| 34 | 38 |
| 35 void SetClient(PictureLayerTilingClient* client); | 39 void SetClient(PictureLayerTilingClient* client); |
| 36 const PictureLayerTilingClient* client() const { return client_; } | 40 const PictureLayerTilingClient* client() const { return client_; } |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 125 gfx::Size layer_bounds_; | 129 gfx::Size layer_bounds_; |
| 126 ScopedPtrVector<PictureLayerTiling> tilings_; | 130 ScopedPtrVector<PictureLayerTiling> tilings_; |
| 127 | 131 |
| 128 friend class Iterator; | 132 friend class Iterator; |
| 129 DISALLOW_COPY_AND_ASSIGN(PictureLayerTilingSet); | 133 DISALLOW_COPY_AND_ASSIGN(PictureLayerTilingSet); |
| 130 }; | 134 }; |
| 131 | 135 |
| 132 } // namespace cc | 136 } // namespace cc |
| 133 | 137 |
| 134 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_ | 138 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_ |
| OLD | NEW |