| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "core/paint/VideoPainter.h" | 6 #include "core/paint/VideoPainter.h" |
| 7 | 7 |
| 8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
| 9 #include "core/frame/FrameView.h" | 9 #include "core/frame/FrameView.h" |
| 10 #include "core/html/HTMLVideoElement.h" | 10 #include "core/html/HTMLVideoElement.h" |
| 11 #include "core/paint/ImagePainter.h" | 11 #include "core/paint/ImagePainter.h" |
| 12 #include "core/rendering/PaintInfo.h" | 12 #include "core/rendering/PaintInfo.h" |
| 13 #include "core/rendering/RenderVideo.h" | 13 #include "core/rendering/RenderVideo.h" |
| 14 #include "platform/geometry/LayoutPoint.h" | 14 #include "platform/geometry/LayoutPoint.h" |
| 15 #include "platform/graphics/GraphicsContextStateSaver.h" | |
| 16 #include "platform/graphics/media/MediaPlayer.h" | |
| 17 | 15 |
| 18 namespace blink { | 16 namespace blink { |
| 19 | 17 |
| 20 void VideoPainter::paintReplaced(const PaintInfo& paintInfo, const LayoutPoint&
paintOffset) | 18 void VideoPainter::paintReplaced(const PaintInfo& paintInfo, const LayoutPoint&
paintOffset) |
| 21 { | 19 { |
| 22 WebMediaPlayer* mediaPlayer = m_renderVideo.mediaElement()->webMediaPlayer()
; | 20 WebMediaPlayer* mediaPlayer = m_renderVideo.mediaElement()->webMediaPlayer()
; |
| 23 bool displayingPoster = m_renderVideo.videoElement()->shouldDisplayPosterIma
ge(); | 21 bool displayingPoster = m_renderVideo.videoElement()->shouldDisplayPosterIma
ge(); |
| 24 if (!displayingPoster && !mediaPlayer) | 22 if (!displayingPoster && !mediaPlayer) |
| 25 return; | 23 return; |
| 26 | 24 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 41 if (displayingPoster) | 39 if (displayingPoster) |
| 42 ImagePainter(m_renderVideo).paintIntoRect(context, rect); | 40 ImagePainter(m_renderVideo).paintIntoRect(context, rect); |
| 43 else if ((m_renderVideo.document().view() && m_renderVideo.document().view()
->paintBehavior() & PaintBehaviorFlattenCompositingLayers) || !m_renderVideo.acc
eleratedRenderingInUse()) | 41 else if ((m_renderVideo.document().view() && m_renderVideo.document().view()
->paintBehavior() & PaintBehaviorFlattenCompositingLayers) || !m_renderVideo.acc
eleratedRenderingInUse()) |
| 44 m_renderVideo.videoElement()->paintCurrentFrameInContext(context, pixelS
nappedIntRect(rect)); | 42 m_renderVideo.videoElement()->paintCurrentFrameInContext(context, pixelS
nappedIntRect(rect)); |
| 45 | 43 |
| 46 if (clip) | 44 if (clip) |
| 47 context->restore(); | 45 context->restore(); |
| 48 } | 46 } |
| 49 | 47 |
| 50 } // namespace blink | 48 } // namespace blink |
| OLD | NEW |