Title: [180839] trunk/Source/WebCore
Revision
180839
Author
simon.fra...@apple.com
Date
2015-02-28 12:58:51 -0800 (Sat, 28 Feb 2015)

Log Message

Fullscreen video layers are off by one sometimes
https://bugs.webkit.org/show_bug.cgi?id=142122
rdar://problem/19878821

Reviewed by Eric Carlson.

Convert MediaPlayer::naturalSize() to return a FloatSize, since the natural size
isn't always integral (because of preserving pixel aspect ratio etc). Fix all the media
backends to use FloatSizes for natural size. Convert the video image drawing code
paths to FloatSize, since naturalSize is used on the destination rect computation,
and painting should be floating point anyway.

Give the layer created by SourceBufferPrivateAVFObjC a name in debug builds.

* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::videoWidth):
(WebCore::HTMLVideoElement::videoHeight):
(WebCore::HTMLVideoElement::paintCurrentFrameInContext):
* html/HTMLVideoElement.h:
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::size):
(WebCore::CanvasRenderingContext2D::drawImage):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::videoFrameToImage):
* platform/graphics/MediaPlayer.cpp:
(WebCore::NullMediaPlayerPrivate::naturalSize):
(WebCore::MediaPlayer::naturalSize):
(WebCore::MediaPlayer::paint):
(WebCore::MediaPlayer::paintCurrentFrameInContext):
(WebCore::NullMediaPlayerPrivate::paint): Deleted.
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::paintCurrentFrameInContext):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::naturalSize):
(WebCore::MediaPlayerPrivateAVFoundation::setNaturalSize):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::paintCurrentFrameInContext):
(WebCore::MediaPlayerPrivateAVFoundationObjC::paint):
(WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator):
(WebCore::MediaPlayerPrivateAVFoundationObjC::createImageForTimeInRect):
(WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
(WebCore::MediaPlayerPrivateAVFoundationObjC::sizeChanged):
(WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::naturalSize):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paint):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paintCurrentFrameInContext):
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
(WebCore::MediaSourcePrivateAVFObjC::naturalSize):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
(WebCore::SourceBufferPrivateAVFObjC::naturalSize):
* platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.mm:
(WebCore::VideoTrackPrivateMediaSourceAVFObjC::naturalSize):
* platform/graphics/mac/MediaPlayerPrivateQTKit.h:
* platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
(WebCore::MediaPlayerPrivateQTKit::naturalSize):
(WebCore::MediaPlayerPrivateQTKit::paintCurrentFrameInContext):
(WebCore::MediaPlayerPrivateQTKit::paint):
* platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
(WebCore::MockMediaPlayerMediaSource::naturalSize):
(WebCore::MockMediaPlayerMediaSource::paint):
* platform/mock/mediasource/MockMediaPlayerMediaSource.h:
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::calculateIntrinsicSize):
(WebCore::RenderVideo::paintReplaced):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (180838 => 180839)


--- trunk/Source/WebCore/ChangeLog	2015-02-28 20:20:31 UTC (rev 180838)
+++ trunk/Source/WebCore/ChangeLog	2015-02-28 20:58:51 UTC (rev 180839)
@@ -1,3 +1,79 @@
+2015-02-28  Simon Fraser  <simon.fra...@apple.com>
+
+        Fullscreen video layers are off by one sometimes
+        https://bugs.webkit.org/show_bug.cgi?id=142122
+        rdar://problem/19878821
+
+        Reviewed by Eric Carlson.
+
+        Convert MediaPlayer::naturalSize() to return a FloatSize, since the natural size
+        isn't always integral (because of preserving pixel aspect ratio etc). Fix all the media
+        backends to use FloatSizes for natural size. Convert the video image drawing code
+        paths to FloatSize, since naturalSize is used on the destination rect computation,
+        and painting should be floating point anyway.
+        
+        Give the layer created by SourceBufferPrivateAVFObjC a name in debug builds.
+
+        * html/HTMLVideoElement.cpp:
+        (WebCore::HTMLVideoElement::videoWidth):
+        (WebCore::HTMLVideoElement::videoHeight):
+        (WebCore::HTMLVideoElement::paintCurrentFrameInContext):
+        * html/HTMLVideoElement.h:
+        * html/canvas/CanvasRenderingContext2D.cpp:
+        (WebCore::size):
+        (WebCore::CanvasRenderingContext2D::drawImage):
+        * html/canvas/WebGLRenderingContextBase.cpp:
+        (WebCore::WebGLRenderingContextBase::videoFrameToImage):
+        * platform/graphics/MediaPlayer.cpp:
+        (WebCore::NullMediaPlayerPrivate::naturalSize):
+        (WebCore::MediaPlayer::naturalSize):
+        (WebCore::MediaPlayer::paint):
+        (WebCore::MediaPlayer::paintCurrentFrameInContext):
+        (WebCore::NullMediaPlayerPrivate::paint): Deleted.
+        * platform/graphics/MediaPlayer.h:
+        * platform/graphics/MediaPlayerPrivate.h:
+        (WebCore::MediaPlayerPrivateInterface::paintCurrentFrameInContext):
+        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
+        (WebCore::MediaPlayerPrivateAVFoundation::naturalSize):
+        (WebCore::MediaPlayerPrivateAVFoundation::setNaturalSize):
+        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::paintCurrentFrameInContext):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::paint):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageForTimeInRect):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::sizeChanged):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::naturalSize):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paint):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paintCurrentFrameInContext):
+        * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
+        * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
+        (WebCore::MediaSourcePrivateAVFObjC::naturalSize):
+        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
+        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
+        (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
+        (WebCore::SourceBufferPrivateAVFObjC::naturalSize):
+        * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h:
+        * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.mm:
+        (WebCore::VideoTrackPrivateMediaSourceAVFObjC::naturalSize):
+        * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
+        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
+        (WebCore::MediaPlayerPrivateQTKit::naturalSize):
+        (WebCore::MediaPlayerPrivateQTKit::paintCurrentFrameInContext):
+        (WebCore::MediaPlayerPrivateQTKit::paint):
+        * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
+        (WebCore::MockMediaPlayerMediaSource::naturalSize):
+        (WebCore::MockMediaPlayerMediaSource::paint):
+        * platform/mock/mediasource/MockMediaPlayerMediaSource.h:
+        * rendering/RenderVideo.cpp:
+        (WebCore::RenderVideo::calculateIntrinsicSize):
+        (WebCore::RenderVideo::paintReplaced):
+
 2015-02-27  Hunseop Jeong  <hs85.je...@samsung.com>
 
         [EFL][GTK] Fix build break after r180790,180798

Modified: trunk/Source/WebCore/html/HTMLVideoElement.cpp (180838 => 180839)


--- trunk/Source/WebCore/html/HTMLVideoElement.cpp	2015-02-28 20:20:31 UTC (rev 180838)
+++ trunk/Source/WebCore/html/HTMLVideoElement.cpp	2015-02-28 20:58:51 UTC (rev 180839)
@@ -171,14 +171,14 @@
 {
     if (!player())
         return 0;
-    return player()->naturalSize().width();
+    return clampToUnsigned(player()->naturalSize().width());
 }
 
 unsigned HTMLVideoElement::videoHeight() const
 {
     if (!player())
         return 0;
-    return player()->naturalSize().height();
+    return clampToUnsigned(player()->naturalSize().height());
 }
 
 bool HTMLVideoElement::isURLAttribute(const Attribute& attribute) const
@@ -235,7 +235,7 @@
         setDisplayMode(Poster);
 }
 
