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

Side by Side Diff: ui/compositor/layer.cc

Issue 1112813003: Pass gfx structs by const ref (gfx::Vector2d/F) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing Created 5 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
« no previous file with comments | « ui/compositor/layer.h ('k') | ui/events/gesture_detection/velocity_tracker_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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "ui/compositor/layer.h" 5 #include "ui/compositor/layer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 LayerAnimationElement::TRANSFORM)) { 241 LayerAnimationElement::TRANSFORM)) {
242 return animator_->GetTargetTransform(); 242 return animator_->GetTargetTransform();
243 } 243 }
244 return transform(); 244 return transform();
245 } 245 }
246 246
247 void Layer::SetBounds(const gfx::Rect& bounds) { 247 void Layer::SetBounds(const gfx::Rect& bounds) {
248 GetAnimator()->SetBounds(bounds); 248 GetAnimator()->SetBounds(bounds);
249 } 249 }
250 250
251 void Layer::SetSubpixelPositionOffset(const gfx::Vector2dF offset) { 251 void Layer::SetSubpixelPositionOffset(const gfx::Vector2dF& offset) {
252 subpixel_position_offset_ = offset; 252 subpixel_position_offset_ = offset;
253 RecomputePosition(); 253 RecomputePosition();
254 } 254 }
255 255
256 gfx::Rect Layer::GetTargetBounds() const { 256 gfx::Rect Layer::GetTargetBounds() const {
257 if (animator_.get() && animator_->IsAnimatingProperty( 257 if (animator_.get() && animator_->IsAnimatingProperty(
258 LayerAnimationElement::BOUNDS)) { 258 LayerAnimationElement::BOUNDS)) {
259 return animator_->GetTargetBounds(); 259 return animator_->GetTargetBounds();
260 } 260 }
261 return bounds_; 261 return bounds_;
(...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after
1093 children_.end(), 1093 children_.end(),
1094 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection), 1094 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection),
1095 collection)); 1095 collection));
1096 } 1096 }
1097 1097
1098 bool Layer::IsAnimating() const { 1098 bool Layer::IsAnimating() const {
1099 return animator_.get() && animator_->is_animating(); 1099 return animator_.get() && animator_->is_animating();
1100 } 1100 }
1101 1101
1102 } // namespace ui 1102 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/layer.h ('k') | ui/events/gesture_detection/velocity_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698