Lines Matching refs:rect2

43 bool IsCongruent(const LayerRect &rect1, const LayerRect &rect2) {  in IsCongruent()  argument
44 return ((rect1.left == rect2.left) && in IsCongruent()
45 (rect1.top == rect2.top) && in IsCongruent()
46 (rect1.right == rect2.right) && in IsCongruent()
47 (rect1.bottom == rect2.bottom)); in IsCongruent()
62 LayerRect Intersection(const LayerRect &rect1, const LayerRect &rect2) { in Intersection() argument
65 if (!IsValid(rect1) || !IsValid(rect2)) { in Intersection()
69 res.left = std::max(rect1.left, rect2.left); in Intersection()
70 res.top = std::max(rect1.top, rect2.top); in Intersection()
71 res.right = std::min(rect1.right, rect2.right); in Intersection()
72 res.bottom = std::min(rect1.bottom, rect2.bottom); in Intersection()
97 LayerRect Subtract(const LayerRect &rect1, const LayerRect &rect2) { in Subtract() argument
102 if ((rect1.left == rect2.left) && (rect1.right == rect2.right)) { in Subtract()
103 if ((rect1.top == rect2.top) && (rect2.bottom <= rect1.bottom)) { in Subtract()
104 res.top = rect2.bottom; in Subtract()
105 } else if ((rect1.bottom == rect2.bottom) && (rect2.top >= rect1.top)) { in Subtract()
106 res.bottom = rect2.top; in Subtract()
108 } else if ((rect1.top == rect2.top) && (rect1.bottom == rect2.bottom)) { in Subtract()
109 if ((rect1.left == rect2.left) && (rect2.right <= rect1.right)) { in Subtract()
110 res.left = rect2.right; in Subtract()
111 } else if ((rect1.right == rect2.right) && (rect2.left >= rect1.left)) { in Subtract()
112 res.right = rect2.left; in Subtract()
119 LayerRect Union(const LayerRect &rect1, const LayerRect &rect2) { in Union() argument
122 if (!IsValid(rect1) && !IsValid(rect2)) { in Union()
127 return rect2; in Union()
130 if (!IsValid(rect2)) { in Union()
134 res.left = std::min(rect1.left, rect2.left); in Union()
135 res.top = std::min(rect1.top, rect2.top); in Union()
136 res.right = std::max(rect1.right, rect2.right); in Union()
137 res.bottom = std::max(rect1.bottom, rect2.bottom); in Union()