-void HTMLVideoElement::paintCurrentFrameInContext(GraphicsContext* context, const IntRect& destRect)
+void HTMLVideoElement::paintCurrentFrameInContext(GraphicsContext* context, const FloatRect& destRect)
 {
     MediaPlayer* player = HTMLMediaElement::player();
     if (!player)

Modified: trunk/Source/WebCore/html/HTMLVideoElement.h (180838 => 180839)


--- trunk/Source/WebCore/html/HTMLVideoElement.h	2015-02-28 20:20:31 UTC (rev 180838)
+++ trunk/Source/WebCore/html/HTMLVideoElement.h	2015-02-28 20:58:51 UTC (rev 180839)
@@ -65,7 +65,7 @@
 #endif
 
     // Used by canvas to gain raw pixel access
-    void paintCurrentFrameInContext(GraphicsContext*, const IntRect&);
+    void paintCurrentFrameInContext(GraphicsContext*, const FloatRect&);
 
     PassNativeImagePtr nativeImageForCurrentTime();
 

Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp (180838 => 180839)


--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp	2015-02-28 20:20:31 UTC (rev 180838)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp	2015-02-28 20:58:51 UTC (rev 180839)
@@ -1288,11 +1288,11 @@
 }
 
 #if ENABLE(VIDEO)
-static IntSize size(HTMLVideoElement* video)
+static FloatSize size(HTMLVideoElement* video)
 {
     if (MediaPlayer* player = video->player())
         return player->naturalSize();
-    return IntSize();
+    return FloatSize();
 }
 #endif
 
@@ -1485,8 +1485,8 @@
         ec = TYPE_MISMATCH_ERR;
         return;
     }
-    IntSize s = size(video);
-    drawImage(video, x, y, s.width(), s.height(), ec);
+    FloatSize videoSize = size(video);
+    drawImage(video, x, y, videoSize.width(), videoSize.height(), ec);
 }
 
 void CanvasRenderingContext2D::drawImage(HTMLVideoElement* video,
@@ -1496,8 +1496,8 @@
         ec = TYPE_MISMATCH_ERR;
         return;
     }
-    IntSize s = size(video);
-    drawImage(video, FloatRect(0, 0, s.width(), s.height()), FloatRect(x, y, width, height), ec);
+    FloatSize videoSize = size(video);
+    drawImage(video, FloatRect(0, 0, videoSize.width(), videoSize.height()), FloatRect(x, y, width, height), ec);
 }
 
 void CanvasRenderingContext2D::drawImage(HTMLVideoElement* video,
@@ -1554,7 +1554,7 @@
     c->translate(dstRect.x(), dstRect.y());
     c->scale(FloatSize(dstRect.width() / srcRect.width(), dstRect.height() / srcRect.height()));
     c->translate(-srcRect.x(), -srcRect.y());
-    video->paintCurrentFrameInContext(c, IntRect(IntPoint(), size(video)));
+    video->paintCurrentFrameInContext(c, FloatRect(FloatPoint(), size(video)));
     stateSaver.restore();
     didDraw(dstRect);
 }

Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp (180838 => 180839)


--- trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp	2015-02-28 20:20:31 UTC (rev 180838)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp	2015-02-28 20:58:51 UTC (rev 180839)
@@ -3246,7 +3246,7 @@
         synthesizeGLError(GraphicsContext3D::OUT_OF_MEMORY, "texImage2D", "out of memory");
         return nullptr;
     }
-    IntRect destRect(0, 0, size.width(), size.height());
+    FloatRect destRect(0, 0, size.width(), size.height());
     // FIXME: Turn this into a GPU-GPU texture copy instead of CPU readback.
     video->paintCurrentFrameInContext(buf->context(), destRect);
     return buf->copyImage(backingStoreCopy);

Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp (180838 => 180839)


--- trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp	2015-02-28 20:20:31 UTC (rev 180838)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp	2015-02-28 20:58:51 UTC (rev 180839)
@@ -94,7 +94,7 @@
     virtual PlatformMedia platformMedia() const { return NoPlatformMedia; }
     virtual PlatformLayer* platformLayer() const { return 0; }
 
