OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_TILES_PRIORITIZED_TILE_H_ | 5 #ifndef CC_TILES_PRIORITIZED_TILE_H_ |
6 #define CC_TILES_PRIORITIZED_TILE_H_ | 6 #define CC_TILES_PRIORITIZED_TILE_H_ |
7 | 7 |
8 #include "cc/base/cc_export.h" | 8 #include "cc/base/cc_export.h" |
9 #include "cc/playback/raster_source.h" | 9 #include "cc/playback/raster_source.h" |
| 10 #include "cc/tiles/picture_layer_tiling.h" |
10 #include "cc/tiles/tile.h" | 11 #include "cc/tiles/tile.h" |
11 #include "cc/tiles/tile_priority.h" | 12 #include "cc/tiles/tile_priority.h" |
12 | 13 |
13 namespace cc { | 14 namespace cc { |
14 class RasterSource; | 15 class RasterSource; |
15 class PictureLayerTiling; | 16 class PictureLayerTiling; |
16 | 17 |
17 class CC_EXPORT PrioritizedTile { | 18 class CC_EXPORT PrioritizedTile { |
18 public: | 19 public: |
19 // This class is constructed and returned by a |PictureLayerTiling|, and | 20 // This class is constructed and returned by a |PictureLayerTiling|, and |
20 // represents a tile and its priority. | 21 // represents a tile and its priority. |
21 PrioritizedTile(); | 22 PrioritizedTile(); |
22 PrioritizedTile(const PrioritizedTile& other); | 23 PrioritizedTile(Tile* tile, |
23 PrioritizedTile(PrioritizedTile&& other); | 24 const PictureLayerTiling* source_tiling, |
| 25 const TilePriority priority, |
| 26 bool is_occluded); |
24 ~PrioritizedTile(); | 27 ~PrioritizedTile(); |
25 | 28 |
26 PrioritizedTile& operator=(const PrioritizedTile& other); | |
27 PrioritizedTile& operator=(PrioritizedTile&& other); | |
28 | |
29 Tile* tile() const { return tile_; } | 29 Tile* tile() const { return tile_; } |
30 const scoped_refptr<RasterSource>& raster_source() const { | 30 const scoped_refptr<RasterSource>& raster_source() const { |
31 return raster_source_; | 31 return source_tiling_->raster_source(); |
32 } | 32 } |
33 const TilePriority& priority() const { return priority_; } | 33 const TilePriority& priority() const { return priority_; } |
34 bool is_occluded() const { return is_occluded_; } | 34 bool is_occluded() const { return is_occluded_; } |
35 | 35 |
36 void AsValueInto(base::trace_event::TracedValue* value) const; | 36 void AsValueInto(base::trace_event::TracedValue* value) const; |
37 | 37 |
38 private: | 38 private: |
39 friend class PictureLayerTiling; | 39 Tile* tile_ = nullptr; |
40 | 40 const PictureLayerTiling* source_tiling_ = nullptr; |
41 PrioritizedTile(Tile* tile, | |
42 scoped_refptr<RasterSource> raster_source, | |
43 const TilePriority priority, | |
44 bool is_occluded); | |
45 | |
46 Tile* tile_; | |
47 scoped_refptr<RasterSource> raster_source_; | |
48 TilePriority priority_; | 41 TilePriority priority_; |
49 bool is_occluded_; | 42 bool is_occluded_ = false; |
50 }; | 43 }; |
51 | 44 |
52 } // namespace cc | 45 } // namespace cc |
53 | 46 |
54 #endif // CC_TILES_PRIORITIZED_TILE_H_ | 47 #endif // CC_TILES_PRIORITIZED_TILE_H_ |
OLD | NEW |