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

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

Issue 1648573002: Transition to explicit constructors in LayoutUnit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moar tweaks! Created 4 years, 10 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 /* 1 /*
2 * Copyright (c) 2012, Google Inc. All rights reserved. 2 * Copyright (c) 2012, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 enum AspectRatioFit { 43 enum AspectRatioFit {
44 AspectRatioFitShrink, 44 AspectRatioFitShrink,
45 AspectRatioFitGrow 45 AspectRatioFitGrow
46 }; 46 };
47 47
48 class LayoutSize { 48 class LayoutSize {
49 DISALLOW_NEW(); 49 DISALLOW_NEW();
50 public: 50 public:
51 LayoutSize() { } 51 LayoutSize() { }
52 explicit LayoutSize(const IntSize& size) : m_width(size.width()), m_height(s ize.height()) { } 52 explicit LayoutSize(const IntSize& size) : m_width(size.width()), m_height(s ize.height()) { }
53 LayoutSize(int width, int height) : m_width(LayoutUnit(width)), m_height(Lay outUnit(height)) { }
53 LayoutSize(LayoutUnit width, LayoutUnit height) : m_width(width), m_height(h eight) { } 54 LayoutSize(LayoutUnit width, LayoutUnit height) : m_width(width), m_height(h eight) { }
54 55
55 explicit LayoutSize(const FloatSize& size) : m_width(size.width()), m_height (size.height()) { } 56 explicit LayoutSize(const FloatSize& size) : m_width(size.width()), m_height (size.height()) { }
56 explicit LayoutSize(const DoubleSize& size) : m_width(size.width()), m_heigh t(size.height()) { } 57 explicit LayoutSize(const DoubleSize& size) : m_width(size.width()), m_heigh t(size.height()) { }
57 58
58 LayoutUnit width() const { return m_width; } 59 LayoutUnit width() const { return m_width; }
59 LayoutUnit height() const { return m_height; } 60 LayoutUnit height() const { return m_height; }
60 61
61 void setWidth(LayoutUnit width) { m_width = width; } 62 void setWidth(LayoutUnit width) { m_width = width; }
62 void setHeight(LayoutUnit height) { m_height = height; } 63 void setHeight(LayoutUnit height) { m_height = height; }
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 } 218 }
218 219
219 inline LayoutSize roundedLayoutSize(const FloatSize& s) 220 inline LayoutSize roundedLayoutSize(const FloatSize& s)
220 { 221 {
221 return LayoutSize(s); 222 return LayoutSize(s);
222 } 223 }
223 224
224 } // namespace blink 225 } // namespace blink
225 226
226 #endif // LayoutSize_h 227 #endif // LayoutSize_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698