-    virtual IntSize naturalSize() const { return IntSize(0, 0); }
+    virtual FloatSize naturalSize() const { return FloatSize(); }
 
     virtual bool hasVideo() const { return false; }
     virtual bool hasAudio() const { return false; }
@@ -131,7 +131,7 @@
 
     virtual void setSize(const IntSize&) { }
 
-    virtual void paint(GraphicsContext*, const IntRect&) { }
+    virtual void paint(GraphicsContext*, const FloatRect&) override { }
 
     virtual bool canLoadPoster() const { return false; }
     virtual void setPoster(const String&) { }
@@ -544,7 +544,7 @@
     return m_private->requiresImmediateCompositing();
 }
 
-IntSize MediaPlayer::naturalSize()
+FloatSize MediaPlayer::naturalSize()
 {
     return m_private->naturalSize();
 }
@@ -733,12 +733,12 @@
     m_private->setPreload(preload);
 }
 
-void MediaPlayer::paint(GraphicsContext* p, const IntRect& r)
+void MediaPlayer::paint(GraphicsContext* p, const FloatRect& r)
 {
     m_private->paint(p, r);
 }
 
-void MediaPlayer::paintCurrentFrameInContext(GraphicsContext* p, const IntRect& r)
+void MediaPlayer::paintCurrentFrameInContext(GraphicsContext* p, const FloatRect& r)
 {
     m_private->paintCurrentFrameInContext(p, r);
 }

Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.h (180838 => 180839)


--- trunk/Source/WebCore/platform/graphics/MediaPlayer.h	2015-02-28 20:20:31 UTC (rev 180838)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.h	2015-02-28 20:58:51 UTC (rev 180839)
@@ -311,7 +311,7 @@
     String errorLog() const;
 #endif
 
-    IntSize naturalSize();
+    FloatSize naturalSize();
     bool hasVideo() const;
     bool hasAudio() const;
 
@@ -391,8 +391,8 @@
     bool autoplay() const;
     void setAutoplay(bool);
 
-    void paint(GraphicsContext*, const IntRect&);
-    void paintCurrentFrameInContext(GraphicsContext*, const IntRect&);
+    void paint(GraphicsContext*, const FloatRect&);
+    void paintCurrentFrameInContext(GraphicsContext*, const FloatRect&);
 
     // copyVideoTextureToPlatformTexture() is used to do the GPU-GPU textures copy without a readback to system memory.
     // The first five parameters denote the corresponding GraphicsContext, destination texture, requested level, requested type and the required internalFormat for destination texture.

Modified: trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h (180838 => 180839)


--- trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h	2015-02-28 20:20:31 UTC (rev 180838)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h	2015-02-28 20:58:51 UTC (rev 180839)
@@ -74,7 +74,7 @@
 
     virtual bool canSaveMediaData() const { return false; }
 
-    virtual IntSize naturalSize() const = 0;
+    virtual FloatSize naturalSize() const = 0;
 
     virtual bool hasVideo() const = 0;
     virtual bool hasAudio() const = 0;
@@ -137,9 +137,9 @@
 
     virtual void setSize(const IntSize&) = 0;
 
-    virtual void paint(GraphicsContext*, const IntRect&) = 0;
+    virtual void paint(GraphicsContext*, const FloatRect&) = 0;
 
-    virtual void paintCurrentFrameInContext(GraphicsContext* c, const IntRect& r) { paint(c, r); }
+    virtual void paintCurrentFrameInContext(GraphicsContext* c, const FloatRect& r) { paint(c, r); }
     virtual bool copyVideoTextureToPlatformTexture(GraphicsContext3D*, Platform3DObject, GC3Dint, GC3Denum, GC3Denum, bool, bool) { return false; }
     virtual PassNativeImagePtr nativeImageForCurrentTime() { return nullptr; }
 

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp (180838 => 180839)


--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp	2015-02-28 20:20:31 UTC (rev 180838)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp	2015-02-28 20:58:51 UTC (rev 180839)
@@ -307,7 +307,7 @@
     return m_seeking;
 }
 
-IntSize MediaPlayerPrivateAVFoundation::naturalSize() const
+FloatSize MediaPlayerPrivateAVFoundation::naturalSize() const
 {
     if (!metaDataAvailable())
         return IntSize();
@@ -322,11 +322,11 @@
     return m_cachedNaturalSize;
 }
 
