| 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 GraphicsContext* context = paintInfo.context; | 163 GraphicsContext* context = paintInfo.context; |
| 164 bool clip = !contentRect.contains(rect); | 164 bool clip = !contentRect.contains(rect); |
| 165 if (clip) { | 165 if (clip) { |
| 166 context->save(); | 166 context->save(); |
| 167 context->clip(contentRect); | 167 context->clip(contentRect); |
| 168 } | 168 } |
| 169 | 169 |
| 170 if (displayingPoster) | 170 if (displayingPoster) |
| 171 paintIntoRect(context, rect); | 171 paintIntoRect(context, rect); |
| 172 else if ((document().view() && document().view()->paintBehavior() & PaintBeh
aviorFlattenCompositingLayers) || !acceleratedRenderingInUse()) | 172 else if ((document().view() && document().view()->paintBehavior() & PaintBeh
aviorFlattenCompositingLayers) || !acceleratedRenderingInUse()) |
| 173 mediaPlayer->paint(context, pixelSnappedIntRect(rect)); | 173 videoElement()->paintCurrentFrameInContext(context, pixelSnappedIntRect(
rect)); |
| 174 | 174 |
| 175 if (clip) | 175 if (clip) |
| 176 context->restore(); | 176 context->restore(); |
| 177 } | 177 } |
| 178 | 178 |
| 179 bool RenderVideo::acceleratedRenderingInUse() | 179 bool RenderVideo::acceleratedRenderingInUse() |
| 180 { | 180 { |
| 181 blink::WebLayer* webLayer = mediaElement()->platformLayer(); | 181 blink::WebLayer* webLayer = mediaElement()->platformLayer(); |
| 182 return webLayer && !webLayer->isOrphan(); | 182 return webLayer && !webLayer->isOrphan(); |
| 183 } | 183 } |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 return CompositingReasonVideo; | 282 return CompositingReasonVideo; |
| 283 } | 283 } |
| 284 | 284 |
| 285 if ((triggers & VideoTrigger) && shouldDisplayVideo() && supportsAccelerated
Rendering()) | 285 if ((triggers & VideoTrigger) && shouldDisplayVideo() && supportsAccelerated
Rendering()) |
| 286 return CompositingReasonVideo; | 286 return CompositingReasonVideo; |
| 287 | 287 |
| 288 return CompositingReasonNone; | 288 return CompositingReasonNone; |
| 289 } | 289 } |
| 290 | 290 |
| 291 } // namespace blink | 291 } // namespace blink |
| OLD | NEW |