OLD | NEW |
(Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "cc/layers/layer_position_constraint.h" |
| 6 |
| 7 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerPositionCon
straint.h" |
| 8 |
| 9 using WebKit::WebLayerPositionConstraint; |
| 10 |
| 11 namespace cc { |
| 12 |
| 13 LayerPositionConstraint::LayerPositionConstraint() |
| 14 : is_fixed_position_(false), |
| 15 is_fixed_to_right_edge_(false), |
| 16 is_fixed_to_bottom_edge_(false) { |
| 17 } |
| 18 |
| 19 LayerPositionConstraint::LayerPositionConstraint( |
| 20 const WebLayerPositionConstraint& constraint) |
| 21 : is_fixed_position_(constraint.isFixedPosition), |
| 22 is_fixed_to_right_edge_(constraint.isFixedToRightEdge), |
| 23 is_fixed_to_bottom_edge_(constraint.isFixedToBottomEdge) { |
| 24 } |
| 25 |
| 26 bool LayerPositionConstraint::operator==( |
| 27 const LayerPositionConstraint& other) const { |
| 28 if (!is_fixed_position_ && !other.is_fixed_position_) |
| 29 return true; |
| 30 return is_fixed_position_ == other.is_fixed_position_ && |
| 31 is_fixed_to_right_edge_ == other.is_fixed_to_right_edge_ && |
| 32 is_fixed_to_bottom_edge_ == other.is_fixed_to_bottom_edge_; |
| 33 } |
| 34 |
| 35 bool LayerPositionConstraint::operator!=( |
| 36 const LayerPositionConstraint& other) const { |
| 37 return !(*this == other); |
| 38 } |
| 39 |
| 40 LayerPositionConstraint::operator WebLayerPositionConstraint() const { |
| 41 WebLayerPositionConstraint constraint; |
| 42 constraint.isFixedPosition = is_fixed_position_; |
| 43 constraint.isFixedToRightEdge = is_fixed_to_right_edge_; |
| 44 constraint.isFixedToBottomEdge = is_fixed_to_bottom_edge_; |
| 45 return constraint; |
| 46 } |
| 47 |
| 48 } // namespace cc |
OLD | NEW |