-void MediaPlayerPrivateAVFoundation::setNaturalSize(IntSize size)
+void MediaPlayerPrivateAVFoundation::setNaturalSize(FloatSize size)
 {
-    LOG(Media, "MediaPlayerPrivateAVFoundation:setNaturalSize(%p) - size = %d x %d", this, size.width(), size.height());
+    LOG(Media, "MediaPlayerPrivateAVFoundation:setNaturalSize(%p) - size = %f x %f", this, size.width(), size.height());
 
-    IntSize oldSize = m_cachedNaturalSize;
+    FloatSize oldSize = m_cachedNaturalSize;
     m_cachedNaturalSize = size;
     if (oldSize != m_cachedNaturalSize)
         m_player->sizeChanged();

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h (180838 => 180839)


--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h	2015-02-28 20:20:31 UTC (rev 180838)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h	2015-02-28 20:58:51 UTC (rev 180839)
@@ -161,7 +161,7 @@
     virtual void play() override;
     virtual void pause() override;
 
-    virtual IntSize naturalSize() const override;
+    virtual FloatSize naturalSize() const override;
     virtual bool hasVideo() const override { return m_cachedHasVideo; }
     virtual bool hasAudio() const override { return m_cachedHasAudio; }
     virtual void setVisible(bool) override;
@@ -181,8 +181,8 @@
     virtual std::unique_ptr<PlatformTimeRanges> buffered() const override;
     virtual bool didLoadingProgress() const override;
     virtual void setSize(const IntSize&) override;
-    virtual void paint(GraphicsContext*, const IntRect&) = 0;
-    virtual void paintCurrentFrameInContext(GraphicsContext*, const IntRect&) = 0;
+    virtual void paint(GraphicsContext*, const FloatRect&) = 0;
+    virtual void paintCurrentFrameInContext(GraphicsContext*, const FloatRect&) = 0;
     virtual void setPreload(MediaPlayer::Preload) override;
     virtual PlatformLayer* platformLayer() const { return 0; }
     virtual bool supportsAcceleratedRendering() const = 0;
@@ -265,7 +265,7 @@
     void setDelayCharacteristicsChangedNotification(bool);
     void setDelayCallbacks(bool) const;
     void setIgnoreLoadStateChanges(bool delay) { m_ignoreLoadStateChanges = delay; }
-    void setNaturalSize(IntSize);
+    void setNaturalSize(FloatSize);
     bool isLiveStream() const { return std::isinf(duration()); }
 
     enum MediaRenderingMode { MediaRenderingNone, MediaRenderingToContext, MediaRenderingToLayer };
@@ -320,7 +320,7 @@
     String m_assetURL;
     MediaPlayer::Preload m_preload;
 
-    IntSize m_cachedNaturalSize;
+    FloatSize m_cachedNaturalSize;
     mutable MediaTime m_cachedMaxTimeLoaded;
     mutable MediaTime m_cachedMaxTimeSeekable;
     mutable MediaTime m_cachedMinTimeSeekable;

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp (180838 => 180839)


--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp	2015-02-28 20:20:31 UTC (rev 180838)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp	2015-02-28 20:58:51 UTC (rev 180839)
@@ -106,7 +106,7 @@
 
     void createImageGenerator();
     void destroyImageGenerator();
-    RetainPtr<CGImageRef> createImageForTimeInRect(const MediaTime&, const IntRect&);
+    RetainPtr<CGImageRef> createImageForTimeInRect(const MediaTime&, const FloatRect&);
 
     void createAssetForURL(const String& url, bool inheritURI);
     void setAsset(AVCFURLAssetRef);
@@ -831,7 +831,7 @@
     return MediaPlayerAVAssetStatusLoaded;
 }
 
-void MediaPlayerPrivateAVFoundationCF::paintCurrentFrameInContext(GraphicsContext* context, const IntRect& rect)
+void MediaPlayerPrivateAVFoundationCF::paintCurrentFrameInContext(GraphicsContext* context, const FloatRect& rect)
 {
     ASSERT(isMainThread());
     if (!metaDataAvailable() || context->paintingDisabled())
@@ -846,7 +846,7 @@
     paint(context, rect);
 }
 
-void MediaPlayerPrivateAVFoundationCF::paint(GraphicsContext* context, const IntRect& rect)
+void MediaPlayerPrivateAVFoundationCF::paint(GraphicsContext* context, const FloatRect& rect)
 {
     ASSERT(isMainThread());
     if (!metaDataAvailable() || context->paintingDisabled() || !imageGenerator(m_avfWrapper))
@@ -861,7 +861,7 @@
         context->translate(rect.x(), rect.y() + rect.height());
         context->scale(FloatSize(1.0f, -1.0f));
         context->setImageInterpolationQuality(InterpolationLow);
-        IntRect paintRect(IntPoint(0, 0), IntSize(rect.width(), rect.height()));
+        FloatRect paintRect(FloatPoint(), rect.size());
         CGContextDrawImage(context->platformContext(), CGRectMake(0, 0, paintRect.width(), paintRect.height()), image.get());
         context->restore();
         image = 0;
@@ -2000,7 +2000,7 @@
     m_imageGenerator = 0;
 }
 
-RetainPtr<CGImageRef> AVFWrapper::createImageForTimeInRect(const MediaTime& time, const IntRect& rect)
+RetainPtr<CGImageRef> AVFWrapper::createImageForTimeInRect(const MediaTime& time, const FloatRect& rect)
 {
     if (!m_imageGenerator)
         return 0;

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h (180838 => 180839)


--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h	2015-02-28 20:20:31 UTC (rev 180838)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h	2015-02-28 20:58:51 UTC (rev 180839)
@@ -75,8 +75,8 @@
     virtual MediaTime currentMediaTime() const override;
     virtual void setVolume(float);
     virtual void setClosedCaptionsVisible(bool);
-    virtual void paint(GraphicsContext*, const IntRect&);
-    virtual void paintCurrentFrameInContext(GraphicsContext*, const IntRect&);
+    virtual void paint(GraphicsContext*, const FloatRect&);
+    virtual void paintCurrentFrameInContext(GraphicsContext*, const FloatRect&);
     virtual PlatformLayer* platformLayer() const;
     virtual bool supportsAcceleratedRendering() const { return true; }
     virtual MediaTime mediaTimeForTimeValue(const MediaTime&) const;

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h (180838 => 180839)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h	2015-02-28 20:20:31 UTC (rev 180838)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h	2015-02-28 20:58:51 UTC (rev 180839)
@@ -150,8 +150,8 @@
     virtual MediaTime currentMediaTime() const override;
     virtual void setVolume(float);
     virtual void setClosedCaptionsVisible(bool);
-    virtual void paint(GraphicsContext*, const IntRect&);
-    virtual void paintCurrentFrameInContext(GraphicsContext*, const IntRect&);
+    virtual void paint(GraphicsContext*, const FloatRect&);
+    virtual void paintCurrentFrameInContext(GraphicsContext*, const FloatRect&);
     virtual PlatformLayer* platformLayer() const;
 #if PLATFORM(IOS)
     virtual void setVideoFullscreenLayer(PlatformLayer*);
@@ -217,8 +217,8 @@
 
     void createImageGenerator();
     void destroyImageGenerator();
-    RetainPtr<CGImageRef> createImageForTimeInRect(float, const IntRect&);
-    void paintWithImageGenerator(GraphicsContext*, const IntRect&);
+    RetainPtr<CGImageRef> createImageForTimeInRect(float, const FloatRect&);
+    void paintWithImageGenerator(GraphicsContext*, const FloatRect&);
 
 #if HAVE(AVFOUNDATION_VIDEO_OUTPUT)
     void createVideoOutput();
@@ -226,7 +226,7 @@
     RetainPtr<CVPixelBufferRef> createPixelBuffer();
     void updateLastImage();
     bool videoOutputHasAvailableFrame();
-    void paintWithVideoOutput(GraphicsContext*, const IntRect&);
+    void paintWithVideoOutput(GraphicsContext*, const FloatRect&);
     virtual PassNativeImagePtr nativeImageForCurrentTime() override;
     void waitForVideoOutputMediaDataWillChange();
 #endif

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (180838 => 180839)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2015-02-28 20:20:31 UTC (rev 180838)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2015-02-28 20:58:51 UTC (rev 180839)
@@ -1466,7 +1466,7 @@
     return [error code];
 }
 
