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

Side by Side Diff: cc/picture_layer_tiling.cc

Issue 12259027: cc: Simplify the logic for deciding to update tile priorities. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Avoid project more agressively. Don't save state for tile prio if we didn't compute tile prio. 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/layer_tree_impl.cc ('K') | « cc/picture_layer_tiling.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/picture_layer_tiling.h" 5 #include "cc/picture_layer_tiling.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "cc/math_util.h" 8 #include "cc/math_util.h"
9 #include "ui/gfx/point_conversions.h" 9 #include "ui/gfx/point_conversions.h"
10 #include "ui/gfx/rect_conversions.h" 10 #include "ui/gfx/rect_conversions.h"
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 float last_layer_contents_scale, 357 float last_layer_contents_scale,
358 float current_layer_contents_scale, 358 float current_layer_contents_scale,
359 const gfx::Transform& last_screen_transform, 359 const gfx::Transform& last_screen_transform,
360 const gfx::Transform& current_screen_transform, 360 const gfx::Transform& current_screen_transform,
361 int current_source_frame_number, 361 int current_source_frame_number,
362 double current_frame_time, 362 double current_frame_time,
363 bool store_screen_space_quads_on_tiles) { 363 bool store_screen_space_quads_on_tiles) {
364 if (ContentRect().IsEmpty()) 364 if (ContentRect().IsEmpty())
365 return; 365 return;
366 366
367 bool first_update_in_new_source_frame = 367 if (!needs_update_tile_priorities(current_source_frame_number,
368 current_source_frame_number != last_source_frame_number_; 368 current_frame_time))
369
370 bool first_update_in_new_impl_frame =
371 current_frame_time != last_impl_frame_time_;
372
373 // In pending tree, this is always called. We update priorities:
374 // - Immediately after a commit (first_update_in_new_source_frame).
375 // - On animation ticks after the first frame in the tree
376 // (first_update_in_new_impl_frame).
377 // In active tree, this is only called during draw. We update priorities:
378 // - On draw if properties were not already computed by the pending tree
379 // and activated for the frame (first_update_in_new_impl_frame).
380 if (!first_update_in_new_impl_frame && !first_update_in_new_source_frame)
381 return; 369 return;
382 370
383 double time_delta = 0; 371 double time_delta = 0;
384 if (last_impl_frame_time_ != 0 && 372 if (last_impl_frame_time_ != 0 &&
385 last_layer_bounds == current_layer_bounds && 373 last_layer_bounds == current_layer_bounds &&
386 last_layer_content_bounds == current_layer_content_bounds && 374 last_layer_content_bounds == current_layer_content_bounds &&
387 last_layer_contents_scale == current_layer_contents_scale) { 375 last_layer_contents_scale == current_layer_contents_scale) {
388 time_delta = current_frame_time - last_impl_frame_time_; 376 time_delta = current_frame_time - last_impl_frame_time_;
389 } 377 }
390 378
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 // and recreated, then that picture pile ref could exist indefinitely. To 512 // and recreated, then that picture pile ref could exist indefinitely. To
525 // prevent this, ask the client to update the pile to its own ref. This 513 // prevent this, ask the client to update the pile to its own ref. This
526 // will cause PicturePileImpls and their clones to get deleted once the 514 // will cause PicturePileImpls and their clones to get deleted once the
527 // corresponding PictureLayerImpl and any in flight raster jobs go out of 515 // corresponding PictureLayerImpl and any in flight raster jobs go out of
528 // scope. 516 // scope.
529 client_->UpdatePile(it->second); 517 client_->UpdatePile(it->second);
530 } 518 }
531 } 519 }
532 520
533 } // namespace cc 521 } // namespace cc
OLDNEW
« cc/layer_tree_impl.cc ('K') | « cc/picture_layer_tiling.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698