OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "cc/layers/layer_impl.h" | 5 #include "cc/layers/layer_impl.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "cc/animation/animation_registrar.h" | 10 #include "cc/animation/animation_registrar.h" |
(...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1067 float* contents_scale_y, | 1067 float* contents_scale_y, |
1068 gfx::Size* content_bounds) { | 1068 gfx::Size* content_bounds) { |
1069 // Base LayerImpl has all of its content scales and content bounds pushed | 1069 // Base LayerImpl has all of its content scales and content bounds pushed |
1070 // from its Layer during commit and just reuses those values as-is. | 1070 // from its Layer during commit and just reuses those values as-is. |
1071 *contents_scale_x = this->contents_scale_x(); | 1071 *contents_scale_x = this->contents_scale_x(); |
1072 *contents_scale_y = this->contents_scale_y(); | 1072 *contents_scale_y = this->contents_scale_y(); |
1073 *content_bounds = this->content_bounds(); | 1073 *content_bounds = this->content_bounds(); |
1074 } | 1074 } |
1075 | 1075 |
1076 void LayerImpl::SetScrollOffsetDelegate( | 1076 void LayerImpl::SetScrollOffsetDelegate( |
1077 LayerScrollOffsetDelegate* scroll_offset_delegate) { | 1077 ScrollOffsetDelegate* scroll_offset_delegate) { |
1078 // Having both a scroll parent and a scroll offset delegate is unsupported. | 1078 // Having both a scroll parent and a scroll offset delegate is unsupported. |
1079 DCHECK(!scroll_parent_); | 1079 DCHECK(!scroll_parent_); |
1080 if (!scroll_offset_delegate && scroll_offset_delegate_) { | 1080 if (!scroll_offset_delegate && scroll_offset_delegate_) { |
1081 scroll_delta_ = | 1081 scroll_delta_ = |
1082 scroll_offset_delegate_->GetTotalScrollOffset() - scroll_offset_; | 1082 scroll_offset_delegate_->GetTotalScrollOffset() - scroll_offset_; |
1083 } | 1083 } |
1084 gfx::Vector2dF total_offset = TotalScrollOffset(); | 1084 gfx::Vector2dF total_offset = TotalScrollOffset(); |
1085 scroll_offset_delegate_ = scroll_offset_delegate; | 1085 scroll_offset_delegate_ = scroll_offset_delegate; |
1086 if (scroll_offset_delegate_) | 1086 if (scroll_offset_delegate_) |
1087 scroll_offset_delegate_->SetTotalScrollOffset(total_offset); | 1087 scroll_offset_delegate_->SetTotalScrollOffset(total_offset); |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1507 scoped_ptr<base::Value> LayerImpl::AsValue() const { | 1507 scoped_ptr<base::Value> LayerImpl::AsValue() const { |
1508 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | 1508 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
1509 AsValueInto(state.get()); | 1509 AsValueInto(state.get()); |
1510 return state.PassAs<base::Value>(); | 1510 return state.PassAs<base::Value>(); |
1511 } | 1511 } |
1512 | 1512 |
1513 void LayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) { | 1513 void LayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) { |
1514 benchmark->RunOnLayer(this); | 1514 benchmark->RunOnLayer(this); |
1515 } | 1515 } |
1516 } // namespace cc | 1516 } // namespace cc |
OLD | NEW |