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_sticky_position_constraint.h" |
| 6 |
| 7 namespace cc { |
| 8 |
| 9 LayerStickyPositionConstraint::LayerStickyPositionConstraint() |
| 10 : is_sticky(false), |
| 11 is_anchored_left(false), |
| 12 is_anchored_right(false), |
| 13 is_anchored_top(false), |
| 14 is_anchored_bottom(false), |
| 15 left_offset(0.f), |
| 16 right_offset(0.f), |
| 17 top_offset(0.f), |
| 18 bottom_offset(0.f) {} |
| 19 |
| 20 LayerStickyPositionConstraint::LayerStickyPositionConstraint( |
| 21 const LayerStickyPositionConstraint& other) |
| 22 : is_sticky(other.is_sticky), |
| 23 is_anchored_left(other.is_anchored_left), |
| 24 is_anchored_right(other.is_anchored_right), |
| 25 is_anchored_top(other.is_anchored_top), |
| 26 is_anchored_bottom(other.is_anchored_bottom), |
| 27 left_offset(other.left_offset), |
| 28 right_offset(other.right_offset), |
| 29 top_offset(other.top_offset), |
| 30 bottom_offset(other.bottom_offset), |
| 31 absolute_sticky_box_rect(other.absolute_sticky_box_rect), |
| 32 absolute_containing_block_rect(other.absolute_containing_block_rect) {} |
| 33 |
| 34 bool LayerStickyPositionConstraint::operator==( |
| 35 const LayerStickyPositionConstraint& other) const { |
| 36 if (!is_sticky && !other.is_sticky) |
| 37 return true; |
| 38 return is_sticky == other.is_sticky && |
| 39 is_anchored_left == other.is_anchored_left && |
| 40 is_anchored_right == other.is_anchored_right && |
| 41 is_anchored_top == other.is_anchored_top && |
| 42 is_anchored_bottom == other.is_anchored_bottom && |
| 43 left_offset == other.left_offset && |
| 44 right_offset == other.right_offset && top_offset == other.top_offset && |
| 45 bottom_offset == other.bottom_offset && |
| 46 absolute_sticky_box_rect == other.absolute_sticky_box_rect && |
| 47 absolute_containing_block_rect == other.absolute_containing_block_rect; |
| 48 } |
| 49 |
| 50 bool LayerStickyPositionConstraint::operator!=( |
| 51 const LayerStickyPositionConstraint& other) const { |
| 52 return !(*this == other); |
| 53 } |
| 54 |
| 55 } // namespace cc |
OLD | NEW |