-void MediaPlayerPrivateAVFoundationObjC::paintCurrentFrameInContext(GraphicsContext* context, const IntRect& rect)
+void MediaPlayerPrivateAVFoundationObjC::paintCurrentFrameInContext(GraphicsContext* context, const FloatRect& rect)
 {
     if (!metaDataAvailable() || context->paintingDisabled())
         return;
@@ -1487,7 +1487,7 @@
     m_videoFrameHasDrawn = true;
 }
 
-void MediaPlayerPrivateAVFoundationObjC::paint(GraphicsContext* context, const IntRect& rect)
+void MediaPlayerPrivateAVFoundationObjC::paint(GraphicsContext* context, const FloatRect& rect)
 {
     if (!metaDataAvailable() || context->paintingDisabled())
         return;
@@ -1503,7 +1503,7 @@
     paintCurrentFrameInContext(context, rect);
 }
 
-void MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator(GraphicsContext* context, const IntRect& rect)
+void MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator(GraphicsContext* context, const FloatRect& rect)
 {
     LOG(Media, "MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator(%p)", this);
 
@@ -1535,7 +1535,7 @@
     return cache;
 } 
 
-RetainPtr<CGImageRef> MediaPlayerPrivateAVFoundationObjC::createImageForTimeInRect(float time, const IntRect& rect)
+RetainPtr<CGImageRef> MediaPlayerPrivateAVFoundationObjC::createImageForTimeInRect(float time, const FloatRect& rect)
 {
     if (!m_imageGenerator)
         createImageGenerator();
@@ -1827,7 +1827,7 @@
         hasCaptions = [[m_avAsset.get() tracksWithMediaType:AVMediaTypeClosedCaption] count];
 #endif
 
-        presentationSizeDidChange(firstEnabledVideoTrack ? IntSize(CGSizeApplyAffineTransform([firstEnabledVideoTrack naturalSize], [firstEnabledVideoTrack preferredTransform])) : IntSize());
+        presentationSizeDidChange(firstEnabledVideoTrack ? FloatSize(CGSizeApplyAffineTransform([firstEnabledVideoTrack naturalSize], [firstEnabledVideoTrack preferredTransform])) : FloatSize());
     } else {
         bool hasVideo = false;
         bool hasAudio = false;
@@ -2121,7 +2121,7 @@
     if (!m_avAsset)
         return;
 
-    setNaturalSize(roundedIntSize(m_cachedPresentationSize));
+    setNaturalSize(m_cachedPresentationSize);
 }
     
 bool MediaPlayerPrivateAVFoundationObjC::hasSingleSecurityOrigin() const 
@@ -2273,7 +2273,7 @@
         m_lastImage = createImageFromPixelBuffer(pixelBuffer.get());
 }
 
-void MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput(GraphicsContext* context, const IntRect& outputRect)
+void MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput(GraphicsContext* context, const FloatRect& outputRect)
 {
     if (m_videoOutput && !m_lastImage && !videoOutputHasAvailableFrame())
         waitForVideoOutputMediaDataWillChange();

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h (180838 => 180839)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h	2015-02-28 20:20:31 UTC (rev 180838)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h	2015-02-28 20:58:51 UTC (rev 180839)
@@ -115,7 +115,7 @@
 
     virtual bool supportsScanning() const override;
 
-    virtual IntSize naturalSize() const override;
+    virtual FloatSize naturalSize() const override;
 
     virtual bool hasVideo() const override;
     virtual bool hasAudio() const override;
@@ -140,8 +140,8 @@
 
     virtual void setSize(const IntSize&) override;
 
-    virtual void paint(GraphicsContext*, const IntRect&) override;
-    virtual void paintCurrentFrameInContext(GraphicsContext*, const IntRect&) override;
+    virtual void paint(GraphicsContext*, const FloatRect&) override;
+    virtual void paintCurrentFrameInContext(GraphicsContext*, const FloatRect&) override;
 
     virtual bool hasAvailableVideoFrame() const override;
 

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm (180838 => 180839)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm	2015-02-28 20:20:31 UTC (rev 180838)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm	2015-02-28 20:58:51 UTC (rev 180839)
@@ -345,10 +345,10 @@
         [*it setMuted:muted];
 }
 
-IntSize MediaPlayerPrivateMediaSourceAVFObjC::naturalSize() const
+FloatSize MediaPlayerPrivateMediaSourceAVFObjC::naturalSize() const
 {
     if (!m_mediaSourcePrivate)
-        return IntSize();
+        return FloatSize();
 
     return m_mediaSourcePrivate->naturalSize();
 }
