Title: [223052] trunk/Source/WebCore
Revision
223052
Author
[email protected]
Date
2017-10-09 10:56:35 -0700 (Mon, 09 Oct 2017)

Log Message

Blurry captions on retina screens.
https://bugs.webkit.org/show_bug.cgi?id=177560
rdar://problem/17913388

Patch by Jeremy Jones <[email protected]> on 2017-10-09
Reviewed by Jer Noble.

No new tests because the contents scale of the captions layer is not exposed to the DOM.

The captions layer contents scale needs to take into account the device screen scale to get the correct resolution for captions.

* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::updateTextTrackRepresentation):
(WebCore::MediaControlTextTrackContainerElement::updateSizes):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (223051 => 223052)


--- trunk/Source/WebCore/ChangeLog	2017-10-09 17:54:31 UTC (rev 223051)
+++ trunk/Source/WebCore/ChangeLog	2017-10-09 17:56:35 UTC (rev 223052)
@@ -1,3 +1,19 @@
+2017-10-09  Jeremy Jones  <[email protected]>
+
+        Blurry captions on retina screens.
+        https://bugs.webkit.org/show_bug.cgi?id=177560
+        rdar://problem/17913388
+
+        Reviewed by Jer Noble.
+
+        No new tests because the contents scale of the captions layer is not exposed to the DOM.
+
+        The captions layer contents scale needs to take into account the device screen scale to get the correct resolution for captions.
+
+        * html/shadow/MediaControlElements.cpp:
+        (WebCore::MediaControlTextTrackContainerElement::updateTextTrackRepresentation):
+        (WebCore::MediaControlTextTrackContainerElement::updateSizes):
+
 2017-10-09  Wenson Hsieh  <[email protected]>
 
         Unreviewed, fix the Windows build after r223031

Modified: trunk/Source/WebCore/html/shadow/MediaControlElements.cpp (223051 => 223052)


--- trunk/Source/WebCore/html/shadow/MediaControlElements.cpp	2017-10-09 17:54:31 UTC (rev 223051)
+++ trunk/Source/WebCore/html/shadow/MediaControlElements.cpp	2017-10-09 17:56:35 UTC (rev 223052)
@@ -1292,6 +1292,8 @@
 
     if (!m_textTrackRepresentation) {
         m_textTrackRepresentation = TextTrackRepresentation::create(*this);
+        if (document().page())
+            m_textTrackRepresentation->setContentScale(document().page()->deviceScaleFactor());
         m_updateTextTrackRepresentationStyle = true;
         mediaElement->setTextTrackRepresentation(m_textTrackRepresentation.get());
     }
@@ -1360,9 +1362,12 @@
     mediaElement->syncTextTrackBounds();
 
     IntRect videoBox;
-    if (m_textTrackRepresentation)
+    if (m_textTrackRepresentation) {
         videoBox = m_textTrackRepresentation->bounds();
-    else {
+        float deviceScaleFactor = document().page()->deviceScaleFactor();
+        videoBox.setWidth(videoBox.width() * deviceScaleFactor);
+        videoBox.setHeight(videoBox.height() * deviceScaleFactor);
+    } else {
         if (!is<RenderVideo>(mediaElement->renderer()))
             return;
         videoBox = downcast<RenderVideo>(*mediaElement->renderer()).videoBox();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to