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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/trace_event/trace_event_argument.h" | 9 #include "base/trace_event/trace_event_argument.h" |
10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 value->SetDouble("contents_scale", contents_scale_); | 49 value->SetDouble("contents_scale", contents_scale_); |
50 | 50 |
51 MathUtil::AddToTracedValue("content_rect", content_rect_, value); | 51 MathUtil::AddToTracedValue("content_rect", content_rect_, value); |
52 | 52 |
53 value->SetInteger("layer_id", layer_id_); | 53 value->SetInteger("layer_id", layer_id_); |
54 | 54 |
55 value->BeginDictionary("draw_info"); | 55 value->BeginDictionary("draw_info"); |
56 draw_info_.AsValueInto(value); | 56 draw_info_.AsValueInto(value); |
57 value->EndDictionary(); | 57 value->EndDictionary(); |
58 | 58 |
59 value->SetBoolean("has_resource", HasResource()); | 59 value->SetBoolean("has_resource", draw_info().has_resource()); |
60 value->SetBoolean("is_using_gpu_memory", HasResource() || HasRasterTask()); | 60 value->SetBoolean("is_using_gpu_memory", |
61 | 61 draw_info().has_resource() || HasRasterTask()); |
62 value->SetInteger("scheduled_priority", scheduled_priority_); | 62 value->SetInteger("scheduled_priority", scheduled_priority_); |
63 | |
64 value->SetBoolean("use_picture_analysis", use_picture_analysis()); | 63 value->SetBoolean("use_picture_analysis", use_picture_analysis()); |
65 | |
66 value->SetInteger("gpu_memory_usage", GPUMemoryUsageInBytes()); | 64 value->SetInteger("gpu_memory_usage", GPUMemoryUsageInBytes()); |
67 } | 65 } |
68 | 66 |
69 size_t Tile::GPUMemoryUsageInBytes() const { | 67 size_t Tile::GPUMemoryUsageInBytes() const { |
70 if (draw_info_.resource_) | 68 if (draw_info_.resource_) |
71 return draw_info_.resource_->bytes(); | 69 return draw_info_.resource_->bytes(); |
72 return 0; | 70 return 0; |
73 } | 71 } |
74 | 72 |
75 void Tile::Deleter::operator()(Tile* tile) const { | 73 void Tile::Deleter::operator()(Tile* tile) const { |
76 TileManager* tile_manager = tile->tile_manager_; | 74 TileManager* tile_manager = tile->tile_manager_; |
77 tile_manager->Release(tile); | 75 tile_manager->Release(tile); |
78 } | 76 } |
79 | 77 |
80 } // namespace cc | 78 } // namespace cc |
OLD | NEW |