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

Side by Side Diff: cc/layers/layer.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.h ('k') | cc/layers/layer_impl.h » ('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 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
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
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
OLDNEW
« no previous file with comments | « cc/layers/layer.h ('k') | cc/layers/layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698