| 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 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 | 369 |
| 370 void Layer::RequestCopyOfOutput( | 370 void Layer::RequestCopyOfOutput( |
| 371 scoped_ptr<CopyOutputRequest> request) { | 371 scoped_ptr<CopyOutputRequest> request) { |
| 372 DCHECK(IsPropertyChangeAllowed()); | 372 DCHECK(IsPropertyChangeAllowed()); |
| 373 if (request->IsEmpty()) | 373 if (request->IsEmpty()) |
| 374 return; | 374 return; |
| 375 copy_requests_.push_back(request.Pass()); | 375 copy_requests_.push_back(request.Pass()); |
| 376 SetNeedsCommit(); | 376 SetNeedsCommit(); |
| 377 } | 377 } |
| 378 | 378 |
| 379 void Layer::SetAnchorPoint(gfx::PointF anchor_point) { | 379 void Layer::SetAnchorPoint(const gfx::PointF& anchor_point) { |
| 380 DCHECK(IsPropertyChangeAllowed()); | 380 DCHECK(IsPropertyChangeAllowed()); |
| 381 if (anchor_point_ == anchor_point) | 381 if (anchor_point_ == anchor_point) |
| 382 return; | 382 return; |
| 383 anchor_point_ = anchor_point; | 383 anchor_point_ = anchor_point; |
| 384 SetNeedsCommit(); | 384 SetNeedsCommit(); |
| 385 } | 385 } |
| 386 | 386 |
| 387 void Layer::SetAnchorPointZ(float anchor_point_z) { | 387 void Layer::SetAnchorPointZ(float anchor_point_z) { |
| 388 DCHECK(IsPropertyChangeAllowed()); | 388 DCHECK(IsPropertyChangeAllowed()); |
| 389 if (anchor_point_z_ == anchor_point_z) | 389 if (anchor_point_z_ == anchor_point_z) |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 } | 574 } |
| 575 | 575 |
| 576 void Layer::SetContentsOpaque(bool opaque) { | 576 void Layer::SetContentsOpaque(bool opaque) { |
| 577 DCHECK(IsPropertyChangeAllowed()); | 577 DCHECK(IsPropertyChangeAllowed()); |
| 578 if (contents_opaque_ == opaque) | 578 if (contents_opaque_ == opaque) |
| 579 return; | 579 return; |
| 580 contents_opaque_ = opaque; | 580 contents_opaque_ = opaque; |
| 581 SetNeedsCommit(); | 581 SetNeedsCommit(); |
| 582 } | 582 } |
| 583 | 583 |
| 584 void Layer::SetPosition(gfx::PointF position) { | 584 void Layer::SetPosition(const gfx::PointF& position) { |
| 585 DCHECK(IsPropertyChangeAllowed()); | 585 DCHECK(IsPropertyChangeAllowed()); |
| 586 if (position_ == position) | 586 if (position_ == position) |
| 587 return; | 587 return; |
| 588 position_ = position; | 588 position_ = position; |
| 589 SetNeedsCommit(); | 589 SetNeedsCommit(); |
| 590 } | 590 } |
| 591 | 591 |
| 592 bool Layer::IsContainerForFixedPositionLayers() const { | 592 bool Layer::IsContainerForFixedPositionLayers() const { |
| 593 if (!transform_.IsIdentityOrTranslation()) | 593 if (!transform_.IsIdentityOrTranslation()) |
| 594 return true; | 594 return true; |
| (...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1174 clip_parent_->RemoveClipChild(this); | 1174 clip_parent_->RemoveClipChild(this); |
| 1175 | 1175 |
| 1176 clip_parent_ = NULL; | 1176 clip_parent_ = NULL; |
| 1177 } | 1177 } |
| 1178 | 1178 |
| 1179 void Layer::RunMicroBenchmark(MicroBenchmark* benchmark) { | 1179 void Layer::RunMicroBenchmark(MicroBenchmark* benchmark) { |
| 1180 benchmark->RunOnLayer(this); | 1180 benchmark->RunOnLayer(this); |
| 1181 } | 1181 } |
| 1182 | 1182 |
| 1183 } // namespace cc | 1183 } // namespace cc |
| OLD | NEW |