1 // Copyright 2015 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CC_TILES_PRIORITIZED_TILE_H_
6 #define CC_TILES_PRIORITIZED_TILE_H_
8 #include "cc/cc_export.h"
9 #include "cc/paint/paint_worklet_input.h"
10 #include "cc/raster/raster_source.h"
11 #include "cc/tiles/picture_layer_tiling.h"
12 #include "cc/tiles/tile.h"
13 #include "cc/tiles/tile_priority.h"
17 class PictureLayerTiling;
19 class CC_EXPORT PrioritizedTile {
21 // This class is constructed and returned by a |PictureLayerTiling|, and
22 // represents a tile and its priority.
24 PrioritizedTile(Tile* tile,
25 const PictureLayerTiling* source_tiling,
26 const TilePriority& priority,
28 bool is_process_for_images_only,
29 bool should_decode_checkered_images_for_tile);
32 Tile* tile() const { return tile_; }
33 const scoped_refptr<RasterSource>& raster_source() const {
34 return source_tiling_->raster_source();
36 const PaintWorkletRecordMap& GetPaintWorkletRecords() const {
37 return source_tiling_->GetPaintWorkletRecords();
39 const TilePriority& priority() const { return priority_; }
40 bool is_occluded() const { return is_occluded_; }
41 bool is_process_for_images_only() const {
42 return is_process_for_images_only_;
44 bool should_decode_checkered_images_for_tile() const {
45 return should_decode_checkered_images_for_tile_;
48 void AsValueInto(base::trace_event::TracedValue* value) const;
50 const PictureLayerTiling* source_tiling() const { return source_tiling_; }
53 Tile* tile_ = nullptr;
54 const PictureLayerTiling* source_tiling_ = nullptr;
55 TilePriority priority_;
56 bool is_occluded_ = false;
57 bool is_process_for_images_only_ = false;
58 bool should_decode_checkered_images_for_tile_ = false;
63 #endif // CC_TILES_PRIORITIZED_TILE_H_