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

Side by Side Diff: sky/engine/platform/Length.h

Issue 719063002: Revert "Remove support for MSVC" (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 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) 1999 Lars Knoll (knoll@kde.org) 2 Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 Copyright (C) 2006, 2008 Apple Inc. All rights reserved. 3 Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
4 Copyright (C) 2011 Rik Cabanier (cabanier@adobe.com) 4 Copyright (C) 2011 Rik Cabanier (cabanier@adobe.com)
5 Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 5 Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
6 6
7 This library is free software; you can redistribute it and/or 7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public 8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either 9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version. 10 version 2 of the License, or (at your option) any later version.
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 Length& operator=(const Length& length) 113 Length& operator=(const Length& length)
114 { 114 {
115 if (length.isCalculated()) 115 if (length.isCalculated())
116 length.incrementCalculatedRef(); 116 length.incrementCalculatedRef();
117 if (isCalculated()) 117 if (isCalculated())
118 decrementCalculatedRef(); 118 decrementCalculatedRef();
119 memcpy(this, &length, sizeof(Length)); 119 memcpy(this, &length, sizeof(Length));
120 return *this; 120 return *this;
121 } 121 }
122 122
123 #if COMPILER_SUPPORTS(CXX_RVALUE_REFERENCES)
123 Length(Length&& length) 124 Length(Length&& length)
124 { 125 {
125 memcpy(this, &length, sizeof(Length)); 126 memcpy(this, &length, sizeof(Length));
126 127
127 // Reset |length|'s type to Auto to make sure its destructor 128 // Reset |length|'s type to Auto to make sure its destructor
128 // won't call decrementCalculatedRef() as we don't call 129 // won't call decrementCalculatedRef() as we don't call
129 // incrementCalculatedRef() here. 130 // incrementCalculatedRef() here.
130 length.m_type = Auto; 131 length.m_type = Auto;
131 } 132 }
132 133
133 Length& operator=(Length&& length) 134 Length& operator=(Length&& length)
134 { 135 {
135 if (this == &length) 136 if (this == &length)
136 return *this; 137 return *this;
137 138
138 if (isCalculated()) 139 if (isCalculated())
139 decrementCalculatedRef(); 140 decrementCalculatedRef();
140 141
141 memcpy(this, &length, sizeof(Length)); 142 memcpy(this, &length, sizeof(Length));
142 143
143 // Reset |length|'s type to Auto to make sure its destructor 144 // Reset |length|'s type to Auto to make sure its destructor
144 // won't call decrementCalculatedRef() as we don't call 145 // won't call decrementCalculatedRef() as we don't call
145 // incrementCalculatedRef() here. 146 // incrementCalculatedRef() here.
146 length.m_type = Auto; 147 length.m_type = Auto;
147 148
148 return *this; 149 return *this;
149 } 150 }
151 #endif
150 152
151 ~Length() 153 ~Length()
152 { 154 {
153 if (isCalculated()) 155 if (isCalculated())
154 decrementCalculatedRef(); 156 decrementCalculatedRef();
155 } 157 }
156 158
157 bool operator==(const Length& o) const { return (m_type == o.m_type) && (m_q uirk == o.m_quirk) && (isMaxSizeNone() || (getFloatValue() == o.getFloatValue()) || isCalculatedEqual(o)); } 159 bool operator==(const Length& o) const { return (m_type == o.m_type) && (m_q uirk == o.m_quirk) && (isMaxSizeNone() || (getFloatValue() == o.getFloatValue()) || isCalculatedEqual(o)); }
158 bool operator!=(const Length& o) const { return !(*this == o); } 160 bool operator!=(const Length& o) const { return !(*this == o); }
159 161
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 float m_floatValue; 346 float m_floatValue;
345 }; 347 };
346 bool m_quirk; 348 bool m_quirk;
347 unsigned char m_type; 349 unsigned char m_type;
348 bool m_isFloat; 350 bool m_isFloat;
349 }; 351 };
350 352
351 } // namespace blink 353 } // namespace blink
352 354
353 #endif // Length_h 355 #endif // Length_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698