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

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

Issue 374653003: Track occlusion per tree on Tile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months 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 | Annotate | Revision Log
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_RESOURCES_TILE_H_ 5 #ifndef CC_RESOURCES_TILE_H_
6 #define CC_RESOURCES_TILE_H_ 6 #define CC_RESOURCES_TILE_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/scoped_vector.h" 10 #include "base/memory/scoped_vector.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 RasterMode DetermineOverallRasterMode() const; 121 RasterMode DetermineOverallRasterMode() const;
122 122
123 // Functionality used in tests. 123 // Functionality used in tests.
124 RasterMode GetRasterModeForTesting() const { 124 RasterMode GetRasterModeForTesting() const {
125 return managed_state().raster_mode; 125 return managed_state().raster_mode;
126 } 126 }
127 ManagedTileState::TileVersion& GetTileVersionForTesting(RasterMode mode) { 127 ManagedTileState::TileVersion& GetTileVersionForTesting(RasterMode mode) {
128 return managed_state_.tile_versions[mode]; 128 return managed_state_.tile_versions[mode];
129 } 129 }
130 130
131 void set_is_occluded(bool is_occluded) { is_occluded_ = is_occluded; } 131 void set_is_occluded(WhichTree tree, bool is_occluded) {
132 bool is_occluded() const { return is_occluded_; } 132 switch (tree) {
133 case ACTIVE_TREE:
134 is_occluded_on_active_tree_ = is_occluded;
135 break;
136 case PENDING_TREE:
137 is_occluded_on_pending_tree_ = is_occluded;
138 break;
139 default:
danakj 2014/07/07 19:26:29 don't use default: for enums, then we don't get co
140 NOTREACHED();
141 return;
142 }
143 }
144
145 bool is_occluded(WhichTree tree) const {
146 switch (tree) {
147 case ACTIVE_TREE:
148 return is_occluded_on_active_tree_;
enne (OOO) 2014/07/07 19:49:31 Should is_occluded just go on TilePriority so you
danakj 2014/07/07 20:08:04 FWIW, she did that originally but with vlad's new
149 case PENDING_TREE:
150 return is_occluded_on_pending_tree_;
151 default:
152 NOTREACHED();
danakj 2014/07/07 19:26:29 remove default: move this below the switch or alt
jbedley 2014/07/07 20:25:13 Done.
153 return false;
154 }
155 }
133 156
134 private: 157 private:
135 friend class TileManager; 158 friend class TileManager;
136 friend class PrioritizedTileSet; 159 friend class PrioritizedTileSet;
137 friend class FakeTileManager; 160 friend class FakeTileManager;
138 friend class BinComparator; 161 friend class BinComparator;
139 friend class FakePictureLayerImpl; 162 friend class FakePictureLayerImpl;
140 163
141 // Methods called by by tile manager. 164 // Methods called by by tile manager.
142 Tile(TileManager* tile_manager, 165 Tile(TileManager* tile_manager,
(...skipping 10 matching lines...) Expand all
153 ManagedTileState& managed_state() { return managed_state_; } 176 ManagedTileState& managed_state() { return managed_state_; }
154 const ManagedTileState& managed_state() const { return managed_state_; } 177 const ManagedTileState& managed_state() const { return managed_state_; }
155 RasterMode DetermineRasterModeForResolution(TileResolution resolution) const; 178 RasterMode DetermineRasterModeForResolution(TileResolution resolution) const;
156 179
157 TileManager* tile_manager_; 180 TileManager* tile_manager_;
158 scoped_refptr<PicturePileImpl> picture_pile_; 181 scoped_refptr<PicturePileImpl> picture_pile_;
159 gfx::Rect tile_size_; 182 gfx::Rect tile_size_;
160 gfx::Rect content_rect_; 183 gfx::Rect content_rect_;
161 float contents_scale_; 184 float contents_scale_;
162 gfx::Rect opaque_rect_; 185 gfx::Rect opaque_rect_;
163 bool is_occluded_; 186 bool is_occluded_on_active_tree_;
187 bool is_occluded_on_pending_tree_;
164 188
165 TilePriority priority_[NUM_TREES]; 189 TilePriority priority_[NUM_TREES];
166 ManagedTileState managed_state_; 190 ManagedTileState managed_state_;
167 int layer_id_; 191 int layer_id_;
168 int source_frame_number_; 192 int source_frame_number_;
169 int flags_; 193 int flags_;
170 194
171 Id id_; 195 Id id_;
172 static Id s_next_id_; 196 static Id s_next_id_;
173 197
174 DISALLOW_COPY_AND_ASSIGN(Tile); 198 DISALLOW_COPY_AND_ASSIGN(Tile);
175 }; 199 };
176 200
177 } // namespace cc 201 } // namespace cc
178 202
179 #endif // CC_RESOURCES_TILE_H_ 203 #endif // CC_RESOURCES_TILE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698