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_priority.h" | 5 #include "cc/resources/tile_priority.h" |
6 | 6 |
7 #include "base/trace_event/trace_event_argument.h" | 7 #include "base/trace_event/trace_event_argument.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "cc/base/math_util.h" | 9 #include "cc/base/math_util.h" |
10 | 10 |
(...skipping 30 matching lines...) Expand all Loading... |
41 return "NOW"; | 41 return "NOW"; |
42 case TilePriority::SOON: | 42 case TilePriority::SOON: |
43 return "SOON"; | 43 return "SOON"; |
44 case TilePriority::EVENTUALLY: | 44 case TilePriority::EVENTUALLY: |
45 return "EVENTUALLY"; | 45 return "EVENTUALLY"; |
46 } | 46 } |
47 DCHECK(false) << "Unrecognized TilePriority::PriorityBin value " << bin; | 47 DCHECK(false) << "Unrecognized TilePriority::PriorityBin value " << bin; |
48 return "<unknown TilePriority::PriorityBin value>"; | 48 return "<unknown TilePriority::PriorityBin value>"; |
49 } | 49 } |
50 | 50 |
51 void TilePriority::AsValueInto(base::debug::TracedValue* state) const { | 51 void TilePriority::AsValueInto(base::trace_event::TracedValue* state) const { |
52 state->SetString("resolution", TileResolutionToString(resolution)); | 52 state->SetString("resolution", TileResolutionToString(resolution)); |
53 state->SetString("priority_bin", TilePriorityBinToString(priority_bin)); | 53 state->SetString("priority_bin", TilePriorityBinToString(priority_bin)); |
54 state->SetDouble("distance_to_visible", | 54 state->SetDouble("distance_to_visible", |
55 MathUtil::AsDoubleSafely(distance_to_visible)); | 55 MathUtil::AsDoubleSafely(distance_to_visible)); |
56 } | 56 } |
57 | 57 |
58 std::string TileMemoryLimitPolicyToString(TileMemoryLimitPolicy policy) { | 58 std::string TileMemoryLimitPolicyToString(TileMemoryLimitPolicy policy) { |
59 switch (policy) { | 59 switch (policy) { |
60 case ALLOW_NOTHING: | 60 case ALLOW_NOTHING: |
61 return "ALLOW_NOTHING"; | 61 return "ALLOW_NOTHING"; |
(...skipping 17 matching lines...) Expand all Loading... |
79 return "SMOOTHNESS_TAKES_PRIORITY"; | 79 return "SMOOTHNESS_TAKES_PRIORITY"; |
80 case NEW_CONTENT_TAKES_PRIORITY: | 80 case NEW_CONTENT_TAKES_PRIORITY: |
81 return "NEW_CONTENT_TAKES_PRIORITY"; | 81 return "NEW_CONTENT_TAKES_PRIORITY"; |
82 default: | 82 default: |
83 DCHECK(false) << "Unrecognized priority value " << prio; | 83 DCHECK(false) << "Unrecognized priority value " << prio; |
84 return "<unknown>"; | 84 return "<unknown>"; |
85 } | 85 } |
86 } | 86 } |
87 | 87 |
88 void GlobalStateThatImpactsTilePriority::AsValueInto( | 88 void GlobalStateThatImpactsTilePriority::AsValueInto( |
89 base::debug::TracedValue* state) const { | 89 base::trace_event::TracedValue* state) const { |
90 state->SetString("memory_limit_policy", | 90 state->SetString("memory_limit_policy", |
91 TileMemoryLimitPolicyToString(memory_limit_policy)); | 91 TileMemoryLimitPolicyToString(memory_limit_policy)); |
92 state->SetInteger("soft_memory_limit_in_bytes", soft_memory_limit_in_bytes); | 92 state->SetInteger("soft_memory_limit_in_bytes", soft_memory_limit_in_bytes); |
93 state->SetInteger("hard_memory_limit_in_bytes", hard_memory_limit_in_bytes); | 93 state->SetInteger("hard_memory_limit_in_bytes", hard_memory_limit_in_bytes); |
94 state->SetInteger("num_resources_limit", num_resources_limit); | 94 state->SetInteger("num_resources_limit", num_resources_limit); |
95 state->SetString("tree_priority", TreePriorityToString(tree_priority)); | 95 state->SetString("tree_priority", TreePriorityToString(tree_priority)); |
96 } | 96 } |
97 | 97 |
98 } // namespace cc | 98 } // namespace cc |
OLD | NEW |