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

Side by Side Diff: cc/layers/layer.cc

Issue 5831706594508800: cc: Cleanup Layer::SetNeedsDisplayInRect (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 4 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 | « cc/layers/layer.h ('k') | cc/layers/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 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 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/layers/layer.h" 5 #include "cc/layers/layer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 void Layer::SetHideLayerAndSubtree(bool hide) { 664 void Layer::SetHideLayerAndSubtree(bool hide) {
665 DCHECK(IsPropertyChangeAllowed()); 665 DCHECK(IsPropertyChangeAllowed());
666 if (hide_layer_and_subtree_ == hide) 666 if (hide_layer_and_subtree_ == hide)
667 return; 667 return;
668 668
669 hide_layer_and_subtree_ = hide; 669 hide_layer_and_subtree_ = hide;
670 SetNeedsCommit(); 670 SetNeedsCommit();
671 } 671 }
672 672
673 void Layer::SetNeedsDisplayRect(const gfx::RectF& dirty_rect) { 673 void Layer::SetNeedsDisplayRect(const gfx::RectF& dirty_rect) {
674 if (!update_rect_.Contains(dirty_rect)) { 674 if (dirty_rect.IsEmpty())
675 SetNeedsPushProperties(); 675 return;
676 }
677 676
677 SetNeedsPushProperties();
678 update_rect_.Union(dirty_rect); 678 update_rect_.Union(dirty_rect);
679 needs_display_ = true; 679 needs_display_ = true;
680 680
681 if (DrawsContent() && !update_rect_.IsEmpty()) { 681 if (DrawsContent())
682 SetNeedsUpdate(); 682 SetNeedsUpdate();
683 }
684 } 683 }
685 684
686 bool Layer::DescendantIsFixedToContainerLayer() const { 685 bool Layer::DescendantIsFixedToContainerLayer() const {
687 for (size_t i = 0; i < children_.size(); ++i) { 686 for (size_t i = 0; i < children_.size(); ++i) {
688 if (children_[i]->position_constraint_.is_fixed_position() || 687 if (children_[i]->position_constraint_.is_fixed_position() ||
689 children_[i]->DescendantIsFixedToContainerLayer()) 688 children_[i]->DescendantIsFixedToContainerLayer())
690 return true; 689 return true;
691 } 690 }
692 return false; 691 return false;
693 } 692 }
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 957
959 RenderingStatsInstrumentation* Layer::rendering_stats_instrumentation() const { 958 RenderingStatsInstrumentation* Layer::rendering_stats_instrumentation() const {
960 return layer_tree_host_->rendering_stats_instrumentation(); 959 return layer_tree_host_->rendering_stats_instrumentation();
961 } 960 }
962 961
963 bool Layer::SupportsLCDText() const { 962 bool Layer::SupportsLCDText() const {
964 return false; 963 return false;
965 } 964 }
966 965
967 } // namespace cc 966 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer.h ('k') | cc/layers/layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698