@@ -512,12 +512,12 @@
     // No-op.
 }
 
-void MediaPlayerPrivateMediaSourceAVFObjC::paint(GraphicsContext*, const IntRect&)
+void MediaPlayerPrivateMediaSourceAVFObjC::paint(GraphicsContext*, const FloatRect&)
 {
     // FIXME(125157): Implement painting.
 }
 
-void MediaPlayerPrivateMediaSourceAVFObjC::paintCurrentFrameInContext(GraphicsContext*, const IntRect&)
+void MediaPlayerPrivateMediaSourceAVFObjC::paintCurrentFrameInContext(GraphicsContext*, const FloatRect&)
 {
     // FIXME(125157): Implement painting.
 }

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h (180838 => 180839)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h	2015-02-28 20:20:31 UTC (rev 180838)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h	2015-02-28 20:58:51 UTC (rev 180839)
@@ -75,7 +75,7 @@
 
     void seekToTime(const MediaTime&);
     MediaTime fastSeekTimeForMediaTime(const MediaTime&, const MediaTime& negativeThreshold, const MediaTime& positiveThreshold);
-    IntSize naturalSize() const;
+    FloatSize naturalSize() const;
 
 private:
     MediaSourcePrivateAVFObjC(MediaPlayerPrivateMediaSourceAVFObjC*, MediaSourcePrivateClient*);

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm (180838 => 180839)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm	2015-02-28 20:20:31 UTC (rev 180838)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm	2015-02-28 20:58:51 UTC (rev 180839)
@@ -198,9 +198,9 @@
     return seekTime;
 }
 
-IntSize MediaSourcePrivateAVFObjC::naturalSize() const
+FloatSize MediaSourcePrivateAVFObjC::naturalSize() const
 {
-    IntSize result;
+    FloatSize result;
 
     for (auto* sourceBuffer : m_activeSourceBuffers)
         result = result.expandedTo(sourceBuffer->naturalSize());

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h (180838 => 180839)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h	2015-02-28 20:20:31 UTC (rev 180838)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h	2015-02-28 20:58:51 UTC (rev 180839)
@@ -93,7 +93,7 @@
 
     void seekToTime(MediaTime);
     MediaTime fastSeekTimeForMediaTime(MediaTime, MediaTime negativeThreshold, MediaTime positiveThreshold);
-    IntSize naturalSize();
+    FloatSize naturalSize();
 
     int protectedTrackID() const { return m_protectedTrackID; }
     AVStreamDataParser* parser() const { return m_parser.get(); }

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm (180838 => 180839)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm	2015-02-28 20:20:31 UTC (rev 180838)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm	2015-02-28 20:58:51 UTC (rev 180839)
@@ -890,6 +890,9 @@
         [m_parser setShouldProvideMediaData:YES forTrackID:trackID];
         if (!m_displayLayer) {
             m_displayLayer = adoptNS([allocAVSampleBufferDisplayLayerInstance() init]);
+#ifndef NDEBUG
+            [m_displayLayer setName:@"SourceBufferPrivateAVFObjC AVSampleBufferDisplayLayer"];
+#endif
             [m_displayLayer requestMediaDataWhenReadyOnQueue:dispatch_get_main_queue() usingBlock:^{
                 didBecomeReadyForMoreSamples(trackID);
             }];
@@ -1076,9 +1079,9 @@
         m_client->sourceBufferPrivateSeekToTime(this, time);
 }
 
-IntSize SourceBufferPrivateAVFObjC::naturalSize()
+FloatSize SourceBufferPrivateAVFObjC::naturalSize()
 {
-    return roundedIntSize(m_cachedSize);
+    return m_cachedSize;
 }
 
 void SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples(int trackID)

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h (180838 => 180839)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h	2015-02-28 20:20:31 UTC (rev 180838)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h	2015-02-28 20:58:51 UTC (rev 180839)
@@ -55,7 +55,7 @@
 
     int trackID() { return m_trackID; }
 
-    IntSize naturalSize() const;
+    FloatSize naturalSize() const;
 
 private:
     explicit VideoTrackPrivateMediaSourceAVFObjC(AVAssetTrack*, SourceBufferPrivateAVFObjC* parent);

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.mm (180838 => 180839)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.mm	2015-02-28 20:20:31 UTC (rev 180838)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.mm	2015-02-28 20:58:51 UTC (rev 180839)
@@ -80,9 +80,9 @@
     m_parent->trackDidChangeEnabled(this);
 }
 
-IntSize VideoTrackPrivateMediaSourceAVFObjC::naturalSize() const
+FloatSize VideoTrackPrivateMediaSourceAVFObjC::naturalSize() const
 {
-    return IntSize([assetTrack() naturalSize]);
+    return FloatSize([assetTrack() naturalSize]);
 }
 
 }

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp (180838 => 180839)


--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp	2015-02-28 20:20:31 UTC (rev 180838)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp	2015-02-28 20:58:51 UTC (rev 180839)
@@ -129,21 +129,21 @@
 }
 
 // Returns the size of the video
