OLD | NEW |
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 #include "cc/resources/tile.h" | 5 #include "cc/resources/tile.h" |
6 | 6 |
7 #include "cc/base/math_util.h" | 7 #include "cc/base/math_util.h" |
8 #include "cc/debug/traced_value.h" | 8 #include "cc/debug/traced_value.h" |
9 #include "cc/resources/tile_manager.h" | 9 #include "cc/resources/tile_manager.h" |
10 #include "third_party/khronos/GLES2/gl2.h" | 10 #include "third_party/khronos/GLES2/gl2.h" |
11 | 11 |
12 namespace cc { | 12 namespace cc { |
13 | 13 |
14 Tile::Id Tile::s_next_id_ = 0; | 14 Tile::Id Tile::s_next_id_ = 0; |
15 | 15 |
16 Tile::Tile(TileManager* tile_manager, | 16 Tile::Tile(TileManager* tile_manager, |
17 PicturePileImpl* picture_pile, | 17 PicturePileImpl* picture_pile, |
18 const gfx::Size& tile_size, | 18 gfx::Size tile_size, |
19 const gfx::Rect& content_rect, | 19 const gfx::Rect& content_rect, |
20 const gfx::Rect& opaque_rect, | 20 const gfx::Rect& opaque_rect, |
21 float contents_scale, | 21 float contents_scale, |
22 int layer_id, | 22 int layer_id, |
23 int source_frame_number, | 23 int source_frame_number, |
24 int flags) | 24 int flags) |
25 : RefCountedManaged<Tile>(tile_manager), | 25 : RefCountedManaged<Tile>(tile_manager), |
26 tile_manager_(tile_manager), | 26 tile_manager_(tile_manager), |
27 tile_size_(tile_size), | 27 tile_size_(tile_size), |
28 content_rect_(content_rect), | 28 content_rect_(content_rect), |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 } | 75 } |
76 | 76 |
77 size_t Tile::GPUMemoryUsageInBytes() const { | 77 size_t Tile::GPUMemoryUsageInBytes() const { |
78 size_t total_size = 0; | 78 size_t total_size = 0; |
79 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) | 79 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) |
80 total_size += managed_state_.tile_versions[mode].GPUMemoryUsageInBytes(); | 80 total_size += managed_state_.tile_versions[mode].GPUMemoryUsageInBytes(); |
81 return total_size; | 81 return total_size; |
82 } | 82 } |
83 | 83 |
84 } // namespace cc | 84 } // namespace cc |
OLD | NEW |