Lines Matching refs:rect1

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()
67 LayerRect Intersection(const LayerRect &rect1, const LayerRect &rect2) { in Intersection() argument
70 if (!IsValid(rect1) || !IsValid(rect2)) { in Intersection()
74 res.left = std::max(rect1.left, rect2.left); in Intersection()
75 res.top = std::max(rect1.top, rect2.top); in Intersection()
76 res.right = std::min(rect1.right, rect2.right); in Intersection()
77 res.bottom = std::min(rect1.bottom, rect2.bottom); in Intersection()
102 LayerRect Subtract(const LayerRect &rect1, const LayerRect &rect2) { in Subtract() argument
105 res = rect1; in Subtract()
107 if ((rect1.left == rect2.left) && (rect1.right == rect2.right)) { in Subtract()
108 if ((rect1.top == rect2.top) && (rect2.bottom <= rect1.bottom)) { in Subtract()
110 } else if ((rect1.bottom == rect2.bottom) && (rect2.top >= rect1.top)) { in Subtract()
113 } else if ((rect1.top == rect2.top) && (rect1.bottom == rect2.bottom)) { in Subtract()
114 if ((rect1.left == rect2.left) && (rect2.right <= rect1.right)) { in Subtract()
116 } else if ((rect1.right == rect2.right) && (rect2.left >= rect1.left)) { in Subtract()
124 LayerRect Union(const LayerRect &rect1, const LayerRect &rect2) { in Union() argument
127 if (!IsValid(rect1) && !IsValid(rect2)) { in Union()
131 if (!IsValid(rect1)) { in Union()
136 return rect1; in Union()
139 res.left = std::min(rect1.left, rect2.left); in Union()
140 res.top = std::min(rect1.top, rect2.top); in Union()
141 res.right = std::max(rect1.right, rect2.right); in Union()
142 res.bottom = std::max(rect1.bottom, rect2.bottom); in Union()