diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-12 17:05:23 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-12 17:05:23 +0000 |
commit | 25bc29d411ee9b75c133c007f5c18710ffa589ca (patch) | |
tree | 626a219a163fbe8e5afea372343dbcaccdfb1e51 /ui/gfx | |
parent | 83a072aa7f45bd4fc5c4ecbfa0fd565b3fe5f648 (diff) | |
download | chromium_src-25bc29d411ee9b75c133c007f5c18710ffa589ca.zip chromium_src-25bc29d411ee9b75c133c007f5c18710ffa589ca.tar.gz chromium_src-25bc29d411ee9b75c133c007f5c18710ffa589ca.tar.bz2 |
- Add temporary support for High Density Incompatible mode (scale to 2x) to NativeWidgetAura.
This allow us to work on making views HD compatible while I'm working on aura side.
Conversion code will be removed once Aura supports scaling factor.
- Add scaleing method to point/size
- Add set_device_scale_factor that I missed.
BUG=none
TEST=none
Review URL: https://chromiumcodereview.appspot.com/10068005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132002 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx')
-rw-r--r-- | ui/gfx/point_base.h | 9 | ||||
-rw-r--r-- | ui/gfx/size_base.h | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/ui/gfx/point_base.h b/ui/gfx/point_base.h index 8fb8766..1568c52 100644 --- a/ui/gfx/point_base.h +++ b/ui/gfx/point_base.h @@ -33,6 +33,15 @@ class UI_EXPORT PointBase { y_ += delta_y; } + Class Scale(float scale) const { + return Scale(scale, scale); + } + + Class Scale(float x_scale, float y_scale) const { + return Class(static_cast<Type>(x_ * x_scale), + static_cast<Type>(y_ * y_scale)); + } + Class Add(const Class& other) const{ const Class* orig = static_cast<const Class*>(this); Class copy = *orig; diff --git a/ui/gfx/size_base.h b/ui/gfx/size_base.h index 1256f7f..590989e 100644 --- a/ui/gfx/size_base.h +++ b/ui/gfx/size_base.h @@ -32,6 +32,15 @@ class UI_EXPORT SizeBase { set_height(height_ + height); } + Class Scale(float scale) const { + return Scale(scale, scale); + } + + Class Scale(float x_scale, float y_scale) const { + return Class(static_cast<Type>(width_ * x_scale), + static_cast<Type>(height_ * y_scale)); + } + void set_width(Type width); void set_height(Type height); |