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 22 matching lines...) Expand all Loading... | |
33 #include "core/frame/LocalFrame.h" | 33 #include "core/frame/LocalFrame.h" |
34 #include "core/html/HTMLVideoElement.h" | 34 #include "core/html/HTMLVideoElement.h" |
35 #include "core/rendering/PaintInfo.h" | 35 #include "core/rendering/PaintInfo.h" |
36 #include "core/rendering/RenderFullScreen.h" | 36 #include "core/rendering/RenderFullScreen.h" |
37 #include "platform/graphics/media/MediaPlayer.h" | 37 #include "platform/graphics/media/MediaPlayer.h" |
38 #include "public/platform/WebLayer.h" | 38 #include "public/platform/WebLayer.h" |
39 | 39 |
40 namespace WebCore { | 40 namespace WebCore { |
41 | 41 |
42 using namespace HTMLNames; | 42 using namespace HTMLNames; |
43 using blink::WebMediaPlayer; | |
acolwell GONE FROM CHROMIUM
2014/05/20 16:40:21
nit: Just use blink:: at the one location where yo
| |
43 | 44 |
44 RenderVideo::RenderVideo(HTMLVideoElement* video) | 45 RenderVideo::RenderVideo(HTMLVideoElement* video) |
45 : RenderMedia(video) | 46 : RenderMedia(video) |
46 { | 47 { |
47 setIntrinsicSize(calculateIntrinsicSize()); | 48 setIntrinsicSize(calculateIntrinsicSize()); |
48 } | 49 } |
49 | 50 |
50 RenderVideo::~RenderVideo() | 51 RenderVideo::~RenderVideo() |
51 { | 52 { |
52 } | 53 } |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
90 | 91 |
91 // Spec text from 4.8.6 | 92 // Spec text from 4.8.6 |
92 // | 93 // |
93 // The intrinsic width of a video element's playback area is the intrinsic w idth | 94 // The intrinsic width of a video element's playback area is the intrinsic w idth |
94 // of the video resource, if that is available; otherwise it is the intrinsi c | 95 // of the video resource, if that is available; otherwise it is the intrinsi c |
95 // width of the poster frame, if that is available; otherwise it is 300 CSS pixels. | 96 // width of the poster frame, if that is available; otherwise it is 300 CSS pixels. |
96 // | 97 // |
97 // The intrinsic height of a video element's playback area is the intrinsic height | 98 // The intrinsic height of a video element's playback area is the intrinsic height |
98 // of the video resource, if that is available; otherwise it is the intrinsi c | 99 // of the video resource, if that is available; otherwise it is the intrinsi c |
99 // height of the poster frame, if that is available; otherwise it is 150 CSS pixels. | 100 // height of the poster frame, if that is available; otherwise it is 150 CSS pixels. |
100 MediaPlayer* player = mediaElement()->player(); | 101 WebMediaPlayer* webMediaPlayer = mediaElement()->webMediaPlayer(); |
101 if (player && video->readyState() >= HTMLVideoElement::HAVE_METADATA) { | 102 if (webMediaPlayer && video->readyState() >= HTMLVideoElement::HAVE_METADATA ) { |
102 LayoutSize size = player->naturalSize(); | 103 LayoutSize size = static_cast<IntSize>(webMediaPlayer->naturalSize()); |
acolwell GONE FROM CHROMIUM
2014/05/20 16:40:21
nit: If you make size an IntSize instead of a Layo
| |
103 if (!size.isEmpty()) | 104 if (!size.isEmpty()) |
104 return size; | 105 return size; |
105 } | 106 } |
106 | 107 |
107 if (video->shouldDisplayPosterImage() && !m_cachedImageSize.isEmpty() && !im ageResource()->errorOccurred()) | 108 if (video->shouldDisplayPosterImage() && !m_cachedImageSize.isEmpty() && !im ageResource()->errorOccurred()) |
108 return m_cachedImageSize; | 109 return m_cachedImageSize; |
109 | 110 |
110 // <video> in standalone media documents should not use the default 300x150 | 111 // <video> in standalone media documents should not use the default 300x150 |
111 // size since they also have audio-only files. By setting the intrinsic | 112 // size since they also have audio-only files. By setting the intrinsic |
112 // size to 300x1 the video will resize itself in these cases, and audio will | 113 // size to 300x1 the video will resize itself in these cases, and audio will |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
282 return CompositingReasonVideo; | 283 return CompositingReasonVideo; |
283 } | 284 } |
284 | 285 |
285 if ((triggers & VideoTrigger) && shouldDisplayVideo() && supportsAccelerated Rendering()) | 286 if ((triggers & VideoTrigger) && shouldDisplayVideo() && supportsAccelerated Rendering()) |
286 return CompositingReasonVideo; | 287 return CompositingReasonVideo; |
287 | 288 |
288 return CompositingReasonNone; | 289 return CompositingReasonNone; |
289 } | 290 } |
290 | 291 |
291 } // namespace WebCore | 292 } // namespace WebCore |
OLD | NEW |