| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 else | 49 else |
| 50 out.end_ = std::min(out.end_, t); | 50 out.end_ = std::min(out.end_, t); |
| 51 } | 51 } |
| 52 | 52 |
| 53 } // namespace | 53 } // namespace |
| 54 | 54 |
| 55 namespace cc { | 55 namespace cc { |
| 56 | 56 |
| 57 const float TilePriority::kMaxDistanceInContentSpace = 4096.0f; | 57 const float TilePriority::kMaxDistanceInContentSpace = 4096.0f; |
| 58 | 58 |
| 59 // At 256x256 tiles, 80 tiles cover an area of ~1280x4906 pixels. |
| 60 const int64 TilePriority:: |
| 61 kNumTilesToCoverWithInflatedViewportRectForPrioritization = 80; |
| 62 |
| 59 scoped_ptr<base::Value> WhichTreeAsValue(WhichTree tree) { | 63 scoped_ptr<base::Value> WhichTreeAsValue(WhichTree tree) { |
| 60 switch (tree) { | 64 switch (tree) { |
| 61 case ACTIVE_TREE: | 65 case ACTIVE_TREE: |
| 62 return scoped_ptr<base::Value>(base::Value::CreateStringValue( | 66 return scoped_ptr<base::Value>(base::Value::CreateStringValue( |
| 63 "ACTIVE_TREE")); | 67 "ACTIVE_TREE")); |
| 64 case PENDING_TREE: | 68 case PENDING_TREE: |
| 65 return scoped_ptr<base::Value>(base::Value::CreateStringValue( | 69 return scoped_ptr<base::Value>(base::Value::CreateStringValue( |
| 66 "PENDING_TREE")); | 70 "PENDING_TREE")); |
| 67 default: | 71 default: |
| 68 DCHECK(false) << "Unrecognized WhichTree value " << tree; | 72 DCHECK(false) << "Unrecognized WhichTree value " << tree; |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 scoped_ptr<base::Value> GlobalStateThatImpactsTilePriority::AsValue() const { | 186 scoped_ptr<base::Value> GlobalStateThatImpactsTilePriority::AsValue() const { |
| 183 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | 187 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
| 184 state->Set("memory_limit_policy", TileMemoryLimitPolicyAsValue(memory_limit_po
licy).release()); | 188 state->Set("memory_limit_policy", TileMemoryLimitPolicyAsValue(memory_limit_po
licy).release()); |
| 185 state->SetInteger("memory_limit_in_bytes", memory_limit_in_bytes); | 189 state->SetInteger("memory_limit_in_bytes", memory_limit_in_bytes); |
| 186 state->Set("tree_priority", TreePriorityAsValue(tree_priority).release()); | 190 state->Set("tree_priority", TreePriorityAsValue(tree_priority).release()); |
| 187 return state.PassAs<base::Value>(); | 191 return state.PassAs<base::Value>(); |
| 188 } | 192 } |
| 189 | 193 |
| 190 | 194 |
| 191 } // namespace cc | 195 } // namespace cc |
| OLD | NEW |