mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-26 11:45:37 +00:00
8efac8fa7f
MozReview-Commit-ID: DYEZNrGLKnC --HG-- extra : rebase_source : abd165da6204c83271e027bbe5a924c417d44ca1
30 lines
655 B
GLSL
30 lines
655 B
GLSL
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
struct RectWithSize {
|
|
vec2 p0;
|
|
vec2 size;
|
|
};
|
|
|
|
struct RectWithEndpoint {
|
|
vec2 p0;
|
|
vec2 p1;
|
|
};
|
|
|
|
RectWithEndpoint to_rect_with_endpoint(RectWithSize rect) {
|
|
RectWithEndpoint result;
|
|
result.p0 = rect.p0;
|
|
result.p1 = rect.p0 + rect.size;
|
|
|
|
return result;
|
|
}
|
|
|
|
RectWithSize to_rect_with_size(RectWithEndpoint rect) {
|
|
RectWithSize result;
|
|
result.p0 = rect.p0;
|
|
result.size = rect.p1 - rect.p0;
|
|
|
|
return result;
|
|
}
|