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" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 res->Set("content_rect", MathUtil::AsValue(content_rect_).release()); | 50 res->Set("content_rect", MathUtil::AsValue(content_rect_).release()); |
51 res->SetInteger("layer_id", layer_id_); | 51 res->SetInteger("layer_id", layer_id_); |
52 res->Set("active_priority", priority_[ACTIVE_TREE].AsValue().release()); | 52 res->Set("active_priority", priority_[ACTIVE_TREE].AsValue().release()); |
53 res->Set("pending_priority", priority_[PENDING_TREE].AsValue().release()); | 53 res->Set("pending_priority", priority_[PENDING_TREE].AsValue().release()); |
54 res->Set("managed_state", managed_state_.AsValue().release()); | 54 res->Set("managed_state", managed_state_.AsValue().release()); |
55 return res.PassAs<base::Value>(); | 55 return res.PassAs<base::Value>(); |
56 } | 56 } |
57 | 57 |
58 size_t Tile::GPUMemoryUsageInBytes() const { | 58 size_t Tile::GPUMemoryUsageInBytes() const { |
59 size_t total_size = 0; | 59 size_t total_size = 0; |
60 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) | 60 for (int mode = 0; mode <= MAX_RASTER_MODE; ++mode) |
61 total_size += managed_state_.tile_versions[mode].GPUMemoryUsageInBytes(); | 61 total_size += managed_state_.tile_versions[mode].GPUMemoryUsageInBytes(); |
62 return total_size; | 62 return total_size; |
63 } | 63 } |
64 | 64 |
65 } // namespace cc | 65 } // namespace cc |
OLD | NEW |