| 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/debug/trace_event_argument.h" | 9 #include "base/debug/trace_event_argument.h" |
| 10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 TRACE_DISABLED_BY_DEFAULT("cc.debug"), | 48 TRACE_DISABLED_BY_DEFAULT("cc.debug"), |
| 49 "cc::Tile", this); | 49 "cc::Tile", this); |
| 50 } | 50 } |
| 51 | 51 |
| 52 void Tile::AsValueInto(base::debug::TracedValue* res) const { | 52 void Tile::AsValueInto(base::debug::TracedValue* res) const { |
| 53 TracedValue::MakeDictIntoImplicitSnapshotWithCategory( | 53 TracedValue::MakeDictIntoImplicitSnapshotWithCategory( |
| 54 TRACE_DISABLED_BY_DEFAULT("cc.debug"), res, "cc::Tile", this); | 54 TRACE_DISABLED_BY_DEFAULT("cc.debug"), res, "cc::Tile", this); |
| 55 TracedValue::SetIDRef(raster_source_.get(), res, "picture_pile"); | 55 TracedValue::SetIDRef(raster_source_.get(), res, "picture_pile"); |
| 56 res->SetDouble("contents_scale", contents_scale_); | 56 res->SetDouble("contents_scale", contents_scale_); |
| 57 | 57 |
| 58 res->BeginArray("content_rect"); | 58 MathUtil::AddToTracedValue("content_rect", content_rect_, res); |
| 59 MathUtil::AddToTracedValue(content_rect_, res); | |
| 60 res->EndArray(); | |
| 61 | 59 |
| 62 res->SetInteger("layer_id", layer_id_); | 60 res->SetInteger("layer_id", layer_id_); |
| 63 | 61 |
| 64 res->BeginDictionary("active_priority"); | 62 res->BeginDictionary("active_priority"); |
| 65 priority_[ACTIVE_TREE].AsValueInto(res); | 63 priority_[ACTIVE_TREE].AsValueInto(res); |
| 66 res->EndDictionary(); | 64 res->EndDictionary(); |
| 67 | 65 |
| 68 res->BeginDictionary("pending_priority"); | 66 res->BeginDictionary("pending_priority"); |
| 69 priority_[PENDING_TREE].AsValueInto(res); | 67 priority_[PENDING_TREE].AsValueInto(res); |
| 70 res->EndDictionary(); | 68 res->EndDictionary(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 85 res->SetInteger("gpu_memory_usage", GPUMemoryUsageInBytes()); | 83 res->SetInteger("gpu_memory_usage", GPUMemoryUsageInBytes()); |
| 86 } | 84 } |
| 87 | 85 |
| 88 size_t Tile::GPUMemoryUsageInBytes() const { | 86 size_t Tile::GPUMemoryUsageInBytes() const { |
| 89 if (draw_info_.resource_) | 87 if (draw_info_.resource_) |
| 90 return draw_info_.resource_->bytes(); | 88 return draw_info_.resource_->bytes(); |
| 91 return 0; | 89 return 0; |
| 92 } | 90 } |
| 93 | 91 |
| 94 } // namespace cc | 92 } // namespace cc |
| OLD | NEW |