diff options
author | Ben Murdoch <benm@google.com> | 2010-07-22 15:37:06 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-07-27 10:20:25 +0100 |
commit | 967717af5423377c967781471ee106e2bb4e11c8 (patch) | |
tree | 1e701dc0a12f7f07cce1df4a7681717de77a211b /WebCore/platform/graphics/FloatPoint.h | |
parent | dcc30a9fca45f634b1d3a12b276d3a0ccce99fc3 (diff) | |
download | external_webkit-967717af5423377c967781471ee106e2bb4e11c8.zip external_webkit-967717af5423377c967781471ee106e2bb4e11c8.tar.gz external_webkit-967717af5423377c967781471ee106e2bb4e11c8.tar.bz2 |
Merge WebKit at r63859 : Initial merge by git.
Change-Id: Ie8096c63ec7c991c9a9cba8bdd9c3b74a3b8ed62
Diffstat (limited to 'WebCore/platform/graphics/FloatPoint.h')
-rw-r--r-- | WebCore/platform/graphics/FloatPoint.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/WebCore/platform/graphics/FloatPoint.h b/WebCore/platform/graphics/FloatPoint.h index 7443e97..5018f1d 100644 --- a/WebCore/platform/graphics/FloatPoint.h +++ b/WebCore/platform/graphics/FloatPoint.h @@ -80,7 +80,16 @@ public: void setX(float x) { m_x = x; } void setY(float y) { m_y = y; } - void move(float dx, float dy) { m_x += dx; m_y += dy; } + void move(float dx, float dy) + { + m_x += dx; + m_y += dy; + } + void scale(float sx, float sy) + { + m_x *= sx; + m_y *= sy; + } #if PLATFORM(CG) FloatPoint(const CGPoint&); @@ -122,6 +131,12 @@ inline FloatPoint& operator+=(FloatPoint& a, const FloatSize& b) return a; } +inline FloatPoint& operator+=(FloatPoint& a, const FloatPoint& b) +{ + a.move(b.x(), b.y()); + return a; +} + inline FloatPoint& operator-=(FloatPoint& a, const FloatSize& b) { a.move(-b.width(), -b.height()); @@ -133,6 +148,11 @@ inline FloatPoint operator+(const FloatPoint& a, const FloatSize& b) return FloatPoint(a.x() + b.width(), a.y() + b.height()); } +inline FloatPoint operator+(const FloatPoint& a, const FloatPoint& b) +{ + return FloatPoint(a.x() + b.x(), a.y() + b.y()); +} + inline FloatSize operator-(const FloatPoint& a, const FloatPoint& b) { return FloatSize(a.x() - b.x(), a.y() - b.y()); |