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

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

Issue 1168903003: cc: Fix size_t to int truncations in tiles/ and trees/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « cc/tiles/tile.cc ('k') | cc/tiles/tile_manager.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_MANAGER_H_ 5 #ifndef CC_TILES_TILE_MANAGER_H_
6 #define CC_TILES_TILE_MANAGER_H_ 6 #define CC_TILES_TILE_MANAGER_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <queue> 9 #include <queue>
10 #include <set> 10 #include <set>
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 206
207 void AssignGpuMemoryToTiles( 207 void AssignGpuMemoryToTiles(
208 RasterTilePriorityQueue* raster_priority_queue, 208 RasterTilePriorityQueue* raster_priority_queue,
209 size_t scheduled_raser_task_limit, 209 size_t scheduled_raser_task_limit,
210 PrioritizedTileVector* tiles_that_need_to_be_rasterized); 210 PrioritizedTileVector* tiles_that_need_to_be_rasterized);
211 211
212 private: 212 private:
213 class MemoryUsage { 213 class MemoryUsage {
214 public: 214 public:
215 MemoryUsage(); 215 MemoryUsage();
216 MemoryUsage(int64 memory_bytes, int resource_count); 216 MemoryUsage(size_t memory_bytes, size_t resource_count);
danakj 2015/06/09 20:16:45 Why are these size_t then if the stuff inside won'
vmpstr 2015/06/09 20:27:33 The public interface to MemoryUsage uses size_t, s
217 217
218 static MemoryUsage FromConfig(const gfx::Size& size, ResourceFormat format); 218 static MemoryUsage FromConfig(const gfx::Size& size, ResourceFormat format);
219 static MemoryUsage FromTile(const Tile* tile); 219 static MemoryUsage FromTile(const Tile* tile);
220 220
221 MemoryUsage& operator+=(const MemoryUsage& other); 221 MemoryUsage& operator+=(const MemoryUsage& other);
222 MemoryUsage& operator-=(const MemoryUsage& other); 222 MemoryUsage& operator-=(const MemoryUsage& other);
223 MemoryUsage operator-(const MemoryUsage& other); 223 MemoryUsage operator-(const MemoryUsage& other);
224 224
225 bool Exceeds(const MemoryUsage& limit) const; 225 bool Exceeds(const MemoryUsage& limit) const;
226 int64 memory_bytes() const { return memory_bytes_; } 226 size_t memory_bytes() const {
danakj 2015/06/09 20:29:42 Can you make this return an int(64?) instead then?
vmpstr 2015/06/09 21:00:55 Done.
227 // This is used for HUD layers / logging, so we can just static_cast here.
228 DCHECK_GE(memory_bytes_, 0);
229 return static_cast<size_t>(memory_bytes_);
230 }
227 231
228 private: 232 private:
229 int64 memory_bytes_; 233 int64 memory_bytes_;
230 int resource_count_; 234 int resource_count_;
231 }; 235 };
232 236
233 void OnImageDecodeTaskCompleted(int layer_id, 237 void OnImageDecodeTaskCompleted(int layer_id,
234 SkPixelRef* pixel_ref, 238 SkPixelRef* pixel_ref,
235 bool was_canceled); 239 bool was_canceled);
236 void OnRasterTaskCompleted(Tile::Id tile, 240 void OnRasterTaskCompleted(Tile::Id tile,
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 310
307 bool did_notify_ready_to_activate_; 311 bool did_notify_ready_to_activate_;
308 bool did_notify_ready_to_draw_; 312 bool did_notify_ready_to_draw_;
309 313
310 DISALLOW_COPY_AND_ASSIGN(TileManager); 314 DISALLOW_COPY_AND_ASSIGN(TileManager);
311 }; 315 };
312 316
313 } // namespace cc 317 } // namespace cc
314 318
315 #endif // CC_TILES_TILE_MANAGER_H_ 319 #endif // CC_TILES_TILE_MANAGER_H_
OLDNEW
« no previous file with comments | « cc/tiles/tile.cc ('k') | cc/tiles/tile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698