WebKit Bugzilla
Attachment 371379 Details for
Bug 198555
: [WinCairo][MediaFoundation] MediaPlayerPrivateMediaFoundation::naturalSize is going to return larger and larger sizes gradually in high DPI
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
WIP patch
wip.patch (text/plain), 3.26 KB, created by
Fujii Hironori
on 2019-06-05 00:39:17 PDT
(
hide
)
Description:
WIP patch
Filename:
MIME Type:
Creator:
Fujii Hironori
Created:
2019-06-05 00:39:17 PDT
Size:
3.26 KB
patch
obsolete
>diff --git a/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp b/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp >index 00b0d0884fc..83909e59d66 100644 >--- a/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp >+++ b/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp >@@ -98,6 +98,9 @@ MediaPlayerPrivateMediaFoundation::MediaPlayerPrivateMediaFoundation(MediaPlayer > { > createSession(); > createVideoWindow(); >+ >+ if (m_player && m_player->cachedResourceLoader() && m_player->cachedResourceLoader()->document()) >+ m_deviceScaleFactor = m_player->cachedResourceLoader()->document()->deviceScaleFactor(); > } > > MediaPlayerPrivateMediaFoundation::~MediaPlayerPrivateMediaFoundation() >@@ -354,6 +357,7 @@ bool MediaPlayerPrivateMediaFoundation::didLoadingProgress() const > void MediaPlayerPrivateMediaFoundation::setSize(const IntSize& size) > { > m_size = size; >+ m_size.scale(m_deviceScaleFactor); > > auto videoDisplay = this->videoDisplay(); > if (!videoDisplay) >@@ -362,11 +366,8 @@ void MediaPlayerPrivateMediaFoundation::setSize(const IntSize& size) > IntPoint positionInWindow(m_lastPaintRect.location()); > > FrameView* view = nullptr; >- float deviceScaleFactor = 1.0f; >- if (m_player && m_player->cachedResourceLoader() && m_player->cachedResourceLoader()->document()) { >+ if (m_player && m_player->cachedResourceLoader() && m_player->cachedResourceLoader()->document()) > view = m_player->cachedResourceLoader()->document()->view(); >- deviceScaleFactor = m_player->cachedResourceLoader()->document()->deviceScaleFactor(); >- } > > LayoutPoint scrollPosition; > if (view) { >@@ -376,10 +377,10 @@ void MediaPlayerPrivateMediaFoundation::setSize(const IntSize& size) > > positionInWindow.move(-scrollPosition.x().toInt(), -scrollPosition.y().toInt()); > >- int x = positionInWindow.x() * deviceScaleFactor; >- int y = positionInWindow.y() * deviceScaleFactor; >- int w = m_size.width() * deviceScaleFactor; >- int h = m_size.height() * deviceScaleFactor; >+ int x = positionInWindow.x(); >+ int y = positionInWindow.y(); >+ int w = m_size.width(); >+ int h = m_size.height(); > > if (m_hwndVideo) > ::MoveWindow(m_hwndVideo, x, y, w, h, FALSE); >@@ -743,6 +744,7 @@ void MediaPlayerPrivateMediaFoundation::setNaturalSize(const FloatSize& size) > { > LockHolder locker(m_cachedNaturalSizeLock); > m_cachedNaturalSize = size; >+ m_cachedNaturalSize.scale(1 / m_deviceScaleFactor); > } > > bool MediaPlayerPrivateMediaFoundation::createOutputNode(COMPtr<IMFStreamDescriptor> sourceSD, COMPtr<IMFTopologyNode>& node) >diff --git a/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.h b/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.h >index d85f1759020..b35df362d7e 100644 >--- a/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.h >+++ b/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.h >@@ -114,6 +114,7 @@ private: > MediaPlayer::NetworkState m_networkState; > MediaPlayer::ReadyState m_readyState; > FloatRect m_lastPaintRect; >+ float m_deviceScaleFactor { 1 }; > > class MediaPlayerListener; > HashSet<MediaPlayerListener*> m_listeners;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198555
: 371379