OLD | NEW |
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/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 void Layer::RemoveClipChild(Layer* child) { | 667 void Layer::RemoveClipChild(Layer* child) { |
668 clip_children_->erase(child); | 668 clip_children_->erase(child); |
669 if (clip_children_->empty()) | 669 if (clip_children_->empty()) |
670 clip_children_.reset(); | 670 clip_children_.reset(); |
671 SetNeedsCommit(); | 671 SetNeedsCommit(); |
672 } | 672 } |
673 | 673 |
674 void Layer::SetScrollOffset(gfx::Vector2d scroll_offset) { | 674 void Layer::SetScrollOffset(gfx::Vector2d scroll_offset) { |
675 DCHECK(IsPropertyChangeAllowed()); | 675 DCHECK(IsPropertyChangeAllowed()); |
676 | 676 |
677 if (layer_tree_host()) { | |
678 scroll_offset = layer_tree_host()->DistributeScrollOffsetToViewports( | |
679 scroll_offset, this); | |
680 } | |
681 | |
682 if (scroll_offset_ == scroll_offset) | 677 if (scroll_offset_ == scroll_offset) |
683 return; | 678 return; |
684 scroll_offset_ = scroll_offset; | 679 scroll_offset_ = scroll_offset; |
685 SetNeedsCommit(); | 680 SetNeedsCommit(); |
686 } | 681 } |
687 | 682 |
688 void Layer::SetScrollOffsetFromImplSide(const gfx::Vector2d& scroll_offset) { | 683 void Layer::SetScrollOffsetFromImplSide(const gfx::Vector2d& scroll_offset) { |
689 DCHECK(IsPropertyChangeAllowed()); | 684 DCHECK(IsPropertyChangeAllowed()); |
690 // This function only gets called during a BeginMainFrame, so there | 685 // This function only gets called during a BeginMainFrame, so there |
691 // is no need to call SetNeedsUpdate here. | 686 // is no need to call SetNeedsUpdate here. |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1219 if (clip_parent_) | 1214 if (clip_parent_) |
1220 clip_parent_->RemoveClipChild(this); | 1215 clip_parent_->RemoveClipChild(this); |
1221 | 1216 |
1222 clip_parent_ = NULL; | 1217 clip_parent_ = NULL; |
1223 } | 1218 } |
1224 | 1219 |
1225 void Layer::RunMicroBenchmark(MicroBenchmark* benchmark) { | 1220 void Layer::RunMicroBenchmark(MicroBenchmark* benchmark) { |
1226 benchmark->RunOnLayer(this); | 1221 benchmark->RunOnLayer(this); |
1227 } | 1222 } |
1228 } // namespace cc | 1223 } // namespace cc |
OLD | NEW |