2 // Copyright (c) 2017 Intel Corporation
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
17 #ifndef PUBLIC_HWCRECT_H_
18 #define PUBLIC_HWCRECT_H_
22 namespace hwcomposer {
24 // Some of the structs are adopted from drm_hwcomposer
25 template <typename TFloat>
29 TFloat left, top, right, bottom;
36 Rect(TFloat left_, TFloat top_, TFloat right_, TFloat bottom_)
37 : left(left_), top(top_), right(right_), bottom(bottom_) {
40 Rect(const Rect<T> &rhs) {
41 for (int i = 0; i < 4; i++)
42 bounds[i] = rhs.bounds[i];
45 Rect<TFloat> &operator=(const Rect<T> &rhs) {
46 for (int i = 0; i < 4; i++)
47 bounds[i] = rhs.bounds[i];
50 bool operator==(const Rect &rhs) const {
51 for (int i = 0; i < 4; i++) {
52 if (bounds[i] != rhs.bounds[i])
59 for (int i = 0; i < 4; i++) {
67 } // namespace hwcomposer
69 #endif // PUBLIC_HWCRECT_H_