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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 for (int i = 0; i < NUM_TREES; i++) | 42 for (int i = 0; i < NUM_TREES; i++) |
43 is_occluded_[i] = false; | 43 is_occluded_[i] = false; |
44 } | 44 } |
45 | 45 |
46 Tile::~Tile() { | 46 Tile::~Tile() { |
47 TRACE_EVENT_OBJECT_DELETED_WITH_ID( | 47 TRACE_EVENT_OBJECT_DELETED_WITH_ID( |
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::trace_event::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 MathUtil::AddToTracedValue("content_rect", content_rect_, res); | 58 MathUtil::AddToTracedValue("content_rect", content_rect_, res); |
59 | 59 |
60 res->SetInteger("layer_id", layer_id_); | 60 res->SetInteger("layer_id", layer_id_); |
61 | 61 |
62 res->BeginDictionary("active_priority"); | 62 res->BeginDictionary("active_priority"); |
(...skipping 20 matching lines...) Expand all Loading... |
83 res->SetInteger("gpu_memory_usage", GPUMemoryUsageInBytes()); | 83 res->SetInteger("gpu_memory_usage", GPUMemoryUsageInBytes()); |
84 } | 84 } |
85 | 85 |
86 size_t Tile::GPUMemoryUsageInBytes() const { | 86 size_t Tile::GPUMemoryUsageInBytes() const { |
87 if (draw_info_.resource_) | 87 if (draw_info_.resource_) |
88 return draw_info_.resource_->bytes(); | 88 return draw_info_.resource_->bytes(); |
89 return 0; | 89 return 0; |
90 } | 90 } |
91 | 91 |
92 } // namespace cc | 92 } // namespace cc |
OLD | NEW |