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 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
686 scroll_offset = layer_tree_host()->DistributeScrollOffsetToViewports( | 686 scroll_offset = layer_tree_host()->DistributeScrollOffsetToViewports( |
687 scroll_offset, this); | 687 scroll_offset, this); |
688 } | 688 } |
689 | 689 |
690 if (scroll_offset_ == scroll_offset) | 690 if (scroll_offset_ == scroll_offset) |
691 return; | 691 return; |
692 scroll_offset_ = scroll_offset; | 692 scroll_offset_ = scroll_offset; |
693 SetNeedsCommit(); | 693 SetNeedsCommit(); |
694 } | 694 } |
695 | 695 |
696 void Layer::SetScrollOffsetFromImplSide(gfx::Vector2d scroll_offset) { | 696 void Layer::SetScrollOffsetFromImplSide(const gfx::Vector2d& scroll_offset) { |
697 DCHECK(IsPropertyChangeAllowed()); | 697 DCHECK(IsPropertyChangeAllowed()); |
698 // This function only gets called during a BeginMainFrame, so there | 698 // This function only gets called during a BeginMainFrame, so there |
699 // is no need to call SetNeedsUpdate here. | 699 // is no need to call SetNeedsUpdate here. |
700 DCHECK(layer_tree_host_ && layer_tree_host_->CommitRequested()); | 700 DCHECK(layer_tree_host_ && layer_tree_host_->CommitRequested()); |
701 if (scroll_offset_ == scroll_offset) | 701 if (scroll_offset_ == scroll_offset) |
702 return; | 702 return; |
703 scroll_offset_ = scroll_offset; | 703 scroll_offset_ = scroll_offset; |
704 SetNeedsPushProperties(); | 704 SetNeedsPushProperties(); |
705 if (!did_scroll_callback_.is_null()) | 705 if (!did_scroll_callback_.is_null()) |
706 did_scroll_callback_.Run(); | 706 did_scroll_callback_.Run(); |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1197 | 1197 |
1198 if (clip_parent_) | 1198 if (clip_parent_) |
1199 clip_parent_->RemoveClipChild(this); | 1199 clip_parent_->RemoveClipChild(this); |
1200 | 1200 |
1201 clip_parent_ = NULL; | 1201 clip_parent_ = NULL; |
1202 } | 1202 } |
1203 | 1203 |
1204 void Layer::RunMicroBenchmark(MicroBenchmark* benchmark) { | 1204 void Layer::RunMicroBenchmark(MicroBenchmark* benchmark) { |
1205 benchmark->RunOnLayer(this); | 1205 benchmark->RunOnLayer(this); |
1206 } | 1206 } |
1207 | |
1208 } // namespace cc | 1207 } // namespace cc |
OLD | NEW |