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

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: Created 7 years, 5 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/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 602 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 void Layer::SetHideLayerAndSubtree(bool hide) { 613 void Layer::SetHideLayerAndSubtree(bool hide) {
614 DCHECK(IsPropertyChangeAllowed()); 614 DCHECK(IsPropertyChangeAllowed());
615 if (hide_layer_and_subtree_ == hide) 615 if (hide_layer_and_subtree_ == hide)
616 return; 616 return;
617 617
618 hide_layer_and_subtree_ = hide; 618 hide_layer_and_subtree_ = hide;
619 SetNeedsCommit(); 619 SetNeedsCommit();
620 } 620 }
621 621
622 void Layer::SetNeedsDisplayRect(const gfx::RectF& dirty_rect) { 622 void Layer::SetNeedsDisplayRect(const gfx::RectF& dirty_rect) {
623 if (dirty_rect.IsEmpty())
slavi 2013/07/11 21:58:09 Don't do this. When I wrote that function, the int
danakj 2013/07/11 21:59:12 Why not just call SetNeedsCommit on the layer's ho
tomhudson 2013/07/24 09:02:43 If people can't determine the intended semantics b
624 return;
625
623 update_rect_.Union(dirty_rect); 626 update_rect_.Union(dirty_rect);
624 needs_display_ = true; 627 needs_display_ = true;
625 628
626 // Simply mark the contents as dirty. For non-root layers, the call to 629 if (DrawsContent())
627 // SetNeedsCommit will schedule a fresh compositing pass.
628 // For the root layer, SetNeedsCommit has no effect.
629 if (DrawsContent() && !update_rect_.IsEmpty())
630 SetNeedsCommit(); 630 SetNeedsCommit();
631 } 631 }
632 632
633 bool Layer::DescendantIsFixedToContainerLayer() const { 633 bool Layer::DescendantIsFixedToContainerLayer() const {
634 for (size_t i = 0; i < children_.size(); ++i) { 634 for (size_t i = 0; i < children_.size(); ++i) {
635 if (children_[i]->position_constraint_.is_fixed_position() || 635 if (children_[i]->position_constraint_.is_fixed_position() ||
636 children_[i]->DescendantIsFixedToContainerLayer()) 636 children_[i]->DescendantIsFixedToContainerLayer())
637 return true; 637 return true;
638 } 638 }
639 return false; 639 return false;
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
900 900
901 RenderingStatsInstrumentation* Layer::rendering_stats_instrumentation() const { 901 RenderingStatsInstrumentation* Layer::rendering_stats_instrumentation() const {
902 return layer_tree_host_->rendering_stats_instrumentation(); 902 return layer_tree_host_->rendering_stats_instrumentation();
903 } 903 }
904 904
905 bool Layer::SupportsLCDText() const { 905 bool Layer::SupportsLCDText() const {
906 return false; 906 return false;
907 } 907 }
908 908
909 } // namespace cc 909 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/layers/layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698