⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 287868 in webkit


Ignore:
Timestamp:
Jan 10, 2022, 9:04:15 PM (5 years ago)
Author:
ysuzuki@apple.com
Message:

Fix Windows build after r287829
https://bugs.webkit.org/show_bug.cgi?id=235054

Reviewed by Sam Weinig.

FTW removal accidentally removed RECT handling in FloatRect while it is not a part of Direct2D.
This patch recovers it. And we also use IntRect in some places since it is proper one.

  • PlatformWin.cmake:
  • platform/graphics/FloatRect.h:
  • platform/graphics/win/FloatRectWin.cpp: Copied from Source/WebCore/platform/graphics/win/IntRectWin.cpp.

(WebCore::FloatRect::FloatRect):

  • platform/graphics/win/IntRectWin.cpp:

(WebCore::IntRect::IntRect):
(WebCore::IntRect::operator RECT const):

  • platform/win/PopupMenuWin.cpp:

(WebCore::monitorFromHwnd):
(WebCore::PopupMenuWin::calculatePositionAndSize):

Location:
trunk/Source/WebCore
Files:
5 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r287867 r287868  
     12022-01-10  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        Fix Windows build after r287829
     4        https://bugs.webkit.org/show_bug.cgi?id=235054
     5
     6        Reviewed by Sam Weinig.
     7
     8        FTW removal accidentally removed RECT handling in FloatRect while it is not a part of Direct2D.
     9        This patch recovers it. And we also use IntRect in some places since it is proper one.
     10
     11        * PlatformWin.cmake:
     12        * platform/graphics/FloatRect.h:
     13        * platform/graphics/win/FloatRectWin.cpp: Copied from Source/WebCore/platform/graphics/win/IntRectWin.cpp.
     14        (WebCore::FloatRect::FloatRect):
     15        * platform/graphics/win/IntRectWin.cpp:
     16        (WebCore::IntRect::IntRect):
     17        (WebCore::IntRect::operator RECT const):
     18        * platform/win/PopupMenuWin.cpp:
     19        (WebCore::monitorFromHwnd):
     20        (WebCore::PopupMenuWin::calculatePositionAndSize):
     21
    1222022-01-10  Alan Bujtas  <zalan@apple.com>
    223
  • trunk/Source/WebCore/PlatformWin.cmake

    r287829 r287868  
    4343    platform/graphics/win/DIBPixelData.cpp
    4444    platform/graphics/win/DisplayRefreshMonitorWin.cpp
     45    platform/graphics/win/FloatRectWin.cpp
    4546    platform/graphics/win/FontCacheWin.cpp
    4647    platform/graphics/win/FontDescriptionWin.cpp
  • trunk/Source/WebCore/platform/graphics/FloatRect.h

    r287829 r287868  
    223223#endif
    224224
     225#if PLATFORM(WIN)
     226    WEBCORE_EXPORT FloatRect(const RECT&);
     227#endif
     228
    225229    static FloatRect infiniteRect();
    226230    bool isInfinite() const;
  • trunk/Source/WebCore/platform/graphics/win/FloatRectWin.cpp

    r287867 r287868  
    1 
    21/*
    3  * Copyright (C) 2006 Apple Inc.  All rights reserved.
     2 * Copyright (C) 2022 Apple Inc.  All rights reserved.
    43 *
    54 * Redistribution and use in source and binary forms, with or without
     
    2221 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    2322 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    24  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
     23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2524 */
    2625
    2726#include "config.h"
    28 #include "IntRect.h"
     27#include "FloatRect.h"
    2928
    3029#include <windows.h>
    31 #include <wtf/MathExtras.h>
    3230
    3331namespace WebCore {
    3432
    35 IntRect::IntRect(const RECT& r)
    36     : m_location(IntPoint(r.left, r.top)), m_size(IntSize(r.right - r.left, r.bottom - r.top))
     33FloatRect::FloatRect(const RECT& r)
     34    : m_location(r.left, r.top)
     35    , m_size(r.right - r.left, r.bottom - r.top)
    3736{
    3837}
    3938
    40 IntRect::operator RECT() const
    41 {
    42     RECT rect = { x(), y(), maxX(), maxY() };
    43     return rect;
    4439}
    45 
    46 }
  • trunk/Source/WebCore/platform/graphics/win/IntRectWin.cpp

    r287829 r287868  
    11
    22/*
    3  * Copyright (C) 2006 Apple Inc.  All rights reserved.
     3 * Copyright (C) 2006-2022 Apple Inc.  All rights reserved.
    44 *
    55 * Redistribution and use in source and binary forms, with or without
     
    2222 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    2323 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    24  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
     24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2525 */
    2626
     
    3434
    3535IntRect::IntRect(const RECT& r)
    36     : m_location(IntPoint(r.left, r.top)), m_size(IntSize(r.right - r.left, r.bottom - r.top))
     36    : m_location(r.left, r.top)
     37    , m_size(r.right - r.left, r.bottom - r.top)
    3738{
    3839}
     
    4041IntRect::operator RECT() const
    4142{
    42     RECT rect = { x(), y(), maxX(), maxY() };
    43     return rect;
     43    return { x(), y(), maxX(), maxY() };
    4444}
    4545
  • trunk/Source/WebCore/platform/win/PopupMenuWin.cpp

    r285640 r287868  
    9898}
    9999
    100 static FloatRect monitorFromHwnd(HWND hwnd)
     100static IntRect monitorFromHwnd(HWND hwnd)
    101101{
    102102    HMONITOR monitor = MonitorFromWindow(hwnd, MONITOR_DEFAULTTOPRIMARY);
     
    306306        ::MoveWindow(m_popup, absoluteScreenCoords.x(), absoluteScreenCoords.y(), absoluteScreenCoords.width(), absoluteScreenCoords.height(), false);
    307307
    308     FloatRect screen = monitorFromHwnd(m_popup);
     308    IntRect screen = monitorFromHwnd(m_popup);
    309309   
    310310    // Now we determine the actual location and measurements of the popup itself.
Note: See TracChangeset for help on using the changeset viewer.