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

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

Issue 1447273003: Make the FloatSize constructor from an IntSize explicit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 /* 1 /*
2 * Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved.
3 * Copyright (C) 2005 Nokia. All rights reserved. 3 * Copyright (C) 2005 Nokia. All rights reserved.
4 * 2008 Eric Seidel <eric@webkit.org> 4 * 2008 Eric Seidel <eric@webkit.org>
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 namespace blink { 44 namespace blink {
45 45
46 class IntSize; 46 class IntSize;
47 class LayoutSize; 47 class LayoutSize;
48 48
49 class PLATFORM_EXPORT FloatSize { 49 class PLATFORM_EXPORT FloatSize {
50 public: 50 public:
51 FloatSize() : m_width(0), m_height(0) { } 51 FloatSize() : m_width(0), m_height(0) { }
52 FloatSize(float width, float height) : m_width(width), m_height(height) { } 52 FloatSize(float width, float height) : m_width(width), m_height(height) { }
53 FloatSize(const IntSize& size) : m_width(size.width()), m_height(size.height ()) { } 53 explicit FloatSize(const IntSize& size) : m_width(size.width()), m_height(si ze.height()) { }
54 FloatSize(const SkSize& size) : m_width(size.width()), m_height(size.height( )) { } 54 FloatSize(const SkSize& size) : m_width(size.width()), m_height(size.height( )) { }
55 explicit FloatSize(const LayoutSize&); 55 explicit FloatSize(const LayoutSize&);
56 56
57 static FloatSize narrowPrecision(double width, double height); 57 static FloatSize narrowPrecision(double width, double height);
58 58
59 float width() const { return m_width; } 59 float width() const { return m_width; }
60 float height() const { return m_height; } 60 float height() const { return m_height; }
61 61
62 void setWidth(float width) { m_width = width; } 62 void setWidth(float width) { m_width = width; }
63 void setHeight(float height) { m_height = height; } 63 void setHeight(float height) { m_height = height; }
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 return IntPoint(clampTo<int>(floorf(p.width())), clampTo<int>(floorf(p.heigh t()))); 205 return IntPoint(clampTo<int>(floorf(p.width())), clampTo<int>(floorf(p.heigh t())));
206 } 206 }
207 207
208 // Redeclared here to avoid ODR issues. 208 // Redeclared here to avoid ODR issues.
209 // See platform/testing/GeometryPrinters.h. 209 // See platform/testing/GeometryPrinters.h.
210 void PrintTo(const FloatSize&, std::ostream*); 210 void PrintTo(const FloatSize&, std::ostream*);
211 211
212 } // namespace blink 212 } // namespace blink
213 213
214 #endif // FloatSize_h 214 #endif // FloatSize_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698