Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(335)

Side by Side Diff: cc/tiles/tile.h

Issue 2564433003: Add PictureLayerTiling pointer to Tile (Closed)
Patch Set: rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/tiles/picture_layer_tiling_unittest.cc ('k') | cc/tiles/tile.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_TILES_TILE_H_ 5 #ifndef CC_TILES_TILE_H_
6 #define CC_TILES_TILE_H_ 6 #define CC_TILES_TILE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "cc/raster/tile_task.h" 13 #include "cc/raster/tile_task.h"
14 #include "cc/tiles/tile_draw_info.h" 14 #include "cc/tiles/tile_draw_info.h"
15 #include "ui/gfx/geometry/rect.h" 15 #include "ui/gfx/geometry/rect.h"
16 #include "ui/gfx/geometry/size.h" 16 #include "ui/gfx/geometry/size.h"
17 17
18 namespace cc { 18 namespace cc {
19 19
20 class PictureLayerTiling;
20 class TileManager; 21 class TileManager;
21 22
22 class CC_EXPORT Tile { 23 class CC_EXPORT Tile {
23 public: 24 public:
24 class CC_EXPORT Deleter { 25 class CC_EXPORT Deleter {
25 public: 26 public:
26 void operator()(Tile* tile) const; 27 void operator()(Tile* tile) const;
27 }; 28 };
28 29
29 class CC_EXPORT CreateInfo { 30 class CC_EXPORT CreateInfo {
30 public: 31 public:
32 const PictureLayerTiling* tiling;
31 int tiling_i_index; 33 int tiling_i_index;
32 int tiling_j_index; 34 int tiling_j_index;
33 gfx::Rect enclosing_layer_rect; 35 gfx::Rect enclosing_layer_rect;
34 gfx::Rect content_rect; 36 gfx::Rect content_rect;
35 gfx::SizeF raster_scales; 37 gfx::SizeF raster_scales;
36 38
37 CreateInfo(int tiling_i_index, 39 CreateInfo(const PictureLayerTiling* tiling,
40 int tiling_i_index,
38 int tiling_j_index, 41 int tiling_j_index,
39 const gfx::Rect& enclosing_layer_rect, 42 const gfx::Rect& enclosing_layer_rect,
40 const gfx::Rect& content_rect, 43 const gfx::Rect& content_rect,
41 const gfx::SizeF& raster_scales) 44 const gfx::SizeF& raster_scales)
42 : tiling_i_index(tiling_i_index), 45 : tiling(tiling),
46 tiling_i_index(tiling_i_index),
43 tiling_j_index(tiling_j_index), 47 tiling_j_index(tiling_j_index),
44 enclosing_layer_rect(enclosing_layer_rect), 48 enclosing_layer_rect(enclosing_layer_rect),
45 content_rect(content_rect), 49 content_rect(content_rect),
46 raster_scales(raster_scales) {} 50 raster_scales(raster_scales) {}
47 }; 51 };
48 52
49 enum TileRasterFlags { USE_PICTURE_ANALYSIS = 1 << 0, IS_OPAQUE = 1 << 1 }; 53 enum TileRasterFlags { USE_PICTURE_ANALYSIS = 1 << 0, IS_OPAQUE = 1 << 1 };
50 54
51 typedef uint64_t Id; 55 typedef uint64_t Id;
52 56
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 110
107 bool HasRasterTask() const { return !!raster_task_.get(); } 111 bool HasRasterTask() const { return !!raster_task_.get(); }
108 112
109 void set_solid_color_analysis_performed(bool performed) { 113 void set_solid_color_analysis_performed(bool performed) {
110 is_solid_color_analysis_performed_ = performed; 114 is_solid_color_analysis_performed_ = performed;
111 } 115 }
112 bool is_solid_color_analysis_performed() const { 116 bool is_solid_color_analysis_performed() const {
113 return is_solid_color_analysis_performed_; 117 return is_solid_color_analysis_performed_;
114 } 118 }
115 119
120 const PictureLayerTiling* tiling() const { return tiling_; }
121 void set_tiling(const PictureLayerTiling* tiling) { tiling_ = tiling; }
122
116 private: 123 private:
117 friend class TileManager; 124 friend class TileManager;
118 friend class FakeTileManager; 125 friend class FakeTileManager;
119 friend class FakePictureLayerImpl; 126 friend class FakePictureLayerImpl;
120 127
121 // Methods called by by tile manager. 128 // Methods called by by tile manager.
122 Tile(TileManager* tile_manager, 129 Tile(TileManager* tile_manager,
123 const CreateInfo& info, 130 const CreateInfo& info,
124 int layer_id, 131 int layer_id,
125 int source_frame_number, 132 int source_frame_number,
126 int flags); 133 int flags);
127 ~Tile(); 134 ~Tile();
128 135
129 TileManager* const tile_manager_; 136 TileManager* const tile_manager_;
137 const PictureLayerTiling* tiling_;
130 const gfx::Rect content_rect_; 138 const gfx::Rect content_rect_;
131 const gfx::Rect enclosing_layer_rect_; 139 const gfx::Rect enclosing_layer_rect_;
132 const gfx::SizeF raster_scales_; 140 const gfx::SizeF raster_scales_;
133 141
134 TileDrawInfo draw_info_; 142 TileDrawInfo draw_info_;
135 143
136 const int layer_id_; 144 const int layer_id_;
137 const int source_frame_number_; 145 const int source_frame_number_;
138 const int flags_; 146 const int flags_;
139 const int tiling_i_index_; 147 const int tiling_i_index_;
(...skipping 14 matching lines...) Expand all
154 scoped_refptr<TileTask> raster_task_; 162 scoped_refptr<TileTask> raster_task_;
155 163
156 DISALLOW_COPY_AND_ASSIGN(Tile); 164 DISALLOW_COPY_AND_ASSIGN(Tile);
157 }; 165 };
158 166
159 using ScopedTilePtr = std::unique_ptr<Tile, Tile::Deleter>; 167 using ScopedTilePtr = std::unique_ptr<Tile, Tile::Deleter>;
160 168
161 } // namespace cc 169 } // namespace cc
162 170
163 #endif // CC_TILES_TILE_H_ 171 #endif // CC_TILES_TILE_H_
OLDNEW
« no previous file with comments | « cc/tiles/picture_layer_tiling_unittest.cc ('k') | cc/tiles/tile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698