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

Side by Side Diff: ui/gfx/size.h

Issue 11081007: Remove implicit flooring Scale() method from Point and Size. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « ui/gfx/shadow_value.cc ('k') | ui/gfx/size_base.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 UI_GFX_SIZE_H_ 5 #ifndef UI_GFX_SIZE_H_
6 #define UI_GFX_SIZE_H_ 6 #define UI_GFX_SIZE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 29 matching lines...) Expand all
40 #if defined(OS_WIN) 40 #if defined(OS_WIN)
41 SIZE ToSIZE() const; 41 SIZE ToSIZE() const;
42 #elif defined(OS_MACOSX) 42 #elif defined(OS_MACOSX)
43 CGSize ToCGSize() const; 43 CGSize ToCGSize() const;
44 #endif 44 #endif
45 45
46 SizeF ToSizeF() const { 46 SizeF ToSizeF() const {
47 return SizeF(width(), height()); 47 return SizeF(width(), height());
48 } 48 }
49 49
50 SizeF Scale(float scale) const WARN_UNUSED_RESULT {
51 return Scale(scale, scale);
52 }
53
54 SizeF Scale(float x_scale, float y_scale) const WARN_UNUSED_RESULT {
55 return SizeF(width() * x_scale, height() * y_scale);
56 }
57
50 std::string ToString() const; 58 std::string ToString() const;
51 }; 59 };
52 60
53 #if !defined(COMPILER_MSVC) 61 #if !defined(COMPILER_MSVC)
54 extern template class SizeBase<Size, int>; 62 extern template class SizeBase<Size, int>;
55 #endif 63 #endif
56 64
57 } // namespace gfx 65 } // namespace gfx
58 66
59 #endif // UI_GFX_SIZE_H_ 67 #endif // UI_GFX_SIZE_H_
OLDNEW
« no previous file with comments | « ui/gfx/shadow_value.cc ('k') | ui/gfx/size_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698