| 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 <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "cc/base/region.h" | 11 #include "cc/base/region.h" |
| 12 #include "cc/base/scoped_ptr_vector.h" | 12 #include "cc/base/scoped_ptr_vector.h" |
| 13 #include "cc/resources/picture_layer_tiling.h" | 13 #include "cc/resources/picture_layer_tiling.h" |
| 14 #include "ui/gfx/geometry/size.h" | 14 #include "ui/gfx/geometry/size.h" |
| 15 | 15 |
| 16 namespace base { | 16 namespace base { |
| 17 namespace trace_event { | 17 namespace trace_event { |
| 18 class TracedValue; | 18 class TracedValue; |
| 19 } | 19 } |
| 20 | |
| 21 // TODO(ssid): remove these aliases after the tracing clients are moved to the | |
| 22 // new trace_event namespace. See crbug.com/451032. ETA: March 2015 | |
| 23 namespace debug { | |
| 24 using ::base::trace_event::TracedValue; | |
| 25 } | 20 } |
| 26 } // namespace base | |
| 27 | 21 |
| 28 namespace cc { | 22 namespace cc { |
| 29 | 23 |
| 30 class CC_EXPORT PictureLayerTilingSet { | 24 class CC_EXPORT PictureLayerTilingSet { |
| 31 public: | 25 public: |
| 32 enum TilingRangeType { | 26 enum TilingRangeType { |
| 33 HIGHER_THAN_HIGH_RES, | 27 HIGHER_THAN_HIGH_RES, |
| 34 HIGH_RES, | 28 HIGH_RES, |
| 35 BETWEEN_HIGH_AND_LOW_RES, | 29 BETWEEN_HIGH_AND_LOW_RES, |
| 36 LOW_RES, | 30 LOW_RES, |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 float ideal_contents_scale_; | 144 float ideal_contents_scale_; |
| 151 PictureLayerTiling::CoverageIterator tiling_iter_; | 145 PictureLayerTiling::CoverageIterator tiling_iter_; |
| 152 int current_tiling_; | 146 int current_tiling_; |
| 153 int ideal_tiling_; | 147 int ideal_tiling_; |
| 154 | 148 |
| 155 Region current_region_; | 149 Region current_region_; |
| 156 Region missing_region_; | 150 Region missing_region_; |
| 157 Region::Iterator region_iter_; | 151 Region::Iterator region_iter_; |
| 158 }; | 152 }; |
| 159 | 153 |
| 160 void AsValueInto(base::debug::TracedValue* array) const; | 154 void AsValueInto(base::trace_event::TracedValue* array) const; |
| 161 size_t GPUMemoryUsageInBytes() const; | 155 size_t GPUMemoryUsageInBytes() const; |
| 162 | 156 |
| 163 TilingRange GetTilingRange(TilingRangeType type) const; | 157 TilingRange GetTilingRange(TilingRangeType type) const; |
| 164 | 158 |
| 165 private: | 159 private: |
| 166 explicit PictureLayerTilingSet( | 160 explicit PictureLayerTilingSet( |
| 167 PictureLayerTilingClient* client, | 161 PictureLayerTilingClient* client, |
| 168 size_t max_tiles_for_interest_area, | 162 size_t max_tiles_for_interest_area, |
| 169 float skewport_target_time_in_seconds, | 163 float skewport_target_time_in_seconds, |
| 170 int skewport_extrapolation_limit_in_content_pixels); | 164 int skewport_extrapolation_limit_in_content_pixels); |
| 171 | 165 |
| 172 // Remove one tiling. | 166 // Remove one tiling. |
| 173 void Remove(PictureLayerTiling* tiling); | 167 void Remove(PictureLayerTiling* tiling); |
| 174 | 168 |
| 175 ScopedPtrVector<PictureLayerTiling> tilings_; | 169 ScopedPtrVector<PictureLayerTiling> tilings_; |
| 176 | 170 |
| 177 const size_t max_tiles_for_interest_area_; | 171 const size_t max_tiles_for_interest_area_; |
| 178 const float skewport_target_time_in_seconds_; | 172 const float skewport_target_time_in_seconds_; |
| 179 const int skewport_extrapolation_limit_in_content_pixels_; | 173 const int skewport_extrapolation_limit_in_content_pixels_; |
| 180 PictureLayerTilingClient* client_; | 174 PictureLayerTilingClient* client_; |
| 181 | 175 |
| 182 friend class Iterator; | 176 friend class Iterator; |
| 183 DISALLOW_COPY_AND_ASSIGN(PictureLayerTilingSet); | 177 DISALLOW_COPY_AND_ASSIGN(PictureLayerTilingSet); |
| 184 }; | 178 }; |
| 185 | 179 |
| 186 } // namespace cc | 180 } // namespace cc |
| 187 | 181 |
| 188 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_ | 182 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_ |
| OLD | NEW |