Title: [235840] trunk/Source/WebCore
Revision
235840
Author
hironori.fu...@sony.com
Date
2018-09-09 22:12:44 -0700 (Sun, 09 Sep 2018)

Log Message

[Win][Clang] Add FloatRect(const RECT&) constructor
https://bugs.webkit.org/show_bug.cgi?id=189398

Reviewed by Alex Christensen.

While trying to build WebKit WinCairo port with the latest Clang
(Bug 171618), the following compilation errors were reported.

  error: no viable conversion from returned value of type 'RECT' (aka 'tagRECT') to function return type 'WebCore::FloatRect'

No new tests (No behavior change).

* platform/graphics/FloatRect.h:
* platform/graphics/win/FloatRectDirect2D.cpp:
(WebCore::FloatRect::FloatRect): Added a new constructor taking a RECT as the argument.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (235839 => 235840)


--- trunk/Source/WebCore/ChangeLog	2018-09-10 04:54:58 UTC (rev 235839)
+++ trunk/Source/WebCore/ChangeLog	2018-09-10 05:12:44 UTC (rev 235840)
@@ -1,3 +1,21 @@
+2018-09-09  Fujii Hironori  <hironori.fu...@sony.com>
+
+        [Win][Clang] Add FloatRect(const RECT&) constructor
+        https://bugs.webkit.org/show_bug.cgi?id=189398
+
+        Reviewed by Alex Christensen.
+
+        While trying to build WebKit WinCairo port with the latest Clang
+        (Bug 171618), the following compilation errors were reported.
+
+          error: no viable conversion from returned value of type 'RECT' (aka 'tagRECT') to function return type 'WebCore::FloatRect'
+
+        No new tests (No behavior change).
+
+        * platform/graphics/FloatRect.h:
+        * platform/graphics/win/FloatRectDirect2D.cpp:
+        (WebCore::FloatRect::FloatRect): Added a new constructor taking a RECT as the argument.
+
 2018-09-08  Andy Estes  <aes...@apple.com>
 
         [Apple Pay] Dispatch a paymentmethodchange event when the payment method changes

Modified: trunk/Source/WebCore/platform/graphics/FloatRect.h (235839 => 235840)


--- trunk/Source/WebCore/platform/graphics/FloatRect.h	2018-09-10 04:54:58 UTC (rev 235839)
+++ trunk/Source/WebCore/platform/graphics/FloatRect.h	2018-09-10 05:12:44 UTC (rev 235840)
@@ -45,6 +45,7 @@
 #endif
 
 #if PLATFORM(WIN)
+typedef struct tagRECT RECT;
 struct D2D_RECT_F;
 typedef D2D_RECT_F D2D1_RECT_F;
 #endif
@@ -195,6 +196,7 @@
 #endif
 
 #if PLATFORM(WIN)
+    WEBCORE_EXPORT FloatRect(const RECT&);
     WEBCORE_EXPORT FloatRect(const D2D1_RECT_F&);
     WEBCORE_EXPORT operator D2D1_RECT_F() const;
 #endif

Modified: trunk/Source/WebCore/platform/graphics/win/FloatRectDirect2D.cpp (235839 => 235840)


--- trunk/Source/WebCore/platform/graphics/win/FloatRectDirect2D.cpp	2018-09-10 04:54:58 UTC (rev 235839)
+++ trunk/Source/WebCore/platform/graphics/win/FloatRectDirect2D.cpp	2018-09-10 05:12:44 UTC (rev 235840)
@@ -50,6 +50,12 @@
     return true;
 }
 
+FloatRect::FloatRect(const RECT& rect)
+    : m_location(rect.left, rect.top)
+    , m_size(rect.right - rect.left, rect.bottom - rect.top)
+{
+}
+
 FloatRect::FloatRect(const D2D1_RECT_F& r)
 {
     // Infinite Rect case:
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to