diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2013-09-13 12:51:20 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-19 20:50:05 +0200 |
commit | d441d6f39bb846989d95bcf5caf387b42414718d (patch) | |
tree | e367e64a75991c554930278175d403c072de6bb8 /Source/WebCore/platform/graphics/FloatSize.h | |
parent | 0060b2994c07842f4c59de64b5e3e430525c4b90 (diff) | |
download | qtwebkit-d441d6f39bb846989d95bcf5caf387b42414718d.tar.gz |
Import Qt5x2 branch of QtWebkit for Qt 5.2
Importing a new snapshot of webkit.
Change-Id: I2d01ad12cdc8af8cb015387641120a9d7ea5f10c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'Source/WebCore/platform/graphics/FloatSize.h')
-rw-r--r-- | Source/WebCore/platform/graphics/FloatSize.h | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/Source/WebCore/platform/graphics/FloatSize.h b/Source/WebCore/platform/graphics/FloatSize.h index 2ca22cdd4..1b40851e9 100644 --- a/Source/WebCore/platform/graphics/FloatSize.h +++ b/Source/WebCore/platform/graphics/FloatSize.h @@ -45,11 +45,11 @@ class FloatSize; } #endif -#if USE(CG) || (PLATFORM(WX) && OS(DARWIN)) || USE(SKIA_ON_MAC_CHROMIUM) +#if USE(CG) typedef struct CGSize CGSize; #endif -#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN)) || (PLATFORM(QT) && USE(QTKIT)) +#if PLATFORM(MAC) #ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES typedef struct CGSize NSSize; #else @@ -60,14 +60,12 @@ typedef struct _NSSize NSSize; namespace WebCore { class IntSize; -class LayoutSize; class FloatSize { public: FloatSize() : m_width(0), m_height(0) { } FloatSize(float width, float height) : m_width(width), m_height(height) { } FloatSize(const IntSize&); - FloatSize(const LayoutSize&); static FloatSize narrowPrecision(double width, double height); @@ -130,14 +128,12 @@ public: operator BlackBerry::Platform::FloatSize() const; #endif -#if USE(CG) || (PLATFORM(WX) && OS(DARWIN)) || USE(SKIA_ON_MAC_CHROMIUM) +#if USE(CG) explicit FloatSize(const CGSize&); // don't do this implicitly since it's lossy operator CGSize() const; #endif -#if (PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))) \ - && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES) \ - || (PLATFORM(QT) && USE(QTKIT)) +#if (PLATFORM(MAC) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES)) explicit FloatSize(const NSSize &); // don't do this implicitly since it's lossy operator NSSize() const; #endif @@ -175,6 +171,16 @@ inline FloatSize operator-(const FloatSize& size) return FloatSize(-size.width(), -size.height()); } +inline FloatSize operator*(const FloatSize& a, const float b) +{ + return FloatSize(a.width() * b, a.height() * b); +} + +inline FloatSize operator*(const float a, const FloatSize& b) +{ + return FloatSize(a * b.width(), a * b.height()); +} + inline bool operator==(const FloatSize& a, const FloatSize& b) { return a.width() == b.width() && a.height() == b.height(); |