Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Side by Side Diff: third_party/WebKit/Source/platform/geometry/DoubleRect.h

Issue 2195903002: Add Double{Size, Point, Rect} pretty printers for logging and testing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@geometryPrettyPrinters2
Patch Set: Remove unnecessary String casts Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef DoubleRect_h 5 #ifndef DoubleRect_h
6 #define DoubleRect_h 6 #define DoubleRect_h
7 7
8 #include "platform/geometry/DoublePoint.h" 8 #include "platform/geometry/DoublePoint.h"
9 #include "platform/geometry/DoubleSize.h" 9 #include "platform/geometry/DoubleSize.h"
10 #include "wtf/Allocator.h" 10 #include "wtf/Allocator.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 void moveBy(const DoublePoint& delta) { m_location.move(delta.x(), delta.y() ); } 54 void moveBy(const DoublePoint& delta) { m_location.move(delta.x(), delta.y() ); }
55 55
56 DoublePoint minXMinYCorner() const { return m_location; } // typically topLe ft 56 DoublePoint minXMinYCorner() const { return m_location; } // typically topLe ft
57 DoublePoint maxXMinYCorner() const { return DoublePoint(m_location.x() + m_s ize.width(), m_location.y()); } // typically topRight 57 DoublePoint maxXMinYCorner() const { return DoublePoint(m_location.x() + m_s ize.width(), m_location.y()); } // typically topRight
58 DoublePoint minXMaxYCorner() const { return DoublePoint(m_location.x(), m_lo cation.y() + m_size.height()); } // typically bottomLeft 58 DoublePoint minXMaxYCorner() const { return DoublePoint(m_location.x(), m_lo cation.y() + m_size.height()); } // typically bottomLeft
59 DoublePoint maxXMaxYCorner() const { return DoublePoint(m_location.x() + m_s ize.width(), m_location.y() + m_size.height()); } // typically bottomRight 59 DoublePoint maxXMaxYCorner() const { return DoublePoint(m_location.x() + m_s ize.width(), m_location.y() + m_size.height()); } // typically bottomRight
60 60
61 void scale(float s) { scale(s, s); } 61 void scale(float s) { scale(s, s); }
62 void scale(float sx, float sy); 62 void scale(float sx, float sy);
63 63
64 #ifndef NDEBUG
65 String toString() const; 64 String toString() const;
66 #endif
67 65
68 private: 66 private:
69 DoublePoint m_location; 67 DoublePoint m_location;
70 DoubleSize m_size; 68 DoubleSize m_size;
71 }; 69 };
72 70
73 PLATFORM_EXPORT IntRect enclosingIntRect(const DoubleRect&); 71 PLATFORM_EXPORT IntRect enclosingIntRect(const DoubleRect&);
74 72
75 // Returns a valid IntRect contained within the given DoubleRect. 73 // Returns a valid IntRect contained within the given DoubleRect.
76 PLATFORM_EXPORT IntRect enclosedIntRect(const DoubleRect&); 74 PLATFORM_EXPORT IntRect enclosedIntRect(const DoubleRect&);
77 75
78 PLATFORM_EXPORT IntRect roundedIntRect(const DoubleRect&); 76 PLATFORM_EXPORT IntRect roundedIntRect(const DoubleRect&);
79 77
78 // Redeclared here to avoid ODR issues.
79 // See platform/testing/GeometryPrinters.h.
80 void PrintTo(const DoubleRect&, std::ostream*);
81
80 } // namespace blink 82 } // namespace blink
81 83
82 #endif 84 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698