Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Side by Side Diff: cc/tile_priority.cc

Issue 12287027: cc: Compute the inflated rect to cover a fixed number of tiles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moved constant Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« cc/picture_layer_tiling.cc ('K') | « cc/tile_priority.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« cc/picture_layer_tiling.cc ('K') | « cc/tile_priority.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698