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

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

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 #include "platform/geometry/DoubleRect.h" 5 #include "platform/geometry/DoubleRect.h"
6 6
7 #include "platform/geometry/FloatRect.h" 7 #include "platform/geometry/FloatRect.h"
8 #include "platform/geometry/IntRect.h" 8 #include "platform/geometry/IntRect.h"
9 #include "platform/geometry/LayoutRect.h" 9 #include "platform/geometry/LayoutRect.h"
10
11 #include "wtf/text/WTFString.h" 10 #include "wtf/text/WTFString.h"
12 11
13 namespace blink { 12 namespace blink {
14 13
15 DoubleRect::DoubleRect(const IntRect& r) : m_location(r.location()), m_size(r.si ze()) 14 DoubleRect::DoubleRect(const IntRect& r) : m_location(r.location()), m_size(r.si ze())
16 { 15 {
17 } 16 }
18 17
19 DoubleRect::DoubleRect(const FloatRect& r) : m_location(r.location()), m_size(r. size()) 18 DoubleRect::DoubleRect(const FloatRect& r) : m_location(r.location()), m_size(r. size())
20 { 19 {
(...skipping 27 matching lines...) Expand all
48 } 47 }
49 48
50 void DoubleRect::scale(float sx, float sy) 49 void DoubleRect::scale(float sx, float sy)
51 { 50 {
52 m_location.setX(x() * sx); 51 m_location.setX(x() * sx);
53 m_location.setY(y() * sy); 52 m_location.setY(y() * sy);
54 m_size.setWidth(width() * sx); 53 m_size.setWidth(width() * sx);
55 m_size.setHeight(height() * sy); 54 m_size.setHeight(height() * sy);
56 } 55 }
57 56
58 #ifndef NDEBUG
59 String DoubleRect::toString() const 57 String DoubleRect::toString() const
60 { 58 {
61 return String::format("%s %s", location().toString().ascii().data(), size(). toString().ascii().data()); 59 return String::format("%s %s", location().toString().ascii().data(), size(). toString().ascii().data());
62 } 60 }
63 #endif
64 61
65 } // namespace blink 62 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698