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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 return pixelSnappedIntRect(replacedContentRect(overriddenIntrinsicSize)); | 137 return pixelSnappedIntRect(replacedContentRect(overriddenIntrinsicSize)); |
138 } | 138 } |
139 | 139 |
140 bool RenderVideo::shouldDisplayVideo() const | 140 bool RenderVideo::shouldDisplayVideo() const |
141 { | 141 { |
142 return !videoElement()->shouldDisplayPosterImage(); | 142 return !videoElement()->shouldDisplayPosterImage(); |
143 } | 143 } |
144 | 144 |
145 void RenderVideo::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paintOf
fset) | 145 void RenderVideo::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paintOf
fset) |
146 { | 146 { |
147 MediaPlayer* mediaPlayer = mediaElement()->player(); | 147 WebMediaPlayer* mediaPlayer = mediaElement()->webMediaPlayer(); |
148 bool displayingPoster = videoElement()->shouldDisplayPosterImage(); | 148 bool displayingPoster = videoElement()->shouldDisplayPosterImage(); |
149 if (!displayingPoster && !mediaPlayer) | 149 if (!displayingPoster && !mediaPlayer) |
150 return; | 150 return; |
151 | 151 |
152 LayoutRect rect = videoBox(); | 152 LayoutRect rect = videoBox(); |
153 if (rect.isEmpty()) | 153 if (rect.isEmpty()) |
154 return; | 154 return; |
155 rect.moveBy(paintOffset); | 155 rect.moveBy(paintOffset); |
156 | 156 |
157 LayoutRect contentRect = contentBoxRect(); | 157 LayoutRect contentRect = contentBoxRect(); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 void RenderVideo::updateFromElement() | 192 void RenderVideo::updateFromElement() |
193 { | 193 { |
194 RenderMedia::updateFromElement(); | 194 RenderMedia::updateFromElement(); |
195 updatePlayer(); | 195 updatePlayer(); |
196 } | 196 } |
197 | 197 |
198 void RenderVideo::updatePlayer() | 198 void RenderVideo::updatePlayer() |
199 { | 199 { |
200 updateIntrinsicSize(); | 200 updateIntrinsicSize(); |
201 | 201 |
202 MediaPlayer* mediaPlayer = mediaElement()->player(); | 202 WebMediaPlayer* mediaPlayer = mediaElement()->webMediaPlayer(); |
203 if (!mediaPlayer) | 203 if (!mediaPlayer) |
204 return; | 204 return; |
205 | 205 |
206 if (!videoElement()->isActive()) | 206 if (!videoElement()->isActive()) |
207 return; | 207 return; |
208 | 208 |
209 videoElement()->setNeedsCompositingUpdate(); | 209 videoElement()->setNeedsCompositingUpdate(); |
210 } | 210 } |
211 | 211 |
212 LayoutUnit RenderVideo::computeReplacedLogicalWidth(ShouldComputePreferred shoul
dComputePreferred) const | 212 LayoutUnit RenderVideo::computeReplacedLogicalWidth(ShouldComputePreferred shoul
dComputePreferred) const |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 return CompositingReasonVideo; | 278 return CompositingReasonVideo; |
279 } | 279 } |
280 | 280 |
281 if (shouldDisplayVideo() && supportsAcceleratedRendering()) | 281 if (shouldDisplayVideo() && supportsAcceleratedRendering()) |
282 return CompositingReasonVideo; | 282 return CompositingReasonVideo; |
283 | 283 |
284 return CompositingReasonNone; | 284 return CompositingReasonNone; |
285 } | 285 } |
286 | 286 |
287 } // namespace blink | 287 } // namespace blink |
OLD | NEW |