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

Side by Side Diff: ui/gfx/geometry/insets.h

Issue 649203003: Type conversion fixes, ui/gfx/ edition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: SkIntToMScalar 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 // 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_GEOMETRY_INSETS_H_ 5 #ifndef UI_GFX_GEOMETRY_INSETS_H_
6 #define UI_GFX_GEOMETRY_INSETS_H_ 6 #define UI_GFX_GEOMETRY_INSETS_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 16 matching lines...) Expand all
27 } 27 }
28 28
29 Insets Scale(float x_scale, float y_scale) const { 29 Insets Scale(float x_scale, float y_scale) const {
30 return Insets(static_cast<int>(top() * y_scale), 30 return Insets(static_cast<int>(top() * y_scale),
31 static_cast<int>(left() * x_scale), 31 static_cast<int>(left() * x_scale),
32 static_cast<int>(bottom() * y_scale), 32 static_cast<int>(bottom() * y_scale),
33 static_cast<int>(right() * x_scale)); 33 static_cast<int>(right() * x_scale));
34 } 34 }
35 35
36 operator InsetsF() const { 36 operator InsetsF() const {
37 return InsetsF(top(), left(), bottom(), right()); 37 return InsetsF(static_cast<float>(top()), static_cast<float>(left()),
38 static_cast<float>(bottom()), static_cast<float>(right()));
38 } 39 }
39 40
40 // Returns a string representation of the insets. 41 // Returns a string representation of the insets.
41 std::string ToString() const; 42 std::string ToString() const;
42 }; 43 };
43 44
44 #if !defined(COMPILER_MSVC) && !defined(__native_client__) 45 #if !defined(COMPILER_MSVC) && !defined(__native_client__)
45 extern template class InsetsBase<Insets, int>; 46 extern template class InsetsBase<Insets, int>;
46 #endif 47 #endif
47 48
48 } // namespace gfx 49 } // namespace gfx
49 50
50 #endif // UI_GFX_GEOMETRY_INSETS_H_ 51 #endif // UI_GFX_GEOMETRY_INSETS_H_
OLDNEW
« no previous file with comments | « ui/gfx/display.cc ('k') | ui/gfx/geometry/matrix3_f.cc » ('j') | ui/gfx/geometry/rect.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698