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

Side by Side Diff: cc/picture_layer_impl.cc

Issue 12321053: cc: Complete pending tile uploads if they are needed for tree activation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Only flush when not in smoothness/animations Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | cc/resource_provider.h » ('j') | cc/resource_provider.h » ('J')
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_impl.h" 5 #include "cc/picture_layer_impl.h"
6 6
7 #include "base/time.h" 7 #include "base/time.h"
8 #include "cc/append_quads_data.h" 8 #include "cc/append_quads_data.h"
9 #include "cc/checkerboard_draw_quad.h" 9 #include "cc/checkerboard_draw_quad.h"
10 #include "cc/debug_border_draw_quad.h" 10 #include "cc/debug_border_draw_quad.h"
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 const gfx::Rect& rect = visibleContentRect(); 491 const gfx::Rect& rect = visibleContentRect();
492 492
493 float raster_contents_scale = 493 float raster_contents_scale =
494 raster_page_scale_ * 494 raster_page_scale_ *
495 raster_device_scale_ * 495 raster_device_scale_ *
496 raster_source_scale_; 496 raster_source_scale_;
497 497
498 float min_acceptable_scale = 498 float min_acceptable_scale =
499 std::min(raster_contents_scale, ideal_contents_scale_); 499 std::min(raster_contents_scale, ideal_contents_scale_);
500 500
501 TreePriority tree_priority =
502 layerTreeImpl()->tile_manager()->GlobalState().tree_priority;
503 bool should_flush_uploads =
504 tree_priority != SMOOTHNESS_TAKES_PRIORITY &&
505 layerTreeImpl()->animationRegistrar()->
506 active_animation_controllers().empty();
507
501 if (PictureLayerImpl* twin = ActiveTwin()) { 508 if (PictureLayerImpl* twin = ActiveTwin()) {
502 float twin_raster_contents_scale = 509 float twin_raster_contents_scale =
503 twin->raster_page_scale_ * 510 twin->raster_page_scale_ *
504 twin->raster_device_scale_ * 511 twin->raster_device_scale_ *
505 twin->raster_source_scale_; 512 twin->raster_source_scale_;
506 513
507 min_acceptable_scale = std::min( 514 min_acceptable_scale = std::min(
508 min_acceptable_scale, 515 min_acceptable_scale,
509 std::min(twin->ideal_contents_scale_, twin_raster_contents_scale)); 516 std::min(twin->ideal_contents_scale_, twin_raster_contents_scale));
510 } 517 }
511 518
512 Region missing_region = rect; 519 Region missing_region = rect;
513 for (size_t i = 0; i < tilings_->num_tilings(); ++i) { 520 for (size_t i = 0; i < tilings_->num_tilings(); ++i) {
514 PictureLayerTiling* tiling = tilings_->tiling_at(i); 521 PictureLayerTiling* tiling = tilings_->tiling_at(i);
515 522
516 if (tiling->contents_scale() < min_acceptable_scale) 523 if (tiling->contents_scale() < min_acceptable_scale)
517 continue; 524 continue;
518 525
519 for (PictureLayerTiling::Iterator iter(tiling, 526 for (PictureLayerTiling::Iterator iter(tiling,
520 contentsScaleX(), 527 contentsScaleX(),
521 rect, 528 rect,
522 PictureLayerTiling::LayerDeviceAlignm entUnknown); 529 PictureLayerTiling::LayerDeviceAlignm entUnknown);
523 iter; 530 iter;
524 ++iter) { 531 ++iter) {
532 if (should_flush_uploads && iter)
533 layerTreeImpl()->tile_manager()->FlushPendingTileUploadIfNeeded(*iter);
525 // A null tile (i.e. no recording) is considered "ready". 534 // A null tile (i.e. no recording) is considered "ready".
526 if (!*iter || iter->IsReadyToDraw()) 535 if (!*iter || iter->IsReadyToDraw())
527 missing_region.Subtract(iter.geometry_rect()); 536 missing_region.Subtract(iter.geometry_rect());
528 } 537 }
529 } 538 }
530 539
531 return missing_region.IsEmpty(); 540 return missing_region.IsEmpty();
532 } 541 }
533 542
534 PictureLayerTiling* PictureLayerImpl::AddTiling(float contents_scale) { 543 PictureLayerTiling* PictureLayerImpl::AddTiling(float contents_scale) {
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 scoped_ptr<base::Value> PictureLayerImpl::AsValue() const { 803 scoped_ptr<base::Value> PictureLayerImpl::AsValue() const {
795 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); 804 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue());
796 LayerImpl::AsValueInto(state.get()); 805 LayerImpl::AsValueInto(state.get());
797 806
798 state->SetDouble("ideal_contents_scale", ideal_contents_scale_); 807 state->SetDouble("ideal_contents_scale", ideal_contents_scale_);
799 state->Set("tilings", tilings_->AsValue().release()); 808 state->Set("tilings", tilings_->AsValue().release());
800 return state.PassAs<base::Value>(); 809 return state.PassAs<base::Value>();
801 } 810 }
802 811
803 } // namespace cc 812 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/resource_provider.h » ('j') | cc/resource_provider.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698