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

Side by Side Diff: ui/compositor/layer.cc

Issue 2018223002: Clear ui::Layer damaged_region_ after commit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « ui/compositor/layer.h ('k') | ui/compositor/layer_unittest.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "ui/compositor/layer.h" 5 #include "ui/compositor/layer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 } 682 }
683 683
684 void Layer::SendDamagedRects() { 684 void Layer::SendDamagedRects() {
685 if (damaged_region_.IsEmpty()) 685 if (damaged_region_.IsEmpty())
686 return; 686 return;
687 if (!delegate_ && !mailbox_.IsValid()) 687 if (!delegate_ && !mailbox_.IsValid())
688 return; 688 return;
689 689
690 for (cc::Region::Iterator iter(damaged_region_); iter.has_rect(); iter.next()) 690 for (cc::Region::Iterator iter(damaged_region_); iter.has_rect(); iter.next())
691 cc_layer_->SetNeedsDisplayRect(iter.rect()); 691 cc_layer_->SetNeedsDisplayRect(iter.rect());
692 }
693 692
694 void Layer::ClearDamagedRects() { 693 if (content_layer_)
694 paint_region_.Union(damaged_region_);
695 damaged_region_.Clear(); 695 damaged_region_.Clear();
696 } 696 }
697 697
698 void Layer::CompleteAllAnimations() { 698 void Layer::CompleteAllAnimations() {
699 typedef std::vector<scoped_refptr<LayerAnimator> > LayerAnimatorVector; 699 typedef std::vector<scoped_refptr<LayerAnimator> > LayerAnimatorVector;
700 LayerAnimatorVector animators; 700 LayerAnimatorVector animators;
701 CollectAnimators(&animators); 701 CollectAnimators(&animators);
702 for (LayerAnimatorVector::const_iterator it = animators.begin(); 702 for (LayerAnimatorVector::const_iterator it = animators.begin();
703 it != animators.end(); 703 it != animators.end();
704 ++it) { 704 ++it) {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 749
750 gfx::Rect Layer::PaintableRegion() { 750 gfx::Rect Layer::PaintableRegion() {
751 return gfx::Rect(size()); 751 return gfx::Rect(size());
752 } 752 }
753 753
754 scoped_refptr<cc::DisplayItemList> Layer::PaintContentsToDisplayList( 754 scoped_refptr<cc::DisplayItemList> Layer::PaintContentsToDisplayList(
755 ContentLayerClient::PaintingControlSetting painting_control) { 755 ContentLayerClient::PaintingControlSetting painting_control) {
756 TRACE_EVENT1("ui", "Layer::PaintContentsToDisplayList", "name", name_); 756 TRACE_EVENT1("ui", "Layer::PaintContentsToDisplayList", "name", name_);
757 gfx::Rect local_bounds(bounds().size()); 757 gfx::Rect local_bounds(bounds().size());
758 gfx::Rect invalidation( 758 gfx::Rect invalidation(
759 gfx::IntersectRects(damaged_region_.bounds(), local_bounds)); 759 gfx::IntersectRects(paint_region_.bounds(), local_bounds));
760 ClearDamagedRects(); 760 paint_region_.Clear();
761 cc::DisplayItemListSettings settings; 761 cc::DisplayItemListSettings settings;
762 settings.use_cached_picture = false; 762 settings.use_cached_picture = false;
763 scoped_refptr<cc::DisplayItemList> display_list = 763 scoped_refptr<cc::DisplayItemList> display_list =
764 cc::DisplayItemList::Create(PaintableRegion(), settings); 764 cc::DisplayItemList::Create(PaintableRegion(), settings);
765 if (delegate_) { 765 if (delegate_) {
766 delegate_->OnPaintLayer( 766 delegate_->OnPaintLayer(
767 PaintContext(display_list.get(), device_scale_factor_, invalidation)); 767 PaintContext(display_list.get(), device_scale_factor_, invalidation));
768 } 768 }
769 display_list->Finalize(); 769 display_list->Finalize();
770 return display_list; 770 return display_list;
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
1049 if (animator_) { 1049 if (animator_) {
1050 animator_->ResetCompositor(compositor); 1050 animator_->ResetCompositor(compositor);
1051 animator_->RemoveFromCollection(collection); 1051 animator_->RemoveFromCollection(collection);
1052 } 1052 }
1053 1053
1054 for (auto* child : children_) 1054 for (auto* child : children_)
1055 child->ResetCompositorForAnimatorsInTree(compositor); 1055 child->ResetCompositorForAnimatorsInTree(compositor);
1056 } 1056 }
1057 1057
1058 } // namespace ui 1058 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/layer.h ('k') | ui/compositor/layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698