-IntSize MediaPlayerPrivateGStreamerBase::naturalSize() const
+FloatSize MediaPlayerPrivateGStreamerBase::naturalSize() const
 {
     if (!hasVideo())
-        return IntSize();
+        return FloatSize();
 
     if (!m_videoSize.isEmpty())
         return m_videoSize;
 
     WTF::GMutexLocker<GMutex> lock(m_sampleMutex);
     if (!m_sample)
-        return IntSize();
+        return FloatSize();
 
     GstCaps* caps = gst_sample_get_caps(m_sample);
     if (!caps)
-        return IntSize();
+        return FloatSize();
 
 
     // TODO: handle possible clean aperture data. See
@@ -157,7 +157,7 @@
     IntSize originalSize;
     GstVideoFormat format;
     if (!getVideoSizeAndFormatFromCaps(caps, originalSize, format, pixelAspectRatioNumerator, pixelAspectRatioDenominator, stride))
-        return IntSize();
+        return FloatSize();
 
     LOG_MEDIA_MESSAGE("Original video size: %dx%d", originalSize.width(), originalSize.height());
     LOG_MEDIA_MESSAGE("Pixel aspect ratio: %d/%d", pixelAspectRatioNumerator, pixelAspectRatioDenominator);
@@ -188,7 +188,7 @@
     }
 
     LOG_MEDIA_MESSAGE("Natural size: %" G_GUINT64_FORMAT "x%" G_GUINT64_FORMAT, width, height);
-    m_videoSize = IntSize(static_cast<int>(width), static_cast<int>(height));
+    m_videoSize = FloatSize(static_cast<int>(width), static_cast<int>(height));
     return m_videoSize;
 }
 
@@ -351,7 +351,7 @@
     m_size = size;
 }
 
-void MediaPlayerPrivateGStreamerBase::paint(GraphicsContext* context, const IntRect& rect)
+void MediaPlayerPrivateGStreamerBase::paint(GraphicsContext* context, const FloatRect& rect)
 {
 #if USE(TEXTURE_MAPPER_GL) && !USE(COORDINATED_GRAPHICS)
     if (client())

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h (180838 => 180839)


--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h	2015-02-28 20:20:31 UTC (rev 180838)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h	2015-02-28 20:58:51 UTC (rev 180839)
@@ -57,7 +57,7 @@
 public:
     virtual ~MediaPlayerPrivateGStreamerBase();
 
-    IntSize naturalSize() const;
+    FloatSize naturalSize() const;
 
     void setVolume(float);
     float volume() const;
@@ -78,7 +78,7 @@
     void sizeChanged();
 
     void triggerRepaint(GstSample*);
-    void paint(GraphicsContext*, const IntRect&);
+    void paint(GraphicsContext*, const FloatRect&);
 
     virtual bool hasSingleSecurityOrigin() const { return true; }
     virtual float maxTimeLoaded() const { return 0.0; }
@@ -129,7 +129,7 @@
     unsigned long m_repaintHandler;
     unsigned long m_volumeSignalHandler;
     unsigned long m_muteSignalHandler;
-    mutable IntSize m_videoSize;
+    mutable FloatSize m_videoSize;
 #if USE(TEXTURE_MAPPER_GL) && !USE(COORDINATED_GRAPHICS)
     PassRefPtr<BitmapTexture> updateTexture(TextureMapper*);
 #endif

Modified: trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h (180838 => 180839)


--- trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h	2015-02-28 20:20:31 UTC (rev 180838)
+++ trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h	2015-02-28 20:58:51 UTC (rev 180839)
@@ -76,7 +76,7 @@
     PlatformMedia platformMedia() const;
     PlatformLayer* platformLayer() const;
 
-    IntSize naturalSize() const;
+    FloatSize naturalSize() const override;
     bool hasVideo() const;
     bool hasAudio() const;
     bool supportsFullscreen() const;
@@ -124,8 +124,8 @@
     
     virtual bool hasAvailableVideoFrame() const;
 
-    void paint(GraphicsContext*, const IntRect&);
-    void paintCurrentFrameInContext(GraphicsContext*, const IntRect&);
+    void paint(GraphicsContext*, const FloatRect&);
+    void paintCurrentFrameInContext(GraphicsContext*, const FloatRect&);
     virtual void prepareForRendering();
 
     bool supportsAcceleratedRendering() const;

Modified: trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm (180838 => 180839)


--- trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm	2015-02-28 20:20:31 UTC (rev 180838)
+++ trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm	2015-02-28 20:58:51 UTC (rev 180839)
@@ -709,10 +709,10 @@
     return m_seekTo >= MediaTime::zeroTime();
 }
 
-IntSize MediaPlayerPrivateQTKit::naturalSize() const
+FloatSize MediaPlayerPrivateQTKit::naturalSize() const
 {
     if (!metaDataAvailable())
-        return IntSize();
+        return FloatSize();
 
     // In spite of the name of this method, return QTMovieNaturalSizeAttribute transformed by the 
     // initial movie scale because the spec says intrinsic size is:
@@ -732,8 +732,9 @@
         // event when this happens, so we must cache the last valid naturalSize here:
         m_cachedNaturalSize = naturalSize;
     }
-        
-    return IntSize(naturalSize.width() * m_scaleFactor.width(), naturalSize.height() * m_scaleFactor.height());
+    
+    naturalSize.scale(m_scaleFactor.width(), m_scaleFactor.height());
+    return naturalSize;
 }
 
 bool MediaPlayerPrivateQTKit::hasVideo() const
@@ -1181,7 +1182,7 @@
     m_player->repaint();
 }
 
