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

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

Issue 256303006: Make LayerScrollOffsetDelegate updates consistent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 7 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_impl.h ('k') | cc/layers/layer_impl_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 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 1054 matching lines...) Expand 10 before | Expand all | Expand 10 after
1065 float* contents_scale_y, 1065 float* contents_scale_y,
1066 gfx::Size* content_bounds) { 1066 gfx::Size* content_bounds) {
1067 // Base LayerImpl has all of its content scales and content bounds pushed 1067 // Base LayerImpl has all of its content scales and content bounds pushed
1068 // from its Layer during commit and just reuses those values as-is. 1068 // from its Layer during commit and just reuses those values as-is.
1069 *contents_scale_x = this->contents_scale_x(); 1069 *contents_scale_x = this->contents_scale_x();
1070 *contents_scale_y = this->contents_scale_y(); 1070 *contents_scale_y = this->contents_scale_y();
1071 *content_bounds = this->content_bounds(); 1071 *content_bounds = this->content_bounds();
1072 } 1072 }
1073 1073
1074 void LayerImpl::SetScrollOffsetDelegate( 1074 void LayerImpl::SetScrollOffsetDelegate(
1075 LayerScrollOffsetDelegate* scroll_offset_delegate) { 1075 ScrollOffsetDelegate* scroll_offset_delegate) {
1076 // Having both a scroll parent and a scroll offset delegate is unsupported. 1076 // Having both a scroll parent and a scroll offset delegate is unsupported.
1077 DCHECK(!scroll_parent_); 1077 DCHECK(!scroll_parent_);
1078 if (!scroll_offset_delegate && scroll_offset_delegate_) { 1078 if (!scroll_offset_delegate && scroll_offset_delegate_) {
1079 scroll_delta_ = 1079 scroll_delta_ =
1080 scroll_offset_delegate_->GetTotalScrollOffset() - scroll_offset_; 1080 scroll_offset_delegate_->GetTotalScrollOffset() - scroll_offset_;
1081 } 1081 }
1082 gfx::Vector2dF total_offset = TotalScrollOffset(); 1082 gfx::Vector2dF total_offset = TotalScrollOffset();
1083 scroll_offset_delegate_ = scroll_offset_delegate; 1083 scroll_offset_delegate_ = scroll_offset_delegate;
1084 if (scroll_offset_delegate_) 1084 if (scroll_offset_delegate_)
1085 scroll_offset_delegate_->SetTotalScrollOffset(total_offset); 1085 scroll_offset_delegate_->SetTotalScrollOffset(total_offset);
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
1510 scoped_ptr<base::Value> LayerImpl::AsValue() const { 1510 scoped_ptr<base::Value> LayerImpl::AsValue() const {
1511 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); 1511 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue());
1512 AsValueInto(state.get()); 1512 AsValueInto(state.get());
1513 return state.PassAs<base::Value>(); 1513 return state.PassAs<base::Value>();
1514 } 1514 }
1515 1515
1516 void LayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) { 1516 void LayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) {
1517 benchmark->RunOnLayer(this); 1517 benchmark->RunOnLayer(this);
1518 } 1518 }
1519 } // namespace cc 1519 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/layers/layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698