summaryrefslogtreecommitdiffstats
path: root/ui/gfx/rect_base.h
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-27 23:33:48 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-27 23:33:48 +0000
commit3f6ffb8f5a4a78d63a53526c220e74a500fa8eba (patch)
treed07b13f007134878d268db46087f80c19dd8c088 /ui/gfx/rect_base.h
parent084d97a144cba94376a578190839aa96ddb7d78c (diff)
downloadchromium_src-3f6ffb8f5a4a78d63a53526c220e74a500fa8eba.zip
chromium_src-3f6ffb8f5a4a78d63a53526c220e74a500fa8eba.tar.gz
chromium_src-3f6ffb8f5a4a78d63a53526c220e74a500fa8eba.tar.bz2
This change makes Aura/Views to use DIP, while keeping layer to use Pixels. This allow chrome/ash to run on high density screen in High Density Incompatible mode (everything scaled to 2x), except for web contents.
I put this behind ENABLE_DIP to avoid regression. I'll make it runtime flag next week when we get render working. BUG=114666 TEST=manual: run with --aura-host-window-size=1000x800*2. Review URL: https://chromiumcodereview.appspot.com/10081011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134391 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/rect_base.h')
-rw-r--r--ui/gfx/rect_base.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/ui/gfx/rect_base.h b/ui/gfx/rect_base.h
index 3a273fe2..0cb346f 100644
--- a/ui/gfx/rect_base.h
+++ b/ui/gfx/rect_base.h
@@ -64,6 +64,23 @@ class UI_EXPORT RectBase {
Offset(point.x(), point.y());
}
+ /// Scales the rectangle by |scale|.
+ Class Scale(float scale) const {
+ return Scale(scale, scale);
+ }
+
+ Class Scale(float x_scale, float y_scale) const {
+ return Class(origin_.Scale(x_scale, y_scale),
+ size_.Scale(x_scale, y_scale));
+ }
+
+ InsetsClass InsetsFrom(const Class& inner) const {
+ return InsetsClass(inner.y() - y(),
+ inner.x() - x(),
+ bottom() - inner.bottom(),
+ right() - inner.right());
+ }
+
// Returns true if the area of the rectangle is zero.
bool IsEmpty() const { return size_.IsEmpty(); }