-void MediaPlayerPrivateQTKit::paintCurrentFrameInContext(GraphicsContext* context, const IntRect& r)
+void MediaPlayerPrivateQTKit::paintCurrentFrameInContext(GraphicsContext* context, const FloatRect& r)
 {
     id qtVideoRenderer = m_qtVideoRenderer.get();
     if (!qtVideoRenderer && currentRenderingMode() == MediaRenderingMovieLayer) {
@@ -1195,7 +1196,7 @@
     paint(context, r);
 }
 
-void MediaPlayerPrivateQTKit::paint(GraphicsContext* context, const IntRect& r)
+void MediaPlayerPrivateQTKit::paint(GraphicsContext* context, const FloatRect& r)
 {
     if (context->paintingDisabled() || m_hasUnsupportedTracks)
         return;
@@ -1207,7 +1208,7 @@
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
     NSGraphicsContext* newContext;
     FloatSize scaleFactor(1.0f, -1.0f);
-    IntRect paintRect(IntPoint(0, 0), IntSize(r.width(), r.height()));
+    FloatRect paintRect(FloatPoint(), r.size());
 
     GraphicsContextStateSaver stateSaver(*context);
     context->translate(r.x(), r.y() + r.height());

Modified: trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp (180838 => 180839)


--- trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp	2015-02-28 20:20:31 UTC (rev 180838)
+++ trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp	2015-02-28 20:58:51 UTC (rev 180839)
@@ -143,7 +143,7 @@
     m_paused = SUCCEEDED(m_mediaSession->Pause());
 }
 
-IntSize MediaPlayerPrivateMediaFoundation::naturalSize() const 
+FloatSize MediaPlayerPrivateMediaFoundation::naturalSize() const 
 {
     return m_size;
 }
@@ -221,7 +221,7 @@
     m_videoDisplay->SetVideoPosition(nullptr, &rc);
 }
 
-void MediaPlayerPrivateMediaFoundation::paint(GraphicsContext* context, const IntRect& rect)
+void MediaPlayerPrivateMediaFoundation::paint(GraphicsContext* context, const FloatRect& rect)
 {
     if (context->paintingDisabled()
         || !m_player->visible())

Modified: trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.h (180838 => 180839)


--- trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.h	2015-02-28 20:20:31 UTC (rev 180838)
+++ trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.h	2015-02-28 20:58:51 UTC (rev 180839)
@@ -49,7 +49,7 @@
     virtual void play();
     virtual void pause();
 
-    virtual IntSize naturalSize() const;
+    virtual FloatSize naturalSize() const;
 
     virtual bool hasVideo() const;
     virtual bool hasAudio() const;
@@ -69,7 +69,7 @@
 
     virtual void setSize(const IntSize&);
 
-    virtual void paint(GraphicsContext*, const IntRect&);
+    virtual void paint(GraphicsContext*, const FloatRect&);
 
 private:
     MediaPlayer* m_player;
@@ -81,7 +81,7 @@
     bool m_hasVideo;
     HWND m_hwndVideo;
     MediaPlayer::ReadyState m_readyState;
-    IntRect m_lastPaintRect;
+    FloatRect m_lastPaintRect;
 
     COMPtr<IMFMediaSession> m_mediaSession;
     COMPtr<IMFSourceResolver> m_sourceResolver;

Modified: trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp (180838 => 180839)


--- trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp	2015-02-28 20:20:31 UTC (rev 180838)
+++ trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp	2015-02-28 20:58:51 UTC (rev 180839)
@@ -118,9 +118,9 @@
     m_playing = 0;
 }
 
-IntSize MockMediaPlayerMediaSource::naturalSize() const
+FloatSize MockMediaPlayerMediaSource::naturalSize() const
 {
-    return IntSize();
+    return FloatSize();
 }
 
 bool MockMediaPlayerMediaSource::hasVideo() const
@@ -179,7 +179,7 @@
 {
 }
 
-void MockMediaPlayerMediaSource::paint(GraphicsContext*, const IntRect&)
+void MockMediaPlayerMediaSource::paint(GraphicsContext*, const FloatRect&)
 {
 }
 

Modified: trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h (180838 => 180839)


--- trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h	2015-02-28 20:20:31 UTC (rev 180838)
+++ trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h	2015-02-28 20:58:51 UTC (rev 180839)
@@ -63,7 +63,7 @@
     virtual void cancelLoad() override;
     virtual void play() override;
     virtual void pause() override;
-    virtual IntSize naturalSize() const override;
+    virtual FloatSize naturalSize() const override;
     virtual bool hasVideo() const override;
     virtual bool hasAudio() const override;
     virtual void setVisible(bool) override;
@@ -74,7 +74,7 @@
     virtual std::unique_ptr<PlatformTimeRanges> buffered() const override;
     virtual bool didLoadingProgress() const override;
     virtual void setSize(const IntSize&) override;
-    virtual void paint(GraphicsContext*, const IntRect&) override;
+    virtual void paint(GraphicsContext*, const FloatRect&) override;
     virtual MediaTime currentMediaTime() const override;
     virtual MediaTime durationMediaTime() const override;
     virtual void seekWithTolerance(const MediaTime&, const MediaTime&, const MediaTime&) override;

Modified: trunk/Source/WebCore/rendering/RenderVideo.cpp (180838 => 180839)


--- trunk/Source/WebCore/rendering/RenderVideo.cpp	2015-02-28 20:20:31 UTC (rev 180838)
+++ trunk/Source/WebCore/rendering/RenderVideo.cpp	2015-02-28 20:58:51 UTC (rev 180839)
@@ -106,7 +106,7 @@
     // height of the poster frame, if that is available; otherwise it is 150 CSS pixels.
     MediaPlayer* player = videoElement().player();
     if (player && videoElement().readyState() >= HTMLVideoElement::HAVE_METADATA) {
-        LayoutSize size = player->naturalSize();
+        LayoutSize size(player->naturalSize());
         if (!size.isEmpty())
             return size;
     }
@@ -189,9 +189,9 @@
     if (displayingPoster)
         paintIntoRect(context, rect);
     else if (view().frameView().paintBehavior() & PaintBehaviorFlattenCompositingLayers)
-        mediaPlayer->paintCurrentFrameInContext(context, snappedIntRect(rect));
+        mediaPlayer->paintCurrentFrameInContext(context, rect);
     else
-        mediaPlayer->paint(context, snappedIntRect(rect));
+        mediaPlayer->paint(context, rect);
 }
 
 void RenderVideo::layout()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to