| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 // even if we know the video intrinsic size but aren't able to draw video fr
ames yet | 115 // even if we know the video intrinsic size but aren't able to draw video fr
ames yet |
| 116 // (we don't want to scale the poster to the video size without keeping aspe
ct ratio). | 116 // (we don't want to scale the poster to the video size without keeping aspe
ct ratio). |
| 117 if (videoElement()->shouldDisplayPosterImage()) | 117 if (videoElement()->shouldDisplayPosterImage()) |
| 118 m_cachedImageSize = intrinsicSize(); | 118 m_cachedImageSize = intrinsicSize(); |
| 119 | 119 |
| 120 // The intrinsic size is now that of the image, but in case we already had t
he | 120 // The intrinsic size is now that of the image, but in case we already had t
he |
| 121 // intrinsic size of the video we call this here to restore the video size. | 121 // intrinsic size of the video we call this here to restore the video size. |
| 122 updateIntrinsicSize(); | 122 updateIntrinsicSize(); |
| 123 } | 123 } |
| 124 | 124 |
| 125 IntRect LayoutVideo::videoBox() const | 125 LayoutRect LayoutVideo::videoBox() const |
| 126 { | 126 { |
| 127 const LayoutSize* overriddenIntrinsicSize = nullptr; | 127 const LayoutSize* overriddenIntrinsicSize = nullptr; |
| 128 if (videoElement()->shouldDisplayPosterImage()) | 128 if (videoElement()->shouldDisplayPosterImage()) |
| 129 overriddenIntrinsicSize = &m_cachedImageSize; | 129 overriddenIntrinsicSize = &m_cachedImageSize; |
| 130 | 130 |
| 131 return pixelSnappedIntRect(replacedContentRect(overriddenIntrinsicSize)); | 131 return replacedContentRect(overriddenIntrinsicSize); |
| 132 } | 132 } |
| 133 | 133 |
| 134 bool LayoutVideo::shouldDisplayVideo() const | 134 bool LayoutVideo::shouldDisplayVideo() const |
| 135 { | 135 { |
| 136 return !videoElement()->shouldDisplayPosterImage(); | 136 return !videoElement()->shouldDisplayPosterImage(); |
| 137 } | 137 } |
| 138 | 138 |
| 139 void LayoutVideo::paintReplaced(const PaintInfo& paintInfo, const LayoutPoint& p
aintOffset) const | 139 void LayoutVideo::paintReplaced(const PaintInfo& paintInfo, const LayoutPoint& p
aintOffset) const |
| 140 { | 140 { |
| 141 VideoPainter(*this).paintReplaced(paintInfo, paintOffset); | 141 VideoPainter(*this).paintReplaced(paintInfo, paintOffset); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 if (element->isFullscreen() && element->usesOverlayFullscreenVideo()) | 201 if (element->isFullscreen() && element->usesOverlayFullscreenVideo()) |
| 202 return CompositingReasonVideo; | 202 return CompositingReasonVideo; |
| 203 | 203 |
| 204 if (shouldDisplayVideo() && supportsAcceleratedRendering()) | 204 if (shouldDisplayVideo() && supportsAcceleratedRendering()) |
| 205 return CompositingReasonVideo; | 205 return CompositingReasonVideo; |
| 206 | 206 |
| 207 return CompositingReasonNone; | 207 return CompositingReasonNone; |
| 208 } | 208 } |
| 209 | 209 |
| 210 } // namespace blink | 210 } // namespace blink |
| OLD | NEW |