Title: [123511] trunk/Source/Platform
Revision
123511
Author
leandrogra...@chromium.org
Date
2012-07-24 12:48:07 -0700 (Tue, 24 Jul 2012)

Log Message

[Chromium] Enable conversion between WebFloatRect and gfx::RectF.
https://bugs.webkit.org/show_bug.cgi?id=92117

Reviewed by Adam Barth.

Introduce WebFloatRect <--> gfx::RectF conversion as we already do with WebRect <--> gfx::Rect.

* chromium/public/WebFloatRect.h:
(WebKit::WebFloatRect::WebFloatRect):
(WebFloatRect):
(WebKit::WebFloatRect::operator=):
(WebKit::WebFloatRect::operator gfx::RectF):

Modified Paths

Diff

Modified: trunk/Source/Platform/ChangeLog (123510 => 123511)


--- trunk/Source/Platform/ChangeLog	2012-07-24 19:47:18 UTC (rev 123510)
+++ trunk/Source/Platform/ChangeLog	2012-07-24 19:48:07 UTC (rev 123511)
@@ -1,3 +1,18 @@
+2012-07-24  Leandro Gracia Gil  <leandrogra...@chromium.org>
+
+        [Chromium] Enable conversion between WebFloatRect and gfx::RectF.
+        https://bugs.webkit.org/show_bug.cgi?id=92117
+
+        Reviewed by Adam Barth.
+
+        Introduce WebFloatRect <--> gfx::RectF conversion as we already do with WebRect <--> gfx::Rect.
+
+        * chromium/public/WebFloatRect.h:
+        (WebKit::WebFloatRect::WebFloatRect):
+        (WebFloatRect):
+        (WebKit::WebFloatRect::operator=):
+        (WebKit::WebFloatRect::operator gfx::RectF):
+
 2012-07-24  Tommy Widenflycht  <tom...@google.com>
 
         MediaStream API: Update MediaStreamTrack to match the specification

Modified: trunk/Source/Platform/chromium/public/WebFloatRect.h (123510 => 123511)


--- trunk/Source/Platform/chromium/public/WebFloatRect.h	2012-07-24 19:47:18 UTC (rev 123510)
+++ trunk/Source/Platform/chromium/public/WebFloatRect.h	2012-07-24 19:48:07 UTC (rev 123511)
@@ -35,6 +35,8 @@
 
 #if WEBKIT_IMPLEMENTATION
 #include "FloatRect.h"
+#else
+#include <ui/gfx/rect_f.h>
 #endif
 
 namespace WebKit {
@@ -48,10 +50,10 @@
     bool isEmpty() const { return width <= 0 || height <= 0; }
 
     WebFloatRect()
-        : x(0.0f)
-        , y(0.0f)
-        , width(0.0f)
-        , height(0.0f)
+        : x(0)
+        , y(0)
+        , width(0)
+        , height(0)
     {
     }
 
@@ -85,6 +87,28 @@
     {
         return WebCore::FloatRect(x, y, width, height);
     }
+#else
+    WebFloatRect(const gfx::RectF& r)
+        : x(r.x())
+        , y(r.y())
+        , width(r.width())
+        , height(r.height())
+    {
+    }
+
+    WebFloatRect& operator=(const gfx::RectF& r)
+    {
+        x = r.x();
+        y = r.y();
+        width = r.width();
+        height = r.height();
+        return *this;
+    }
+
+    operator gfx::RectF() const
+    {
+        return gfx::RectF(x, y, width, height);
+    }
 #endif
 };
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to