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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 } | 317 } |
318 | 318 |
319 int Layer::IndexOfChild(const Layer* reference) { | 319 int Layer::IndexOfChild(const Layer* reference) { |
320 for (size_t i = 0; i < children_.size(); ++i) { | 320 for (size_t i = 0; i < children_.size(); ++i) { |
321 if (children_[i].get() == reference) | 321 if (children_[i].get() == reference) |
322 return i; | 322 return i; |
323 } | 323 } |
324 return -1; | 324 return -1; |
325 } | 325 } |
326 | 326 |
327 void Layer::SetBounds(gfx::Size size) { | 327 void Layer::SetBounds(const gfx::Size& size) { |
328 DCHECK(IsPropertyChangeAllowed()); | 328 DCHECK(IsPropertyChangeAllowed()); |
329 if (bounds() == size) | 329 if (bounds() == size) |
330 return; | 330 return; |
331 | 331 |
332 bounds_ = size; | 332 bounds_ = size; |
333 SetNeedsCommit(); | 333 SetNeedsCommit(); |
334 } | 334 } |
335 | 335 |
336 Layer* Layer::RootLayer() { | 336 Layer* Layer::RootLayer() { |
337 Layer* layer = this; | 337 Layer* layer = this; |
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1166 clip_parent_->RemoveClipChild(this); | 1166 clip_parent_->RemoveClipChild(this); |
1167 | 1167 |
1168 clip_parent_ = NULL; | 1168 clip_parent_ = NULL; |
1169 } | 1169 } |
1170 | 1170 |
1171 void Layer::RunMicroBenchmark(MicroBenchmark* benchmark) { | 1171 void Layer::RunMicroBenchmark(MicroBenchmark* benchmark) { |
1172 benchmark->RunOnLayer(this); | 1172 benchmark->RunOnLayer(this); |
1173 } | 1173 } |
1174 | 1174 |
1175 } // namespace cc | 1175 } // namespace cc |
OLD | NEW |