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

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 1027563003: cc: Send updated tile priority with tiles into tracing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « cc/resources/tile.cc ('k') | cc/trees/layer_tree_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <map>
9 10
10 #include "base/basictypes.h" 11 #include "base/basictypes.h"
11 #include "base/containers/hash_tables.h" 12 #include "base/containers/hash_tables.h"
12 #include "base/json/json_writer.h" 13 #include "base/json/json_writer.h"
13 #include "base/metrics/histogram.h" 14 #include "base/metrics/histogram.h"
14 #include "base/stl_util.h" 15 #include "base/stl_util.h"
15 #include "base/strings/stringprintf.h" 16 #include "base/strings/stringprintf.h"
16 #include "base/trace_event/trace_event_argument.h" 17 #include "base/trace_event/trace_event_argument.h"
17 #include "cc/animation/animation_id_provider.h" 18 #include "cc/animation/animation_id_provider.h"
18 #include "cc/animation/scroll_offset_animation_curve.h" 19 #include "cc/animation/scroll_offset_animation_curve.h"
(...skipping 3218 matching lines...) Expand 10 before | Expand all | Expand 10 after
3237 FrameData* frame, 3238 FrameData* frame,
3238 base::trace_event::TracedValue* state) const { 3239 base::trace_event::TracedValue* state) const {
3239 if (this->pending_tree_) { 3240 if (this->pending_tree_) {
3240 state->BeginDictionary("activation_state"); 3241 state->BeginDictionary("activation_state");
3241 ActivationStateAsValueInto(state); 3242 ActivationStateAsValueInto(state);
3242 state->EndDictionary(); 3243 state->EndDictionary();
3243 } 3244 }
3244 MathUtil::AddToTracedValue("device_viewport_size", device_viewport_size_, 3245 MathUtil::AddToTracedValue("device_viewport_size", device_viewport_size_,
3245 state); 3246 state);
3246 3247
3247 std::set<const Tile*> tiles; 3248 std::map<const Tile*, TilePriority> tile_map;
3248 active_tree_->GetAllTilesForTracing(&tiles); 3249 active_tree_->GetAllTilesAndPrioritiesForTracing(&tile_map);
3249 if (pending_tree_) 3250 if (pending_tree_)
3250 pending_tree_->GetAllTilesForTracing(&tiles); 3251 pending_tree_->GetAllTilesAndPrioritiesForTracing(&tile_map);
3251 3252
3252 state->BeginArray("active_tiles"); 3253 state->BeginArray("active_tiles");
3253 for (std::set<const Tile*>::const_iterator it = tiles.begin(); 3254 for (const auto& pair : tile_map) {
3254 it != tiles.end(); 3255 const Tile* tile = pair.first;
3255 ++it) { 3256 const TilePriority& priority = pair.second;
3256 const Tile* tile = *it;
3257 3257
3258 state->BeginDictionary(); 3258 state->BeginDictionary();
3259 tile->AsValueInto(state); 3259 tile->AsValueWithPriorityInto(priority, state);
3260 state->EndDictionary(); 3260 state->EndDictionary();
3261 } 3261 }
3262 state->EndArray(); 3262 state->EndArray();
3263 3263
3264 if (tile_manager_) { 3264 if (tile_manager_) {
3265 state->BeginDictionary("tile_manager_basic_state"); 3265 state->BeginDictionary("tile_manager_basic_state");
3266 tile_manager_->BasicStateAsValueInto(state); 3266 tile_manager_->BasicStateAsValueInto(state);
3267 state->EndDictionary(); 3267 state->EndDictionary();
3268 } 3268 }
3269 state->BeginDictionary("active_tree"); 3269 state->BeginDictionary("active_tree");
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
3467 new_target.SetToMin(layer_impl->MaxScrollOffset()); 3467 new_target.SetToMin(layer_impl->MaxScrollOffset());
3468 3468
3469 curve->UpdateTarget( 3469 curve->UpdateTarget(
3470 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time) 3470 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time)
3471 .InSecondsF(), 3471 .InSecondsF(),
3472 new_target); 3472 new_target);
3473 3473
3474 return true; 3474 return true;
3475 } 3475 }
3476 } // namespace cc 3476 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/tile.cc ('k') | cc/trees/layer_tree_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698