// Copyright 2012 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef UI_GFX_GEOMETRY_QUAD_F_H_ #define UI_GFX_GEOMETRY_QUAD_F_H_ #include <stddef.h> #include <algorithm> #include <cmath> #include <iosfwd> #include <string> #include "base/check_op.h" #include "ui/gfx/geometry/geometry_export.h" #include "ui/gfx/geometry/point_f.h" #include "ui/gfx/geometry/rect_f.h" namespace gfx { // A Quad is defined by four corners, allowing it to have edges that are not // axis-aligned, unlike a Rect. class GEOMETRY_EXPORT QuadF { … }; inline bool operator==(const QuadF& lhs, const QuadF& rhs) { … } inline bool operator!=(const QuadF& lhs, const QuadF& rhs) { … } // Add a vector to a quad, offseting each point in the quad by the vector. GEOMETRY_EXPORT QuadF operator+(const QuadF& lhs, const Vector2dF& rhs); // Subtract a vector from a quad, offseting each point in the quad by the // inverse of the vector. GEOMETRY_EXPORT QuadF operator-(const QuadF& lhs, const Vector2dF& rhs); // This is declared here for use in gtest-based unit tests but is defined in // the //ui/gfx:test_support target. Depend on that to use this in your unit // test. This should not be used in production code - call ToString() instead. void PrintTo(const QuadF& quad, ::std::ostream* os); } // namespace gfx #endif // UI_GFX_GEOMETRY_QUAD_F_H_