| 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/tile_priority.h" | 5 #include "cc/tile_priority.h" |
| 6 | 6 |
| 7 #include "base/values.h" | 7 #include "base/values.h" |
| 8 #include "cc/math_util.h" | 8 #include "cc/math_util.h" |
| 9 | 9 |
| 10 namespace { | 10 namespace { |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 73 |
| 74 scoped_ptr<base::Value> TileResolutionAsValue( | 74 scoped_ptr<base::Value> TileResolutionAsValue( |
| 75 TileResolution resolution) { | 75 TileResolution resolution) { |
| 76 switch (resolution) { | 76 switch (resolution) { |
| 77 case LOW_RESOLUTION: | 77 case LOW_RESOLUTION: |
| 78 return scoped_ptr<base::Value>(base::Value::CreateStringValue( | 78 return scoped_ptr<base::Value>(base::Value::CreateStringValue( |
| 79 "LOW_RESOLUTION")); | 79 "LOW_RESOLUTION")); |
| 80 case HIGH_RESOLUTION: | 80 case HIGH_RESOLUTION: |
| 81 return scoped_ptr<base::Value>(base::Value::CreateStringValue( | 81 return scoped_ptr<base::Value>(base::Value::CreateStringValue( |
| 82 "HIGH_RESOLUTION")); | 82 "HIGH_RESOLUTION")); |
| 83 case NON_IDEAL_RESOLUTION: |
| 84 return scoped_ptr<base::Value>(base::Value::CreateStringValue( |
| 85 "NON_IDEAL_RESOLUTION")); |
| 83 default: | 86 default: |
| 84 DCHECK(false) << "Unrecognized TileResolution value"; | 87 DCHECK(false) << "Unrecognized TileResolution value"; |
| 85 return scoped_ptr<base::Value>(base::Value::CreateStringValue( | 88 return scoped_ptr<base::Value>(base::Value::CreateStringValue( |
| 86 "<unknown TileResolution value>")); | 89 "<unknown TileResolution value>")); |
| 87 } | 90 } |
| 88 } | 91 } |
| 89 | 92 |
| 90 scoped_ptr<base::Value> TilePriority::AsValue() const { | 93 scoped_ptr<base::Value> TilePriority::AsValue() const { |
| 91 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | 94 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
| 92 state->SetBoolean("is_live", is_live); | 95 state->SetBoolean("is_live", is_live); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 scoped_ptr<base::Value> GlobalStateThatImpactsTilePriority::AsValue() const { | 182 scoped_ptr<base::Value> GlobalStateThatImpactsTilePriority::AsValue() const { |
| 180 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | 183 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
| 181 state->Set("memory_limit_policy", TileMemoryLimitPolicyAsValue(memory_limit_po
licy).release()); | 184 state->Set("memory_limit_policy", TileMemoryLimitPolicyAsValue(memory_limit_po
licy).release()); |
| 182 state->SetInteger("memory_limit_in_bytes", memory_limit_in_bytes); | 185 state->SetInteger("memory_limit_in_bytes", memory_limit_in_bytes); |
| 183 state->Set("tree_priority", TreePriorityAsValue(tree_priority).release()); | 186 state->Set("tree_priority", TreePriorityAsValue(tree_priority).release()); |
| 184 return state.PassAs<base::Value>(); | 187 return state.PassAs<base::Value>(); |
| 185 } | 188 } |
| 186 | 189 |
| 187 | 190 |
| 188 } // namespace cc | 191 } // namespace cc |
| OLD | NEW |