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

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

Issue 145313006: [#7] Pass gfx structs by const ref (gfx::Size) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 10 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
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/layers/layer_position_constraint_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 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 744
745 layer_tree_impl_->DidAnimateScrollOffset(); 745 layer_tree_impl_->DidAnimateScrollOffset();
746 } 746 }
747 747
748 void LayerImpl::OnAnimationWaitingForDeletion() {} 748 void LayerImpl::OnAnimationWaitingForDeletion() {}
749 749
750 bool LayerImpl::IsActive() const { 750 bool LayerImpl::IsActive() const {
751 return layer_tree_impl_->IsActiveTree(); 751 return layer_tree_impl_->IsActiveTree();
752 } 752 }
753 753
754 void LayerImpl::SetBounds(gfx::Size bounds) { 754 void LayerImpl::SetBounds(const gfx::Size& bounds) {
755 if (bounds_ == bounds) 755 if (bounds_ == bounds)
756 return; 756 return;
757 757
758 bounds_ = bounds; 758 bounds_ = bounds;
759 759
760 if (masks_to_bounds()) 760 if (masks_to_bounds())
761 NoteLayerPropertyChangedForSubtree(); 761 NoteLayerPropertyChangedForSubtree();
762 else 762 else
763 NoteLayerPropertyChanged(); 763 NoteLayerPropertyChanged();
764 } 764 }
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 Animation* transform_animation = 989 Animation* transform_animation =
990 layer_animation_controller_->GetAnimation(Animation::Transform); 990 layer_animation_controller_->GetAnimation(Animation::Transform);
991 return transform_animation && transform_animation->is_impl_only(); 991 return transform_animation && transform_animation->is_impl_only();
992 } 992 }
993 993
994 void LayerImpl::SetUpdateRect(const gfx::RectF& update_rect) { 994 void LayerImpl::SetUpdateRect(const gfx::RectF& update_rect) {
995 update_rect_ = update_rect; 995 update_rect_ = update_rect;
996 SetNeedsPushProperties(); 996 SetNeedsPushProperties();
997 } 997 }
998 998
999 void LayerImpl::SetContentBounds(gfx::Size content_bounds) { 999 void LayerImpl::SetContentBounds(const gfx::Size& content_bounds) {
1000 if (this->content_bounds() == content_bounds) 1000 if (this->content_bounds() == content_bounds)
1001 return; 1001 return;
1002 1002
1003 draw_properties_.content_bounds = content_bounds; 1003 draw_properties_.content_bounds = content_bounds;
1004 NoteLayerPropertyChanged(); 1004 NoteLayerPropertyChanged();
1005 } 1005 }
1006 1006
1007 void LayerImpl::SetContentsScale(float contents_scale_x, 1007 void LayerImpl::SetContentsScale(float contents_scale_x,
1008 float contents_scale_y) { 1008 float contents_scale_y) {
1009 if (this->contents_scale_x() == contents_scale_x && 1009 if (this->contents_scale_x() == contents_scale_x &&
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
1339 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); 1339 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue());
1340 AsValueInto(state.get()); 1340 AsValueInto(state.get());
1341 return state.PassAs<base::Value>(); 1341 return state.PassAs<base::Value>();
1342 } 1342 }
1343 1343
1344 void LayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) { 1344 void LayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) {
1345 benchmark->RunOnLayer(this); 1345 benchmark->RunOnLayer(this);
1346 } 1346 }
1347 1347
1348 } // namespace cc 1348 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/layers/layer_position_constraint_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698