blob: d2c6bf2e6856bd2ad13bf8b5c237a28754defbaf [file] [log] [blame]
Xianzhu Wanga1aa0552022-01-11 05:45:571// Copyright 2022 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#ifndef UI_GFX_GEOMETRY_OUTSETS_F_H_
6#define UI_GFX_GEOMETRY_OUTSETS_F_H_
7
8#include "ui/gfx/geometry/geometry_export.h"
9#include "ui/gfx/geometry/insets_outsets_f_base.h"
10
11namespace gfx {
12
13// A floating point version of gfx::Outsets.
14class GEOMETRY_EXPORT OutsetsF : public InsetsOutsetsFBase<OutsetsF> {
15 public:
16 using InsetsOutsetsFBase::InsetsOutsetsFBase;
17};
18
19inline OutsetsF operator+(OutsetsF lhs, const OutsetsF& rhs) {
20 lhs += rhs;
21 return lhs;
22}
23
24inline OutsetsF operator-(OutsetsF lhs, const OutsetsF& rhs) {
25 lhs -= rhs;
26 return lhs;
27}
28
29// This is declared here for use in gtest-based unit tests but is defined in
30// the //ui/gfx:test_support target. Depend on that to use this in your unit
31// test. This should not be used in production code - call ToString() instead.
32void PrintTo(const OutsetsF&, ::std::ostream* os);
33
34} // namespace gfx
35
36#endif // UI_GFX_GEOMETRY_OUTSETS_F_H_